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

Revision history [back]

It's helpful to pose launch/config files and sample input messages for these, but I can probably answer this anyway.

Your wheel encoders and the differential drive controller have no concept of absolute orientation, so when you start driving a robot around, the diff drive controller always starts with a heading of 0 an integrates wheel velocities, giving you a heading (that is subject to drift).

The EKF is taking in velocity data from the wheel encoders and _absolute_ orientation data from the IMU. So when your robot starts, you get an IMU yaw measurement, and the EKF output matches it. Then you drive forward, and the EKF fuses those velocities in the correct frame, and so your EKF state estimate will have a different orientation than your wheel encoders.

In short: your wheel encoder odometry and IMU do not share a common heading. If they did, you wouldn't need an IMU. The filter is doing what it's designed to do: fusing data from two separate sources into one state estimate.

Using differential mode converts the IMU absolute orientation data to velocity, so you'll do away with that particular issue, though I question why you want your EKF state estimate to match your wheel encoder odometry.