rosbag2
rosbag2 copied to clipboard
tf_static doesnt work with rosbag2 but tf does
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_statictopic 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
StaticTransformBroadcasterandTransformBroadcasterwork.
To Reproduce
- run a publisher that publishes a pose and transformation
- record it using
ros2 bag record -a - play back the recording
ros2 bag play -l <bag> - 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 Can you please provide example of the rosbag2 with messages from StaticTransformBroadcaster which are not displaying in rviz?
I have exactly the same issue, static tf transforms are not being able to be visualized with rviz.
@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.
- run a publisher that publishes a pose and transformation
I have the same issue. Heres how the tf tree should look like. Here's how it looks when replaying the ros2 bag.
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?
- Closing as a stale issue.