1818# under the License.
1919
2020from launch import LaunchDescription
21- from launch .actions import DeclareLaunchArgument , IncludeLaunchDescription
22- from launch .launch_description_sources import PythonLaunchDescriptionSource
21+ from launch .actions import DeclareLaunchArgument
2322from launch .substitutions import LaunchConfiguration
2423from launch_ros .actions import Node
2524from ament_index_python .packages import get_package_share_directory
@@ -40,17 +39,21 @@ def generate_launch_description():
4039 )
4140 sim = LaunchConfiguration ("sim" )
4241
42+ package_share_dir = get_package_share_directory ("clr_pick_and_place_demo" )
43+
4344 description_package = "clr_imetro_environments"
4445 description_file = "clr_trainer_multi_hatch.urdf.xacro"
4546 moveit_config_file_path = "srdf/clr_and_sim_mockups.srdf.xacro"
47+
4648 description_full_path = os .path .join (get_package_share_directory (description_package ), "urdf" , description_file )
47- rviz_config_file = os .path .join (get_package_share_directory ("clr_pick_and_place_demo" ), "rviz" , "demo_config.rviz" )
49+ rviz_config_file = os .path .join (package_share_dir , "rviz" , "demo_config.rviz" )
50+ kinematics_config_file = os .path .join (package_share_dir , "config" , "demo_kinematics.yaml" )
4851
4952 moveit_config = (
5053 MoveItConfigsBuilder ("clr" , package_name = "clr_moveit_config" )
5154 .robot_description (file_path = description_full_path )
5255 .robot_description_semantic (file_path = moveit_config_file_path )
53- .robot_description_kinematics (file_path = "config/kinematics.yaml" )
56+ .robot_description_kinematics (file_path = kinematics_config_file )
5457 .joint_limits (file_path = "config/joint_limits.yaml" )
5558 .trajectory_execution (file_path = "config/clr_moveit_controllers.yaml" )
5659 .planning_pipelines (default_planning_pipeline = "ompl" , pipelines = ["ompl" ])
@@ -69,15 +72,14 @@ def generate_launch_description():
6972 {"use_sim_time" : sim },
7073 ],
7174 ),
72- IncludeLaunchDescription (
73- PythonLaunchDescriptionSource (
74- os .path .join (get_package_share_directory ("clr_moveit_config" ), "launch" , "clr_moveit.launch.py" ),
75- ),
76- launch_arguments = {
77- "launch_rviz" : "false" ,
78- "include_mockups_in_description" : "true" ,
79- "use_sim_time" : sim ,
80- }.items (),
75+ Node (
76+ package = "moveit_ros_move_group" ,
77+ executable = "move_group" ,
78+ output = "both" ,
79+ parameters = [
80+ moveit_config .to_dict (),
81+ {"use_sim_time" : sim },
82+ ],
8183 ),
8284 ]
8385
0 commit comments