ROS tf remapping
Today I was asked how to remap a ROS tf to another one. Normally I would use static_transform_publisher
, which could publish an identical transform of one tf with the new name.
While there is another way, by using tf_remap
, a sample launch file is below
<!--tf remmapper node-->
<node pkg="tf" type="tf_remap" name="tf_remapper" output="screen">
<rosparam param="mappings">
[{old: /imu, new: /base_link}]
</rosparam>
</node>
<!--node whose tf needs to be remapped-->
<node pkg="rosbag" type="play" name="player" args="/home/drive/test.bag">
<remap from="tf" to="tf_old" />
</node>
</launch>