ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Rviz doesn't show the correct tf2 tree

asked 2023-08-10 04:24:26 -0600

krzo gravatar image

updated 2023-08-10 10:12:40 -0600

tfoote gravatar image

I'm trying to setup rtabmap algorithm for a project I'm working on. I currently have rgb camera, depth camera, tf, tf_static and robot_description recorded in a ros2 bag file (At rate 0.5, in case it matters). I'm launching rtabmap_odom and rtabmap_slam nodes in a custom launch file. This makes the odom and map tf transforms, and connects them to base_link, which is the parent of all other transforms. Recorded with: "ros2 run tf2_tools view_frames --ros-args -r __ns:=/turtle_1 -r /tf:=tf -r /tf_static:=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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-08-10 10:12:27 -0600

tfoote gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-08-10 04:24:26 -0600

Seen: 963 times

Last updated: Aug 10 '23