1#ifndef BITSIM_ESTIMATION_DIFF_DRIVE_EKF_H
2#define BITSIM_ESTIMATION_DIFF_DRIVE_EKF_H
40 const std::vector<Box2d> &
obstacles() const noexcept {
return obstacles_; }
50 std::vector<Box2d> obstacles_;
166 const std::array<real_t, 3> &start_sigma = {0.02, 0.02, 0.005});
178 EKFUpdateResult
update_line(
const std::vector<std::array<real_t, 2>> &points,
real_t sigma);
203 void wrap_heading_();
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
SysState utility class describing the state of a system.
Definition system_state.h:25
real_t gyro_bias() const
Definition diff_drive_ekf.h:192
const DiffDriveMap & map() const noexcept
Definition diff_drive_ekf.h:200
DiffDriveEKF(const DiffDriveMap &map, const Pose &start, const Parameters ¶meters, const std::array< real_t, 3 > &start_sigma={0.02, 0.02, 0.005})
Definition diff_drive_ekf.cpp:241
Pose pose() const
Definition diff_drive_ekf.cpp:305
real_t predicted_range(const RangeSensor &sensor, const Pose &pose) const
What the sensor should read with the robot at pose.
Definition diff_drive_ekf.cpp:298
const DynMat< real_t > & covariance() const
The covariance of (x, y, yaw, bias).
Definition diff_drive_ekf.h:197
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 gyr...
Definition diff_drive_ekf.cpp:258
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 lef...
Definition diff_drive_ekf.cpp:267
const Parameters & parameters() const noexcept
Definition diff_drive_ekf.h:199
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,...
Definition diff_drive_ekf.cpp:282
The motion model of DiffDriveEKF: a differential drive robot that knows how far it drove from its whe...
Definition diff_drive_ekf.h:71
const state_type & get_state() const
Definition diff_drive_ekf.h:92
const matrix_type & get_matrix(const std::string &name) const
Definition diff_drive_ekf.cpp:109
dynamics::SysState< 4 > state_type
Definition diff_drive_ekf.h:73
Input input_type
Definition diff_drive_ekf.h:82
DynMat< real_t > matrix_type
Definition diff_drive_ekf.h:74
DiffDriveGyroModel()
Definition diff_drive_ekf.cpp:70
real_t get_state_property(const std::string &name) const
Definition diff_drive_ekf.h:93
state_type & get_state()
Definition diff_drive_ekf.h:91
state_type & evaluate(const Input &input)
Move the state by one step, and work out F and L at the state before it.
Definition diff_drive_ekf.cpp:79
What a robot knows about where it drives: the line on the floor, a RoundedRectangle,...
Definition diff_drive_ekf.h:35
const trajectory::RoundedRectangle & track() const noexcept
Definition diff_drive_ekf.h:39
real_t ray_cast(real_t x, real_t y, real_t angle, real_t max_range) const
How far a ray from (x, y) at angle [rad] from the x axis goes before it meets an obstacle,...
Definition diff_drive_ekf.cpp:25
const std::vector< Box2d > & obstacles() const noexcept
Definition diff_drive_ekf.h:40
DiffDriveMap(const trajectory::RoundedRectangle &track, std::vector< Box2d > obstacles)
Definition diff_drive_ekf.cpp:20
The extended Kalman filter: it predicts the state with a non-linear motion model and corrects it with...
Definition extended_kalman_filter.h:68
A closed track in the plane: a rectangle centred on the origin with its sides along x and y,...
Definition rounded_rectangle.h:20
Definition diff_drive_ekf.cpp:12
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
Eigen::MatrixX< T > DynMat
Dynamically sized matrix to use around the library.
Definition bitsim_types.h:51
double real_t
real_t
Definition bitsim_types.h:20
An axis-aligned rectangle in the plane [m]: a wall or a box, seen from above.
Definition diff_drive_ekf.h:22
real_t y_min
Definition diff_drive_ekf.h:24
real_t y_max
Definition diff_drive_ekf.h:26
real_t x_min
Definition diff_drive_ekf.h:23
real_t x_max
Definition diff_drive_ekf.h:25
Definition diff_drive_ekf.h:127
real_t bias_walk
how fast the bias may wander [rad/s per square root of s]
Definition diff_drive_ekf.h:130
real_t range_noise
of an ultrasonic range [m]
Definition diff_drive_ekf.h:132
real_t gate
per measured value, on the squared Mahalanobis distance
Definition diff_drive_ekf.h:133
real_t gyro_noise
of each reading of the gyroscope [rad/s]
Definition diff_drive_ekf.h:129
real_t line_noise
of a point of the line [m]
Definition diff_drive_ekf.h:131
real_t distance_noise
of the encoders' distance [m per square root of m]
Definition diff_drive_ekf.h:128
Definition diff_drive_ekf.h:137
real_t yaw
Definition diff_drive_ekf.h:140
real_t y
Definition diff_drive_ekf.h:139
real_t x
Definition diff_drive_ekf.h:138
Where an ultrasonic sensor is on the robot, relative to the centre of the axle, and what it hears.
Definition diff_drive_ekf.h:148
real_t y
to the left [m]
Definition diff_drive_ekf.h:150
real_t x
ahead of the axle [m]
Definition diff_drive_ekf.h:149
real_t yaw
where it points, from straight ahead [rad]
Definition diff_drive_ekf.h:151
real_t beam_angle
the full width of its cone [rad]
Definition diff_drive_ekf.h:152
uint_t n_rays
how many rays its model casts across the cone
Definition diff_drive_ekf.h:153
real_t max_range
[m]; a reading this far is no echo
Definition diff_drive_ekf.h:155
real_t min_range
[m]
Definition diff_drive_ekf.h:154