Ask Your Question

RViz odometry arrows displaced from base_link

asked 2012-07-08 05:08:44 -0500

Pi Robot gravatar image


I'm observing a phenomenon in RViz that I did not think was possible. I'm using a Python script to move a TurtleBot around a square and I'm monitoring the motion using RViz on my desktop computer. Both machines are running the latest Electric debs and the TurtleBot runs Ubuntu 10.04 while the desktop runs 11.10. Both machines are time synced using ntpdate to a common server (

The phenomenon is illustrated in the image below.

image description

As you can see, the Odometry arrows become detached from the robot base. This happens a few seconds after I start the robot moving and the degree of displacement can vary over time. The image here shows a particularly large displacement. I didn't think this was possible since I'm viewing the motion in the /odom frame. Also, I was unable to reproduce the problem when running the same experiment on a different base controller (ArbotiX) on a different robot.

I'm guessing I am missing something fundamental about the connection between the /odom frame and the base_link frame of the robot: can someone straighten me out?


edit retag flag offensive close merge delete


Perhaps the /tf messages are being delay over a wifi link?

joq gravatar image joq  ( 2012-07-08 06:36:29 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-07-08 14:40:13 -0500

Pi Robot gravatar image

updated 2012-07-08 15:22:20 -0500

Thanks @joq. I am only running RViz on the desktop. Everything else is running on the TurleBot's laptop so I'm not sure where the delay would creep in. However, I think I just figured it out.

The TurtleBot launch file runs an robot_pose_ekf node that combines wheel odometry with the gyro info. So what I need to display in RViz is not what's published on the /odom topic but what is published on the /robot_pose_ekf/odom_combined topic, remapped to /robot_pose_ekf/odom in the TurtleBot launch file.

Unfortunately, robot_pose_ekf publishes this data as a geometry_msgs/PoseWithCovarianceStamped message rather than a nav_msgs/Odometry message so one can't display it as an Odometry Display type and get the nice "Keep" feature to display the history. In fact, the /robot_pose_ekf/odom topic is not even listed when selecting the Pose Display type presumably because of the Covariance part.

So I wrote a small script to subscribe to /robot_pose_ekf/odom and republish the data as a nav_msgs/Odometry message type, adding 'base_footprint' as the child_frame_id. Now I can display /robot_pose_ekf/odom in RViz as Odometry arrows and they line up perfectly with the robot base as I would expect.

edit flag offensive delete link more


robot_pose_ekf broadcasts the /odom->/base_footprint transform, so the data in topic /robot_pose_ekf/odom is encapsulated in that transform. You can also display this data using the robot model as described here: (show trail gives the history)

weiin gravatar image weiin  ( 2012-07-08 16:16:26 -0500 )edit

also note the difference between /odom frame and /odom topic, hence the displacement in the picture in your question

weiin gravatar image weiin  ( 2012-07-08 16:18:35 -0500 )edit

Thanks @weiin. Somehow I missed the "show trail" option all these years. The one catch seems to be that the length of the history does not appear to be adjustable so I can't capture the entire path as I can with the Odometry arrows. In any event, it's good to have both options.

Pi Robot gravatar image Pi Robot  ( 2012-07-08 16:26:39 -0500 )edit

Thanx! your post helped a lot in our project as well!..We were facing the same difficulty and could resolve with your help!

Partha gravatar image Partha  ( 2015-05-23 07:26:27 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2012-07-08 05:08:44 -0500

Seen: 1,259 times

Last updated: Jul 08 '12