@@ -15,16 +15,14 @@ def generate_launch_description():
1515 mir_description_dir = get_package_share_directory ('mir_description' )
1616
1717 def create_robot_description (context ):
18- ns = context .launch_configurations ['namespace' ]
19- if ns .startswith ('/' ):
20- ns = ns [1 :]
21-
22- prefix = context .launch_configurations ['prefix' ]
23- urdf_dir = os .path .join (mir_description_dir , 'urdf' )
24- xacro_file = os .path .join (urdf_dir , 'mir.urdf.xacro' )
25- doc = xacro .process_file (xacro_file , mappings = {'tf_prefix' : ns })
26- robot_desc = doc .toprettyxml (indent = ' ' )
27- return [SetLaunchConfiguration ('robot_description' , robot_desc )]
18+ ns = context .launch_configurations ['namespace' ]
19+ if ns .startswith ('/' ):
20+ ns = ns [1 :]
21+ urdf_dir = os .path .join (mir_description_dir , 'urdf' )
22+ xacro_file = os .path .join (urdf_dir , 'mir.urdf.xacro' )
23+ doc = xacro .process_file (xacro_file , mappings = {'tf_prefix' : ns })
24+ robot_desc = doc .toprettyxml (indent = ' ' )
25+ return [SetLaunchConfiguration ('robot_description' , robot_desc )]
2826
2927 return LaunchDescription ([
3028
@@ -50,8 +48,8 @@ def create_robot_description(context):
5048 executable = 'robot_state_publisher' ,
5149 name = 'robot_state_publisher' ,
5250 output = 'both' ,
53- parameters = [{'use_sim_time' : use_sim_time ,
54- 'robot_description' : LaunchConfiguration ('robot_description' )}],
51+ parameters = [{'use_sim_time' : use_sim_time ,
52+ 'robot_description' : LaunchConfiguration ('robot_description' )}],
5553 namespace = LaunchConfiguration ('namespace' ),
5654 ),
5755
0 commit comments