

add separated bringup files
@755619d03da00c0531f5aabd0ed7d747764ba2c1
--- .github/workflows/ci_galactic.yml
+++ .github/workflows/ci_galactic.yml
... | ... | @@ -34,6 +34,7 @@ |
34 | 34 |
target-ros2-distro: ${{ matrix.ros_distribution }} |
35 | 35 |
import-token: ${{ secrets.GITHUB_TOKEN }} |
36 | 36 |
package-name: | |
37 |
+ p9n_bringup |
|
37 | 38 |
p9n_interface |
38 | 39 |
p9n_example |
39 | 40 |
p9n_test(파일 끝에 줄바꿈 문자 없음) |
--- .github/workflows/ci_humble.yml
+++ .github/workflows/ci_humble.yml
... | ... | @@ -34,6 +34,7 @@ |
34 | 34 |
target-ros2-distro: ${{ matrix.ros_distribution }} |
35 | 35 |
import-token: ${{ secrets.GITHUB_TOKEN }} |
36 | 36 |
package-name: | |
37 |
+ p9n_bringup |
|
37 | 38 |
p9n_interface |
38 | 39 |
p9n_example |
39 | 40 |
p9n_test(파일 끝에 줄바꿈 문자 없음) |
--- .vscode/cspell.json
+++ .vscode/cspell.json
... | ... | @@ -10,12 +10,13 @@ |
10 | 10 |
"dualshock", |
11 | 11 |
"m12watanabe1a", |
12 | 12 |
"rclcpp", |
13 |
+ "remappings", |
|
13 | 14 |
"roboteq", |
14 | 15 |
"rosdistro", |
15 | 16 |
"rosidl", |
16 | 17 |
"rviz", |
17 | 18 |
"teleop", |
18 | 19 |
"urdf", |
19 |
- "xacro", |
|
20 |
+ "xacro" |
|
20 | 21 |
] |
21 |
-}(파일 끝에 줄바꿈 문자 없음) |
|
22 |
+} |
+++ p9n_bringup/launch/teleop.launch.py
... | ... | @@ -0,0 +1,64 @@ |
1 | +# Copyright 2022 HarvestX Inc. | |
2 | +# | |
3 | +# Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | +# you may not use this file except in compliance with the License. | |
5 | +# You may obtain a copy of the License at | |
6 | +# | |
7 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
8 | +# | |
9 | +# Unless required by applicable law or agreed to in writing, software | |
10 | +# distributed under the License is distributed on an "AS IS" BASIS, | |
11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | +# See the License for the specific language governing permissions and | |
13 | +# limitations under the License. | |
14 | + | |
15 | +from launch import LaunchDescription | |
16 | +from launch.actions import DeclareLaunchArgument | |
17 | +from launch.substitutions import LaunchConfiguration | |
18 | +from launch.substitutions import TextSubstitution | |
19 | +from launch_ros.actions import ComposableNodeContainer | |
20 | +from launch_ros.descriptions import ComposableNode | |
21 | + | |
22 | + | |
23 | +def generate_launch_description(): | |
24 | + """Generate launch description.""" | |
25 | + hw_type_arg = DeclareLaunchArgument( | |
26 | + 'hw_type', default_value=TextSubstitution(text='DualSense')) | |
27 | + topic_name_arg = DeclareLaunchArgument( | |
28 | + 'topic_name', default_value=TextSubstitution(text='cmd_vel')) | |
29 | + | |
30 | + joy_container = ComposableNodeContainer( | |
31 | + name='joy_container', | |
32 | + package='rclcpp_components', | |
33 | + executable='component_container', | |
34 | + namespace='', | |
35 | + composable_node_descriptions=[ | |
36 | + ComposableNode( | |
37 | + package='joy', | |
38 | + plugin='joy::Joy', | |
39 | + name='joy', | |
40 | + namespace='', | |
41 | + ), | |
42 | + ComposableNode( | |
43 | + package='p9n_node', | |
44 | + plugin='p9n_node::TeleopTwistJoyNode', | |
45 | + name='teleop_twist_joy_node', | |
46 | + namespace='', | |
47 | + parameters=[{ | |
48 | + 'hw_type': LaunchConfiguration('hw_type') | |
49 | + }], | |
50 | + remappings=[ | |
51 | + ('cmd_vel', LaunchConfiguration('topic_name')) | |
52 | + ], | |
53 | + ) | |
54 | + ], | |
55 | + ) | |
56 | + | |
57 | + ld = LaunchDescription() | |
58 | + | |
59 | + ld.add_action(hw_type_arg) | |
60 | + ld.add_action(topic_name_arg) | |
61 | + | |
62 | + ld.add_action(joy_container) | |
63 | + | |
64 | + return ld |
+++ p9n_bringup/p9n_bringup/__init__.py
... | ... | @@ -0,0 +1,0 @@ |
+++ p9n_bringup/package.xml
... | ... | @@ -0,0 +1,18 @@ |
1 | +<?xml version="1.0"?> | |
2 | +<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | |
3 | +<package format="3"> | |
4 | + <name>p9n_bringup</name> | |
5 | + <version>0.0.0</version> | |
6 | + <description>PlayStation Interface Node Launch Files.</description> | |
7 | + <maintainer email="40206149+m12watanabe1a@users.noreply.github.com">m12watanabe1a</maintainer> | |
8 | + <license>Apache License 2.0</license> | |
9 | + | |
10 | + <test_depend>ament_copyright</test_depend> | |
11 | + <test_depend>ament_flake8</test_depend> | |
12 | + <test_depend>ament_pep257</test_depend> | |
13 | + <test_depend>python3-pytest</test_depend> | |
14 | + | |
15 | + <export> | |
16 | + <build_type>ament_python</build_type> | |
17 | + </export> | |
18 | +</package> |
+++ p9n_bringup/resource/p9n_bringup
... | ... | @@ -0,0 +1,0 @@ |
+++ p9n_bringup/setup.cfg
... | ... | @@ -0,0 +1,4 @@ |
1 | +[develop] | |
2 | +script_dir=$base/lib/p9n_bringup | |
3 | +[install] | |
4 | +install_scripts=$base/lib/p9n_bringup |
+++ p9n_bringup/setup.py
... | ... | @@ -0,0 +1,29 @@ |
1 | +"""Setup.""" | |
2 | +from glob import glob | |
3 | + | |
4 | +from setuptools import setup | |
5 | + | |
6 | +package_name = 'p9n_bringup' | |
7 | + | |
8 | +setup( | |
9 | + name=package_name, | |
10 | + version='0.0.0', | |
11 | + packages=[package_name], | |
12 | + data_files=[ | |
13 | + ('share/ament_index/resource_index/packages', | |
14 | + ['resource/' + package_name]), | |
15 | + ('share/' + package_name, ['package.xml']), | |
16 | + ('share/{}/launch'.format(package_name), glob('launch/*.launch.py')), | |
17 | + ], | |
18 | + install_requires=['setuptools'], | |
19 | + zip_safe=True, | |
20 | + maintainer='m12watanabe1a', | |
21 | + maintainer_email='40206149+m12watanabe1a@users.noreply.github.com', | |
22 | + description='PlayStation Interface Node Launch Files.', | |
23 | + license='Apache License 2.0', | |
24 | + tests_require=['pytest'], | |
25 | + entry_points={ | |
26 | + 'console_scripts': [ | |
27 | + ], | |
28 | + }, | |
29 | +) |
+++ p9n_bringup/test/test_copyright.py
... | ... | @@ -0,0 +1,23 @@ |
1 | +# Copyright 2015 Open Source Robotics Foundation, Inc. | |
2 | +# | |
3 | +# Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | +# you may not use this file except in compliance with the License. | |
5 | +# You may obtain a copy of the License at | |
6 | +# | |
7 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
8 | +# | |
9 | +# Unless required by applicable law or agreed to in writing, software | |
10 | +# distributed under the License is distributed on an "AS IS" BASIS, | |
11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | +# See the License for the specific language governing permissions and | |
13 | +# limitations under the License. | |
14 | + | |
15 | +from ament_copyright.main import main | |
16 | +import pytest | |
17 | + | |
18 | + | |
19 | +@pytest.mark.copyright | |
20 | +@pytest.mark.linter | |
21 | +def test_copyright(): | |
22 | + rc = main(argv=['.', 'test']) | |
23 | + assert rc == 0, 'Found errors' |
+++ p9n_bringup/test/test_flake8.py
... | ... | @@ -0,0 +1,25 @@ |
1 | +# Copyright 2017 Open Source Robotics Foundation, Inc. | |
2 | +# | |
3 | +# Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | +# you may not use this file except in compliance with the License. | |
5 | +# You may obtain a copy of the License at | |
6 | +# | |
7 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
8 | +# | |
9 | +# Unless required by applicable law or agreed to in writing, software | |
10 | +# distributed under the License is distributed on an "AS IS" BASIS, | |
11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | +# See the License for the specific language governing permissions and | |
13 | +# limitations under the License. | |
14 | + | |
15 | +from ament_flake8.main import main_with_errors | |
16 | +import pytest | |
17 | + | |
18 | + | |
19 | +@pytest.mark.flake8 | |
20 | +@pytest.mark.linter | |
21 | +def test_flake8(): | |
22 | + rc, errors = main_with_errors(argv=[]) | |
23 | + assert rc == 0, \ | |
24 | + 'Found %d code style errors / warnings:\n' % len(errors) + \ | |
25 | + '\n'.join(errors) |
+++ p9n_bringup/test/test_pep257.py
... | ... | @@ -0,0 +1,23 @@ |
1 | +# Copyright 2015 Open Source Robotics Foundation, Inc. | |
2 | +# | |
3 | +# Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | +# you may not use this file except in compliance with the License. | |
5 | +# You may obtain a copy of the License at | |
6 | +# | |
7 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
8 | +# | |
9 | +# Unless required by applicable law or agreed to in writing, software | |
10 | +# distributed under the License is distributed on an "AS IS" BASIS, | |
11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | +# See the License for the specific language governing permissions and | |
13 | +# limitations under the License. | |
14 | + | |
15 | +from ament_pep257.main import main | |
16 | +import pytest | |
17 | + | |
18 | + | |
19 | +@pytest.mark.linter | |
20 | +@pytest.mark.pep257 | |
21 | +def test_pep257(): | |
22 | + rc = main(argv=['.', 'test']) | |
23 | + assert rc == 0, 'Found code style errors / warnings' |
--- p9n_node/CMakeLists.txt
+++ p9n_node/CMakeLists.txt
... | ... | @@ -25,4 +25,4 @@ |
25 | 25 |
ament_lint_auto_find_test_dependencies() |
26 | 26 |
endif() |
27 | 27 |
|
28 |
-ament_auto_package(INSTALL_TO_SHARE launch) |
|
28 |
+ament_auto_package() |
--- p9n_node/launch/teleop.launch.py
... | ... | @@ -1,60 +0,0 @@ |
1 | -# Copyright 2022 HarvestX Inc. | |
2 | -# | |
3 | -# Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | -# you may not use this file except in compliance with the License. | |
5 | -# You may obtain a copy of the License at | |
6 | -# | |
7 | -# http://www.apache.org/licenses/LICENSE-2.0 | |
8 | -# | |
9 | -# Unless required by applicable law or agreed to in writing, software | |
10 | -# distributed under the License is distributed on an "AS IS" BASIS, | |
11 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | -# See the License for the specific language governing permissions and | |
13 | -# limitations under the License. | |
14 | - | |
15 | -from launch import LaunchDescription | |
16 | -from launch.actions import DeclareLaunchArgument | |
17 | -from launch.substitutions import ( | |
18 | - LaunchConfiguration, | |
19 | - TextSubstitution, | |
20 | -) | |
21 | - | |
22 | -from launch_ros.actions import ComposableNodeContainer | |
23 | -from launch_ros.descriptions import ComposableNode | |
24 | - | |
25 | - | |
26 | -def generate_launch_description(): | |
27 | - """Generate launch description.""" | |
28 | - launch_args = [ | |
29 | - DeclareLaunchArgument( | |
30 | - 'hw_type', | |
31 | - default_value=TextSubstitution(text='DualSense') | |
32 | - ) | |
33 | - ] | |
34 | - nodes = [ | |
35 | - ComposableNodeContainer( | |
36 | - name='joy_container', | |
37 | - package='rclcpp_components', | |
38 | - executable='component_container', | |
39 | - namespace='', | |
40 | - composable_node_descriptions=[ | |
41 | - ComposableNode( | |
42 | - package='joy', | |
43 | - plugin='joy::Joy', | |
44 | - name='joy', | |
45 | - namespace='', | |
46 | - ), | |
47 | - ComposableNode( | |
48 | - package='p9n_node', | |
49 | - plugin='p9n_node::TeleopTwistJoyNode', | |
50 | - name='teleop_twist_joy_node', | |
51 | - namespace='', | |
52 | - parameters=[{ | |
53 | - 'hw_type': LaunchConfiguration('hw_type') | |
54 | - }], | |
55 | - ) | |
56 | - ], | |
57 | - ), | |
58 | - ] | |
59 | - | |
60 | - return LaunchDescription(launch_args + nodes) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?