From 0dcc6121564e6e63b19f0512bc8cdc2461e349bb Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Wed, 19 Jan 2022 19:16:46 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20replacing=20xacro=20boot=20metho?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launch/robossembler_bringup.launch.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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(