# How to verify odom --> base_link is accurate or not？

I'm using AMCL and when I specify a goal to navigation, the pose of my robot drift.While AMCL need odom --> base_link tf and laserscan data,so how can I verify odom --> base_link is accurate or not？

edit retag close merge delete

Sort by » oldest newest most voted

Extracted from section 1.2 in the navigation tuning guide:

Often, I'll have a lot of trouble getting a robot to localize correctly. It will constantly get lost and I'll spend a lot of time mucking with the parameters for AMCL only to find that the real culprit is the robot's odometry. As such, I always run two sanity checks to make sure that I believe the odometry of a robot.

The first test checks how reasonable the odometry is for rotation. I open up rviz, set the frame to "odom," display the laser scan the robot provides, set the decay time on that topic high (something like 20 seconds), and perform an in-place rotation. Then, I look at how closely the scans match each other on subsequent rotations. Ideally, the scans will fall right on top of each other, but some rotational drift is expected, so I just make sure that the scans aren't off by more than a degree or two.

The next test is a sanity check on odometry for translation. I'll set up rviz the same way with the robot a few meters away from a wall. Then, I'll drive the robot straight at the wall and look at the thickness of the wall as reported by the aggregated laser scans in rviz. Ideally, the wall should look like a single scan but I just make sure that it doesn't have a thickness of more than a few centimeters. If you drive a meter towards a wall and get scans spread out over half a meter though, something is likely wrong with the odometry.

more

Should I transform laser to Odom or base_link? When I try to run rviz, scans do not coincide with each other . I am using transform as odom-> base_link -> laser

( 2017-04-28 10:06:36 -0600 )edit

If scans do not coincide with each other, you likely have a bad odometry. It is not an issue with the transforms, probably. Your tf chain is just fine.

( 2017-05-02 07:35:50 -0600 )edit

You can close AMCL and publish the tf map -> odom staticly with static_transform_publisher. To test the accuracy of odom -> base_link, you should make map and odom coincide, that is you should run static_transform_publisher 0 0 0 0 0 0 map odom 50 to make the x/y/z and y/p/r offset zero.

And then you can set a goal to navigation and compare the robot's real location with the location feedback to RViz. Cuz at this time the location in RViz comes from odom -> base_link.

more