rviz odometry plugin does not respect keep value

asked 2019-10-09 05:10:38 -0600

felix gravatar image

It seems that if the frame in which the odometry is displayed is the same (or fixed wrt) the rviz global option fixed frame, then only one odometry is drawn...

My intuition is that the distance computation between current position and last drawn position (to compare to tolerance and decide if we draw a new arrow), is made in the rviz fixed frame, so in my case, the values does not change (even if the robot is moving).

edit retag flag offensive close merge delete


It indeed uses the value configured for Fixed Frame (here), but doesn't seem to be used for delta calculation though.

To me it's not clear whether you have some special Odometry publisher that would require something else.

It might help others (and me, but I'm not really into this kind of thing) if you could provide a little more information about your specific setup, as:

in my case, the values does not change (even if the robot is moving).

implies that you have some circumstance which would require RViz to do something differently.

Note that it could also be that whatever is publishing your odometry messages is doing something non-standard, but at this point I believe we can't say.

gvdhoorn gravatar image gvdhoorn  ( 2019-10-09 05:39:59 -0600 )edit

I think I see where my problem is coming from. I used the robot frame as "fixed frame", so in this frame, odometry difference between two positions will be null.

`(last_position - current_position).length() ` will always be equal to zero, no?

Sorry for the disturbance...

PS: I had this setup because I started to use rviz to display PointCloud2 in the still robot frame... but now that the robot is moving, I should use another "fixed frame"

PPS: not to mention that the rviz documentation says: For correct results, the fixed frame should not be moving relative to the world.

felix gravatar image felix  ( 2019-10-09 06:38:48 -0600 )edit

I have experienced same issue with Turtlebot3 running in gazebo. Default rviz (turtlebot3_bringup turtlebot3_model.launch) is using "base_footprint" link as fixed frame. This results in rviz keeping robot in the center, but that also results in odometry keep value being ignored. I had to change "fixed frame" to "odom" to have detached view and render odometry arrow history

matroskin gravatar image matroskin  ( 2020-07-09 13:49:45 -0600 )edit