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

Simple odometry question [closed]

asked 2012-10-24 08:16:52 -0500

I'm trying to get our robot up and running the navigation stack. As far as I have read and can tell, everything is "correct". In the navigation stack tuning guide it says that there are a couple odometry "sanity checks". Translational involves driving the robot towards a wall and making sure that the aggregate laser scans don't spread over a large distance (~.5 meter). That seems to be going just fine for me.

However, rotation seems to be a problem, I think? With rviz's frame set to "/odom" and spinning the robot in place the scans get to be a giant swirl. When the robot rotates all the way around and returning to where it started, the scans (without aggregate) look identical to what they were before. Meaning if I start facing a wall with the wall parallel to one of the grid lines, after turning all the way around, the wall is once again parallel to the grid line.

It seems like the purpose of the odometry, in rotational terms, is working if when you spin all the way around, your pose at the end is the same as when you started? So I think it's working correctly? Is that right?

I'm hoping that I'm missing something because I'd like to run the gmapping node (which I've tried and my setup isn't working). Hopefully it's something simple. Any help is greatly appreciated.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by skiesel
close date 2012-11-01 08:45:31

1 Answer

Sort by ยป oldest newest most voted

answered 2012-10-24 22:26:09 -0500

JBuesch gravatar image

I am not quite sure I understood what the problem is.

You say translation looks good and also rotating 360 degrees leads to the same results. That sounds like the odom is working fine.

You also said something about a swirl when attaching rviz' frame to odom frame. This makes sense for me as well. Since normally rviz frame is fixed and not attached to a moving frame I would expect strange results, especially when scans are also shown at the same time (because they are displaying the effects of the rotation as well).

Try to set the rviz frame to a fixed /world or /map frame (depending on what exists in your case) and have another look at it while rotating. In case of neither already exist, you can setup a tf transformation rather easily using static_transform_publisher. Just publish a frame with zero coordinated that has your odom frame as child_frame.

When the gmapping is not working there can be a lot of different other things go wrong.

Please check and put up another question in case I am right.

Good luck! :)

edit flag offensive delete link more


I'm not running gmapping, so the odom frame is stationary. When rviz's frame is set to odom, and I rotate the robot, the laser data does not "trace out" the room, but rather causes a visible swirling. When it returns to its rotational origin, the scans match up. This is correct? Thanks!

skiesel gravatar image skiesel  ( 2012-10-25 04:46:26 -0500 )edit

Yes, as I said, when you attach the rviz frame to odom (which is a non stationary frame by definition) it is very likely for you to get strange results. It is like you sitting on the wheel of a car expecting to see everything straight while it rotates. Attach rviz to a fixed frame and try again.

JBuesch gravatar image JBuesch  ( 2012-10-25 22:27:46 -0500 )edit

I really appreciate your help! I'm publishing a static transform from map to odom (0,0,0,0,0,0,) with the rviz fixed frame set to map. (map->odom->base_link->base_laser) When I rotate the points still seem to follow the rotation, which I would think is wrong?images:

skiesel gravatar image skiesel  ( 2012-10-26 06:54:35 -0500 )edit

Well, with your pictures (great idea) my first clou doesn't hold any longer, but I have great news for you. Why do you think this is not right? I mean, since your scanner is mounted on the robot, of course it is rotating as well and its 'vision' moves along too, showing different (cont'd)

JBuesch gravatar image JBuesch  ( 2012-10-26 10:10:21 -0500 )edit of the suroundings. If you'd run something like a obstacle grid, the outlines of the room would materialize. From the pics I can see though that there is a slight discrepancy which comes from a non well calibrated odom (factor >1 needed). Try to calibrate and go on. It looks alright now! :)

JBuesch gravatar image JBuesch  ( 2012-10-26 10:15:20 -0500 )edit

The vision shows an angle difference of approx 45 degrees, as you also confirmed, but when you look at the odom frame it has rotated less. Good luck and have fun!

JBuesch gravatar image JBuesch  ( 2012-10-26 10:17:36 -0500 )edit

Thanks so much. I'll take a look at the odom publishing and see if tweaking that fixes things. Again, I really appreciate your responses and your time!

skiesel gravatar image skiesel  ( 2012-10-28 05:22:18 -0500 )edit

You were right on. I'm using the p2os stack, its publishing of the odometry and robot pose needed their rotation inverted. After that, everything seems to work great! Thanks again so much for your help!

skiesel gravatar image skiesel  ( 2012-10-30 06:00:08 -0500 )edit

Question Tools


Asked: 2012-10-24 08:16:52 -0500

Seen: 1,113 times

Last updated: Oct 24 '12