@@ -43,6 +43,8 @@ def generate_launch_description():
43
43
rviz_config_file = PathJoinSubstitution ([pkg_turtlebot4_description , 'rviz' , 'config.rviz' ])
44
44
namespace = LaunchConfiguration ('namespace' )
45
45
46
+ remappings = [('/tf' , 'tf' ), ('/tf_static' , 'tf_static' )]
47
+
46
48
robot_state_publisher = Node (
47
49
package = 'robot_state_publisher' ,
48
50
executable = 'robot_state_publisher' ,
@@ -53,10 +55,7 @@ def generate_launch_description():
53
55
{'robot_description' : Command (['xacro' , ' ' , xacro_file ,
54
56
' ' , 'namespace:=' , namespace ])},
55
57
],
56
- remappings = [
57
- ('/tf' , 'tf' ),
58
- ('/tf_static' , 'tf_static' )
59
- ]
58
+ remappings = remappings
60
59
)
61
60
62
61
joint_state_publisher = Node (
@@ -65,10 +64,7 @@ def generate_launch_description():
65
64
name = 'joint_state_publisher' ,
66
65
output = 'screen' ,
67
66
parameters = [{'use_sim_time' : LaunchConfiguration ('use_sim_time' )}],
68
- remappings = [
69
- ('/tf' , 'tf' ),
70
- ('/tf_static' , 'tf_static' )
71
- ]
67
+ remappings = remappings
72
68
)
73
69
74
70
rviz2 = Node (
@@ -78,10 +74,7 @@ def generate_launch_description():
78
74
output = 'screen' ,
79
75
arguments = ['-d' , rviz_config_file ],
80
76
parameters = [{'use_sim_time' : LaunchConfiguration ('use_sim_time' )}],
81
- remappings = [
82
- ('/tf' , 'tf' ),
83
- ('/tf_static' , 'tf_static' )
84
- ],
77
+ remappings = remappings ,
85
78
)
86
79
87
80
ld = LaunchDescription (ARGUMENTS )
0 commit comments