Skip to content

Commit 9ccd594

Browse files
author
philipchurchley
committed
universal usage of PathSubstitution
1 parent c631a9b commit 9ccd594

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

example_1/bringup/launch/rrbot.launch.py

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from launch.actions import DeclareLaunchArgument, RegisterEventHandler
1818
from launch.conditions import IfCondition
1919
from launch.event_handlers import OnProcessExit
20-
from launch.substitutions import Command, LaunchConfiguration, PathJoinSubstitution
20+
from launch.substitutions import Command, LaunchConfiguration, PathSubstitution
2121

2222
from launch_ros.actions import Node
2323
from launch_ros.substitutions import FindPackageShare
@@ -31,13 +31,9 @@ def generate_launch_description():
3131
arguments=[
3232
"forward_position_controller",
3333
"--param-file",
34-
PathJoinSubstitution(
35-
[
36-
FindPackageShare("ros2_control_demo_example_1"),
37-
"config",
38-
"rrbot_controllers.yaml",
39-
]
40-
),
34+
PathSubstitution(FindPackageShare("ros2_control_demo_example_1"))
35+
/ "config"
36+
/ "rrbot_controllers.yaml",
4137
],
4238
)
4339

@@ -53,13 +49,9 @@ def generate_launch_description():
5349
package="controller_manager",
5450
executable="ros2_control_node",
5551
parameters=[
56-
PathJoinSubstitution(
57-
[
58-
FindPackageShare("ros2_control_demo_example_1"),
59-
"config",
60-
"rrbot_controllers.yaml",
61-
]
62-
)
52+
PathSubstitution(FindPackageShare("ros2_control_demo_example_1"))
53+
/ "config"
54+
/ "rrbot_controllers.yaml"
6355
],
6456
output="both",
6557
),
@@ -74,13 +66,9 @@ def generate_launch_description():
7466
[
7567
"xacro",
7668
" ",
77-
PathJoinSubstitution(
78-
[
79-
FindPackageShare("ros2_control_demo_example_1"),
80-
"urdf",
81-
"rrbot.urdf.xacro",
82-
]
83-
),
69+
PathSubstitution(FindPackageShare("ros2_control_demo_example_1"))
70+
/ "urdf"
71+
/ "rrbot.urdf.xacro",
8472
]
8573
)
8674
}
@@ -113,7 +101,10 @@ def generate_launch_description():
113101
output="log",
114102
arguments=[
115103
"-d",
116-
PathSubstitution(FindPackageShare("ros2_control_demo_description")) / "rrbot" / "rviz" / "rrbot.rviz",
104+
PathSubstitution(FindPackageShare("ros2_control_demo_description"))
105+
/ "rrbot"
106+
/ "rviz"
107+
/ "rrbot.rviz",
117108
],
118109
condition=IfCondition(LaunchConfiguration("gui")),
119110
)

0 commit comments

Comments
 (0)