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

Revision history [back]

What's the need for fusing amcl's output with odometry and IMU? I would think using amcl alone would be pretty stable.

First of all, if you are ever having trouble, get rid of the advanced parameters. In this case, remove the rejection_threshold parameters.

As for your questions:

When i use odom0_differential: true the filter output odometry_filtered/odom covariance grows quickly

That's what I'd expect to see. If you only fuse sources that are subject to drift, your covariance will grow without bound. What you typically see with a two-tier setup is that your odom-frame state estimate has an error that grows without bound (which is correct), and either amcl or a second map-frame EKF produces a state estimate in the map frame that is _not_ subject to drift. See REP-105 for more details.

Regardless, if I were you, I'd stop fusing absolute pose from wheel odometry. Just fuse the velocities. differential mode is meant for sensors that _only_ produce pose data. It differentiates subsequent poses and generates velocities from them. Your wheel encoders generate velocity data directly, so just fuse X velocity, Y velocity, and yaw velocity from your wheel encoders, and set X, Y, and yaw to false. You can then also remove the differential setting.

As far as your other issue goes, there are a couple things I see:

  1. Your amcl pose is in the map frame, but your EKF is in the odom frame. Since amcl is the very node that is producing the map -> odom transform (I believe), when you fuse that measurement into the EKF, which is in the odom frame, you are effectively just feeding the EKF back its own pose as a measurement.
  2. You are fusing absolute yaw from your IMU and amcl. While you correctly turned on relative mode for the IMU, I am wondering if the IMU's orientation is drifting. Magnetometers are notoriously terrible.

In the end, the key takeaways are:

  • You should use amcl's pose as your estimate of where your robot is in the world. That can be used for global planning.
  • Your odom frame state estimate from the EKF _will_ drift and become globally erroneous, and it will also undergo unbounded covariance growth. This is 100% correct and fine. You're just integrating a bunch of velocity measurements, each of which has errors, so you're also integrating the error. Even with that drift and error, the odom frame estimate is usable for local planning.