Robotics StackExchange | Archived questions

Rviz doesn't show the correct tf2 tree

I'm trying to setup rtabmap algorithm for a project I'm working on. I currently have rgb camera, depth camera, tf, tfstatic and robotdescription recorded in a ros2 bag file (At rate 0.5, in case it matters). I'm launching rtabmapodom and rtabmapslam nodes in a custom launch file. This makes the odom and map tf transforms, and connects them to baselink, which is the parent of all other transforms. Recorded with: "ros2 run tf2tools viewframes --ros-args -r _ns:=/turtle1 -r /tf:=tf -r /tfstatic:=tf_static": image description

Note: However, if I record tf2 frames without remapping "/tf" to "tf", I get the same graph, without map and odom on it. Why is that?

For some reason, these transforms are not seen in Rviz2. When setting the fixed frame to "map", the rtabmap point cloud is being broadcasted, but there are a lot of errors in the "tf" tab: image description

And, if we check the "Tree", only map and odom are seen. image description

If I set the fixed frame from map to base_link in Rviz, there is no point cloud visible and no odom/map transform.

EDIT: If I set the fixed frame to "odom" there is a transform from odom to base_link (Still no point cloud map though). But why can't it then be found from map?

Thanks for your help!

Asked by krzo on 2023-08-10 04:24:26 UTC

Comments

Answers

Your transform for odom in the view_frames output appears to be very out of date.

1691657571 versus 1677792860

With that level of desynchronization it's well outside the bounds of the 10 second buffer in tf so there's no overlapping timestamps that tf can traverse from map -> odom -> base_link so rviz can't render basically any of those links.

You should make sure that any computer on your system has it's time set appropriately. I think this looks like one is about 160 days off.

Asked by tfoote on 2023-08-10 10:12:27 UTC

Comments