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

Rviz plotting points to the nearest 0.5m in the y-direction

asked 2014-09-23 02:02:06 -0500

Hi All,

I'm having an issue with Rviz whereby it is plotting my messages (such as odometry, particle arrays and tf) but rounding in discrete units. This is not a problem with graphics cards. The following picture shows what is happening.

image description

The yellow lines are the odometry arrows which are spaced always 0.5m apart in the y direction. The actual odometry topic is publishing a smooth transition from one point to the next. The spacing between the y directions is always 0.50m, its as if the y value is truncated or rounded to the nearest 0.5m. This also occurs to the tf's and particle poses as a result the particle arrows are sometimes drawn incorrectly (not looking like arrows at all, which seems to be because of this restriction in the y direction). The fixed frame is utm and there is a large number translating from the utm to the odom frame. However tf_echo of that frame does not show jumps in the values of y of 0.5m as shown in a small segment of the output below:

At time 13837.000
- Translation: [605245.313, 7898877.773, 2.823]
- Rotation: in Quaternion [-0.140, 0.024, -0.339, 0.930]
            in RPY [-0.281, -0.051, -0.693]
At time 13838.000
- Translation: [605244.946, 7898877.852, 2.747]
- Rotation: in Quaternion [-0.139, 0.022, -0.345, 0.928]
            in RPY [-0.277, -0.054, -0.705]
At time 13839.000
- Translation: [605245.021, 7898877.391, 1.007]
- Rotation: in Quaternion [-0.106, 0.006, -0.341, 0.934]
            in RPY [-0.204, -0.062, -0.695]
At time 13840.000
- Translation: [605245.342, 7898877.190, 1.031]
- Rotation: in Quaternion [-0.107, 0.006, -0.334, 0.936]
            in RPY [-0.205, -0.061, -0.679]
At time 13841.000
- Translation: [605244.806, 7898877.667, 2.324]
- Rotation: in Quaternion [-0.131, 0.020, -0.344, 0.930]
            in RPY [-0.261, -0.052, -0.702]

I am working on a new localisation and the raw messages do not exhibit this jerkiness. The jerkiness in the tf and odom is removed when the fixed frame is taken as odom, not utm. The jerkiness remains in the pose array representing the particle cloud. But when echoing the pose array, it displays smooth transitions for all poses, so I think it must be an error in my settings for rviz.

Has anyone had a similar problem with rviz.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-09-23 02:58:47 -0500

ahendrix gravatar image

Internally, rviz uses 32-bit floats to represent position in the rendered world. Given that you're working with large positional values, I suspect you're running into the precision limits of floats.

When I've run into this, my usual solution is to change the rviz fixed frame to something with a smaller offset to the data I'm trying to visualize.

My trick when working with GPS and UTM coordinate frames is to publish two transforms: one from the UTM origin to the first GPS position, and another from the first GPS position to the current position.

edit flag offensive delete link more

Comments

I found one variable incrementing in units of 0.5m which is the UTM value derived from my NavSatFix via geodesy::toMsg(NavSatFix), giving a geoPoint, that I convert to UTM via geodesy::fromMsg(geoPoint, UTM point). Perhaps I'm running into precision values here to. What lib do you use to convert GPS

PeterMilani gravatar image PeterMilani  ( 2014-09-23 03:38:26 -0500 )edit

I use geodesy: https://github.com/trainman419/dagny_... Note that this publishes a local utm frame and odometry, but I never got around to writing the utm_local to base_link transform, because I didn't need it.

ahendrix gravatar image ahendrix  ( 2014-09-23 03:59:05 -0500 )edit

this has fixed the display of position on Rviz. Funny that this is an issue. Cheers

PeterMilani gravatar image PeterMilani  ( 2014-09-23 06:31:55 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-09-23 02:02:06 -0500

Seen: 317 times

Last updated: Sep 23 '14