An extended Kalman filter that fuses everything a small differential drive robot senses: wheel encoders, a gyroscope, infrared elements and a camera that see a line on the floor, and ultrasonic range sensors.
More...
|
| | DiffDriveEKF (const DiffDriveMap &map, const Pose &start, const Parameters ¶meters, const std::array< real_t, 3 > &start_sigma={0.02, 0.02, 0.005}) |
| void | predict (real_t distance, real_t gyro_z, real_t dt) |
| | Predict over dt [s] in which the encoders say the robot drove distance [m] and the gyroscope read gyro_z [rad/s].
|
| EKFUpdateResult | update_line (const std::vector< std::array< real_t, 2 > > &points, real_t sigma) |
| | Correct with points where the line is, relative to the centre of the axle [m], forward and to the left, each with the standard deviation sigma [m].
|
| EKFUpdateResult | update_range (const RangeSensor &sensor, real_t measured) |
| | Correct with the reading [m] of a range sensor. A reading at the sensor's max_range, no echo, or where the map has nothing in range, is not used.
|
| real_t | predicted_range (const RangeSensor &sensor, const Pose &pose) const |
| | What the sensor should read with the robot at pose.
|
| Pose | pose () const |
| real_t | gyro_bias () const |
| const DynMat< real_t > & | covariance () const |
| | The covariance of (x, y, yaw, bias).
|
| const Parameters & | parameters () const noexcept |
| const DiffDriveMap & | map () const noexcept |
An extended Kalman filter that fuses everything a small differential drive robot senses: wheel encoders, a gyroscope, infrared elements and a camera that see a line on the floor, and ultrasonic range sensors.
The encoders and the gyroscope predict, see DiffDriveGyroModel; on their own they drift, as dead reckoning does. The other sensors correct, against a DiffDriveMap:
- the line: a point where the infrared elements or the camera see the line, relative to the robot, should be on the track. Its signed distance to the track, \(h(x)\), is measured as 0. Across the line this fixes the position, and with points at different distances ahead, the camera's, the heading too; along the line it says nothing;
- ranges: an ultrasonic sensor at a known place on the robot should measure the shortest of its rays to the walls and boxes of the map, cast across its beam as the sensor hears them. Ahead and behind along a straight this fixes the position along the track.
Every update goes through the gate of ExtendedKalmanFilter: a measurement that the estimate cannot explain, such as an echo from something not on the map, is not used. The Jacobians of the measurements are worked out by central differences.