1717from launch .actions import DeclareLaunchArgument , RegisterEventHandler
1818from launch .conditions import IfCondition
1919from launch .event_handlers import OnProcessExit
20- from launch .substitutions import Command , LaunchConfiguration , PathJoinSubstitution
20+ from launch .substitutions import Command , LaunchConfiguration , PathSubstitution
2121
2222from launch_ros .actions import Node
2323from 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