diff --git a/robossembler/launch/robossembler_bringup.launch.py b/robossembler/launch/robossembler_bringup.launch.py index d1b6903..79211e8 100644 --- a/robossembler/launch/robossembler_bringup.launch.py +++ b/robossembler/launch/robossembler_bringup.launch.py @@ -42,14 +42,18 @@ def generate_launch_description(): ) ) - # get xacro file path - xacro_file = os.path.join(get_package_share_directory("rasmt_support"),"urdf/","rasmt.xacro") - # get error if xacro file if missing - assert os.path.exists(xacro_file), "The xacro file of neptun_description doesnt exist"+str(xacro_file) - # parse xacro file from file with arguments - robot_description = xacro.process_file(xacro_file, mappings={'grip':"true",'sim':"true",'robot_name':"rasmt"}) - # convert file to xml format - robot_description_content = robot_description.toxml() + # Load robot description + robot_description_content = Command( + [ + FindExecutable(name="xacro"), " ", + PathJoinSubstitution( + [FindPackageShare("rasmt_support"), "urdf/rasmt.xacro"] + ), " ", + "robot_name:=", LaunchConfiguration("robot_name"), " ", + "sim:=", LaunchConfiguration("sim"), " ", + "grip:=", LaunchConfiguration("grip") + ] + ) control = IncludeLaunchDescription( PythonLaunchDescriptionSource(