tf_remap not working

asked 2021-09-10 13:56:20 -0500

seanb gravatar image

I am working with ros-melodic. I was trying to use tf_remap to change the frame_id "odom" from a bagfile I am running to something like "odom_ignore". In a launch file of mine, I have the following lines:

  <node pkg="tf" type="tf_remap" name="tf_remapper" output="screen">
      <rosparam param="mappings">
          [{old: odom, new: odom_ignore}]
      </rosparam>
  </node>

As well, when running my bagfile I make sure to remap the /tf topic to /tf_old:

rosbag play --clock my_bag.bag /tf:=/tf_old

After starting the bagfile and running my launch file, I even get the output:

Applying the following mappings to incoming tf frame ids {'odom': 'odom_ignore'}

However, running rosrun tf view_frames shows no such remapping in my tf tree. A related ticket on the issue here unhelpfully assumes that the /tf topic is simply not being remapped properly. Has anyone else encountered a similar issue and might have a fix?

edit retag flag offensive close merge delete

Comments

I can't quite understand how this would work. You are trying to remap TF frame_names published by the rosbag node, but leaving all the other nodes publishing unchanged frame_names? Can you provide a link to documentation for this tf_remap node?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-09-11 20:00:26 -0500 )edit

See the tf_remap node (part of the tf package) here. The node listens to the /tf_old topic and publishes to the regular /tf topic. Thus running a bagile with /tf:=/tf_old ensures that only the frames published from this bagfile will be remapped.

seanb gravatar image seanb  ( 2021-09-12 17:38:36 -0500 )edit