rosbag2 icon indicating copy to clipboard operation
rosbag2 copied to clipboard

tf_static doesnt work with rosbag2 but tf does

Open saippua opened this issue 3 years ago • 5 comments

Description

I'm saving a rosbag2 with ros2 bag record -a, playing it back and viewing it in rviz2. I'm publishing a pose and a transformation. the transformation is static (it doesnt change)

Expected Behavior

When I playback the rosbag2, I should be able to see the transformation in rviz2.

Actual Behavior

  • if I publish the transformation using StaticTransformBroadcaster (once at the beginning of the recording), the transformation does not appear in rviz2 when I play the bag. I've checked that the bag file has the /tf_static topic and there is a message there.
  • If I publish the transformation using TransformBroadcaster, the transformation does appear in rviz2, and I see the tf tree correctly.
  • If I run rviz2 while publishing to visualize the data feed directly without using rosbag2 in the middle, both StaticTransformBroadcaster and TransformBroadcaster work.

To Reproduce

  1. run a publisher that publishes a pose and transformation
  2. record it using ros2 bag record -a
  3. play back the recording ros2 bag play -l <bag>
  4. view result in rviz2. If using StaticTransformBroadcaster, the tf wont be in rviz.

System (please complete the following information)

  • OS: Ubuntu 20.04
  • ROS 2 Distro: Galactic
  • Version: rosbag2 0.9.1

Additional information

I'm publishing the transformation twice when recording the bag. The first publish allows the recorder to discover and subscribe to the topic, but it doesnt actually record a message. I publish again to make sure a message is recorded. For all tests I'm also making sure that there are tf or tf_static messages in the bag files I'm playing.

saippua avatar Jul 27 '22 09:07 saippua

@saippua Can you please provide example of the rosbag2 with messages from StaticTransformBroadcaster which are not displaying in rviz?

MichaelOrlov avatar Jul 27 '22 18:07 MichaelOrlov

I have exactly the same issue, static tf transforms are not being able to be visualized with rviz.

bjajoh avatar Oct 03 '22 13:10 bjajoh

@saippua @bjajoh We need reliable reproducer for this issue. Could you please provide recorded bags with StaticTransformBroadcaster and with TransformBroadcaster to be able to reproduce and debug issue or please provide minimum valuable reproducer for item 1.

  1. run a publisher that publishes a pose and transformation

MichaelOrlov avatar Oct 03 '22 20:10 MichaelOrlov

Hello, I am facing the same issue on ROS2 foxy. Will try to debug and report back if there is any findings.

Update: But I cannot duplicate the issue on ROS2 humble.

@FlorianPix May I know your ROS2 distro? Have you solved your issue?

Alex-Beh avatar Mar 02 '23 14:03 Alex-Beh

  • Closing as a stale issue.

MichaelOrlov avatar May 05 '24 03:05 MichaelOrlov