🔧 replacing xacro boot method
This commit is contained in:
parent
c8fb83c7a1
commit
0dcc612156
1 changed files with 12 additions and 8 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue