bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
ekf_sensor_fusion::GyroHeading Class Reference

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].

Detailed Description

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.

Constructor & Destructor Documentation

◆ GyroHeading()

bitsim::estimation::GyroHeading::GyroHeading ( real_t start_heading,
real_t calibration_time = 1.0 )
explicit
Parameters
start_headingThe heading the robot starts at [rad]
calibration_timeHow long the robot stands still to measure the bias [s]; 0 for no calibration, with a bias of 0

Member Function Documentation

◆ bias()

The bias measured while calibrating [rad/s].

◆ heading()

The heading [rad], in \([-\pi, \pi]\).

◆ is_calibrating()

bool bitsim::estimation::GyroHeading::is_calibrating ( ) const
inlinenoexcept

True while the robot should stand still for the bias to be measured.

◆ update()

Take a reading of the gyroscope's vertical axis [rad/s], dt [s] after the last.


The documentation for this class was generated from the following files: