How do I calibrate odometry ?

asked 2018-08-12 12:55:36 -0500

Blackwaxx gravatar image

Hi, I've been working on a cheap robot powered by Ros : RPi 3 and all-in-one kit with chassis and 4 motors. So it's a differential drive, powered by ros_control with diff_drive_controller.

I used the wheels encoder (front_left and front-right only) to compute odometry. I made a few tests and my inline odometry was perfect (5 meters in on direction computes effectively 5 meters in ROS with sensors).

I was implementing navigation stack with Xtion when I realized odometry was jumping on first turn, making it impossible to map the room. So i made a few more test : I draw a 1.5m square on floor, and set my grid to 1.5 meter cell length.

When I drive 1.5m straight forward :image description

Everything goes well. As soon as I turn the car (here 90 degrees to the right) : image description

It looks a lot more like 270 degrees...

A few reasons why :

Motors are really cheap and induce a lot of drift (2 kinds) : sometimes the front wheel is turning but not the rear wheel. The robot turns a bit but translate as well, and it's not computed. Sometimes the wheel just drifts without the robot moving.

How can I take that in account for computing odometry ?

I double(triple) checked my values for track and wheel diameter, problem appears only when turning, straight forward odometry is computed just fine.

Also, when I try to visualize odometry topic on rviz, it crashes with this message :

rviz: /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreNode.cpp :405 : virtual void Ogre::Node::setPosition(const Ogre::Vector3&):  assertion « !pos.isNaN() && "Invalid vector supplied as parameter" » failed.

Has someone got any clue ?

Thanks a lot

edit retag flag offensive close merge delete


There are numerous reasons why you would be getting drift in your odometry: integration errors, sensor noise, etc. This is inherent in dead reckoning. You should look into using something like a Kalman filter like the robot_localization package

jayess gravatar image jayess  ( 2018-08-12 15:47:05 -0500 )edit

Thanks jayess I'll try to look into that and will get feedback here !

Blackwaxx gravatar image Blackwaxx  ( 2018-08-13 11:13:05 -0500 )edit

Be the robot turning the wrong way, or be it turning too far the right way?

David Lu gravatar image David Lu  ( 2018-09-19 15:56:44 -0500 )edit

It's turning too far the right way. I think Jayess is right, i need to implement accelerometer, but the one i bought seems to not be operational...

Blackwaxx gravatar image Blackwaxx  ( 2018-09-26 06:43:54 -0500 )edit