@@ -43,6 +43,8 @@ def generate_launch_description():
4343 rviz_config_file = PathJoinSubstitution ([pkg_turtlebot4_description , 'rviz' , 'config.rviz' ])
4444 namespace = LaunchConfiguration ('namespace' )
4545
46+ remappings = [('/tf' , 'tf' ), ('/tf_static' , 'tf_static' )]
47+
4648 robot_state_publisher = Node (
4749 package = 'robot_state_publisher' ,
4850 executable = 'robot_state_publisher' ,
@@ -53,10 +55,7 @@ def generate_launch_description():
5355 {'robot_description' : Command (['xacro' , ' ' , xacro_file ,
5456 ' ' , 'namespace:=' , namespace ])},
5557 ],
56- remappings = [
57- ('/tf' , 'tf' ),
58- ('/tf_static' , 'tf_static' )
59- ]
58+ remappings = remappings
6059 )
6160
6261 joint_state_publisher = Node (
@@ -65,10 +64,7 @@ def generate_launch_description():
6564 name = 'joint_state_publisher' ,
6665 output = 'screen' ,
6766 parameters = [{'use_sim_time' : LaunchConfiguration ('use_sim_time' )}],
68- remappings = [
69- ('/tf' , 'tf' ),
70- ('/tf_static' , 'tf_static' )
71- ]
67+ remappings = remappings
7268 )
7369
7470 rviz2 = Node (
@@ -78,10 +74,7 @@ def generate_launch_description():
7874 output = 'screen' ,
7975 arguments = ['-d' , rviz_config_file ],
8076 parameters = [{'use_sim_time' : LaunchConfiguration ('use_sim_time' )}],
81- remappings = [
82- ('/tf' , 'tf' ),
83- ('/tf_static' , 'tf_static' )
84- ],
77+ remappings = remappings ,
8578 )
8679
8780 ld = LaunchDescription (ARGUMENTS )
0 commit comments