|
bitsim
Model, simulate, estimate and control robots in C++
|
The heading of a robot from its gyroscope: dead reckoning of the rate about the vertical. More...
#include <gyro_heading.h>
Public Member Functions | |
| GyroHeading (real_t start_heading, real_t calibration_time=1.0) | |
| bool | is_calibrating () const noexcept |
| True while the robot should stand still for the bias to be measured. | |
| 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. | |
| real_t | heading () const noexcept |
| The heading [rad], in \([-\pi, \pi]\). | |
| real_t | bias () const noexcept |
| The bias measured while calibrating [rad/s]. | |
The heading of a robot from its gyroscope: dead reckoning of the rate about the vertical.
Adding up rate x time from a known start gives the heading,
\[\psi_{k+1} = \psi_k + (\omega_{z,k} - b)\, \Delta t \]
and an error in the rate never goes away: a bias b that is not taken off makes the heading drift by b t. To keep the drift small the robot can first stand still for a calibration time. It is not turning then, so the mean of what the gyroscope reads is its bias, which is taken off every reading after that.
|
explicit |
| start_heading | The heading the robot starts at [rad] |
| calibration_time | How long the robot stands still to measure the bias [s]; 0 for no calibration, with a bias of 0 |
|
inlinenoexcept |
The bias measured while calibrating [rad/s].
|
inlinenoexcept |
The heading [rad], in \([-\pi, \pi]\).
|
inlinenoexcept |
True while the robot should stand still for the bias to be measured.
Take a reading of the gyroscope's vertical axis [rad/s], dt [s] after the last.