# Thread: Odometry and IMU Filtering

1. Abacus
Join Date
Apr 2012
Posts
1
Rep Power
0

## Odometry and IMU Filtering

Hey guys,

I'm working on a differential drive rover which I would like to use to follow a path. In order to do this, I plan on using Wheel encoders and a 3DoF IMU. Is there a good way to combine the odometry and IMU measurements to create a more robust estimation of position and orientation?

I plan on modeling my state estimation off of this document.
http://www.seattlerobotics.org/encod...20Anderson.htm

However, he is getting his orientation solely from his IMU and his distance solely from his encoders. Is there a good way to combine the two? I.E. Could I use the acceleration values from my IMU and my encoder measurements to get a more robust estimation of position? How about using my relative wheel speeds and a gyroscope/compass to get a better estimation of orientation? I understand that Kalman and complimentary filters are typically used to combine noisy measurements. However, I have been unable to find an example using a Kalman filter combining IMU and encoder measurements.

Thanks,
-Tweeter

2. ## Re: Odometry and IMU Filtering

Give each a confidence level and use statistical methods to improve the guess.
Note that slipping wheels will fool the encoder sensors.

3. Optical Processor
Join Date
Feb 2012
Location
Sydney, Australia
Posts
357
Rep Power
21

## Re: Odometry and IMU Filtering

For multiple inputs in a Kalman filter, bear in mind that they need to be the same type of inputs, e.g. you need to get position individually from both sensors, and then combine them in the filter. So...

* Integrate linear and angular IMU readings twice to get position and orientation. Compass reading is just straight orientation. You can use this as a third input to the filter.
* Use the revolutions on each wheel's encoder to find position and orientation.

Now you've got position and orientation from each sensor, stuff the data into the Kalman filter. Tweak gain and so on as needed (as jwatte said, if the wheels slip this will muck things up, so making it rely less on the encoders might be good unless you're sure they won't slip).

4. Abacus
Join Date
Jul 2013
Posts
3
Rep Power
0

## Re: Odometry and IMU Filtering

Hi, what you said is quite inspiring, but could you be a little more specific as how to fuse multiple inputs in the Kalman Filter? Or could you direct me to some relative documentations? I'm currently doing a relative project and have no idea how to deal with it. Thanks!!!

5. Optical Processor
Join Date
Feb 2012
Location
Sydney, Australia
Posts
357
Rep Power
21

## Re: Odometry and IMU Filtering

I'm assuming you already have a Kalman filter set up and know the basics, in which case it's fairly easy. Instead of the usual predict -> update -> predict -> update procedure, you now perform multiple updates with the different inputs as they become available. So it might become predict -> update1 -> predict -> update2 -> predict -> update 1... OR it might be predict -> update1 -> update2 -> predict ->update1 -> update2..., it just depends on how regularly you're able to get data from your sensors.

6. Abacus
Join Date
Jul 2013
Posts
3
Rep Power
0

## Re: Odometry and IMU Filtering

Thank you so much! That really helps a lot!
I have one more question, how should I integrate the GPS data into SLAM? I saw papers combining it with IMU in the motion model, but I don't have IMU in my setting, only encoders; then should I put it in the measurement model? But the data I get from other sensors are of the landmarks, while the GPS data is of the position of the robot itself, then how should I put them together?

7. Optical Processor
Join Date
Feb 2012
Location
Sydney, Australia
Posts
357
Rep Power
21

## Re: Odometry and IMU Filtering

SLAM is something I haven't actually played around with so I won't be of much help there. I will point out, however, that you can use your encoders and robot model to predict where the robot is relative to its starting position.

8. Abacus
Join Date
Jul 2013
Posts
3
Rep Power
0

## Re: Odometry and IMU Filtering

Thank you so much anyway!

9. ## Re: Odometry and IMU Filtering

In case you go down the road of programming your own Kalman filter, this website might help:

http://blog.tkjelectronics.dk/2012/0...-implement-it/

The same guy used that code for the balanduino kickstarter a while back.

10. ## Re: Odometry and IMU Filtering

FWIW my 20mph 1/10th scale rover uses a simple linear Kalman Filter for heading to fuse Z gyro and gps data. What are the 3 degrees of freedom involved?

If you get into fusing odometry x, y, magnetometer/gps heading, and gyro heading rate, or using odometry for heading rate, you're talking about non-linear as I understand it, so either EKF or UKF or whatever else. I've done neither but I think I get what's required for EKF.

In my experience with the rover, the most important estimate and hardest to get right is heading. (My robot was designed to run a 270m course at 10-20mph; heading was crucial). The biggest problems with gyro are bias and random walk. So one really needs a reliable reference that is, in the long run, bias-free like GPS heading or magnetometer. The latter I've found to be problematic indoors and when anywhere close to pavement/parking lot due to local interference, like buried wires, rebar, etc.

Another approach that is probably simpler is a complimentary filter though I've not played with those to any extent so I can't really advise from experience. Which is everything in getting this right, I've found.

Hope this helps.

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•