bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
gyro_heading.h
Go to the documentation of this file.
1#ifndef BITSIM_ESTIMATION_GYRO_HEADING_H
2#define BITSIM_ESTIMATION_GYRO_HEADING_H
3
5
6namespace bitsim
7{
8namespace estimation
9{
10
28{
29 public:
35 explicit GyroHeading(real_t start_heading, real_t calibration_time = 1.0);
36
40 bool is_calibrating() const noexcept { return calibrated_for_ < calibration_time_; }
41
45 void update(real_t gyro_z, real_t dt);
46
50 real_t heading() const noexcept { return heading_; }
51
55 real_t bias() const noexcept { return bias_; }
56
57 private:
58 real_t heading_;
59 real_t calibration_time_;
60 real_t calibrated_for_{0.0};
61 real_t rate_sum_{0.0};
62 real_t bias_{0.0};
63};
64
65} // namespace estimation
66} // namespace bitsim
67
68#endif // BITSIM_ESTIMATION_GYRO_HEADING_H
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
real_t heading() const noexcept
The heading [rad], in .
Definition gyro_heading.h:50
GyroHeading(real_t start_heading, real_t calibration_time=1.0)
Definition gyro_heading.cpp:12
real_t bias() const noexcept
The bias measured while calibrating [rad/s].
Definition gyro_heading.h:55
void update(real_t gyro_z, real_t dt)
Take a reading of the gyroscope's vertical axis [rad/s], dt [s] after the last.
Definition gyro_heading.cpp:21
bool is_calibrating() const noexcept
True while the robot should stand still for the bias to be measured.
Definition gyro_heading.h:40
Definition diff_drive_ekf.cpp:12
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20