🔧 replacing xacro boot method

This commit is contained in:
Ilya Uraev 2022-01-19 19:16:46 +04:00
parent c8fb83c7a1
commit 0dcc612156

View file

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