Hummingbird Flight Software
Flight software for the Hummingbird FCU quadcopter flight controller. Designed to run on the Teensy 4.1. Developed with VSCode+PlatformIO.
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
InertialNavSystem Class Reference

Constructor for the InertialNavSystem class. More...

#include <inertial_nav_system.h>

Public Member Functions

 InertialNavSystem ()
 The inertial sensor software system brings together the accelerometer
and gyro, sensors to form the Inertial Navigation System. More...
 
 ~InertialNavSystem ()
 
 InertialNavSystem (const InertialNavSystem &)=delete
 
InertialNavSystemoperator= (const InertialNavSystem &)=delete
 
void SetSampleRate (float fs_hz)
 
bool Initialize ()
 Initialize the INS. More...
 
bool Update ()
 Record accelerometer and gyro measurements, apply noise filters, and update accel. More...
 
float GetAccelPitch ()
 
float GetAccelRoll ()
 

Static Public Member Functions

static InertialNavSystemGetInstance ()
 

Public Attributes

Vectorf Gyro
 
Vectorf GyroRaw
 
Vectorf GyroTOBias
 
Vectorf Accel
 
Vectorf AccelRaw
 
Vectorf AccelTOBias
 
uint32_t prevUpdateMicros
 

Private Member Functions

void UpdateAccelAngles ()
 Compute accelerometer roll and pitch angles. More...
 
bool MeasureInitGyroBiases (uint32_t samplePeriod)
 Measure initial gyro turn-on biases. More...
 
bool MeasureInitAccelBiases (uint32_t samplePeriod)
 Measure initial accelerometer turn-on bias. More...
 

Private Attributes

float roll
 
float pitch
 
FXOS8700AccelMag AccelMagSensor
 
FXAS21002Gyro GyroSensor
 
LowPassFilter AxLPF
 
LowPassFilter AyLPF
 
LowPassFilter AzLPF
 

Detailed Description

Constructor for the InertialNavSystem class.

This system provides an interface to manage sensor readings, filtering raw measurements for noise, and applying calibration parameters.

Constructor & Destructor Documentation

◆ InertialNavSystem() [1/2]

InertialNavSystem::InertialNavSystem ( )

The inertial sensor software system brings together the accelerometer
and gyro, sensors to form the Inertial Navigation System.

This system provides an interface to manage sensor readings, filtering raw measurements for noise, and applying calibration parameters. Constructor for the InertialNavSystem class. This system provides an interface to manage sensor readings, filtering raw measurements for noise, and applying calibration parameters.

◆ ~InertialNavSystem()

InertialNavSystem::~InertialNavSystem ( )

◆ InertialNavSystem() [2/2]

InertialNavSystem::InertialNavSystem ( const InertialNavSystem )
delete

Member Function Documentation

◆ GetAccelPitch()

float InertialNavSystem::GetAccelPitch ( )

◆ GetAccelRoll()

float InertialNavSystem::GetAccelRoll ( )

◆ GetInstance()

InertialNavSystem & InertialNavSystem::GetInstance ( )
static

◆ Initialize()

bool InertialNavSystem::Initialize ( )

Initialize the INS.

This function connects to the gyro and accelerometer, and measures gyro and accelerometer turn-on biases (used to initialize the EKF).

Returns
true if successfully init'd, false if not.

◆ MeasureInitAccelBiases()

bool InertialNavSystem::MeasureInitAccelBiases ( uint32_t  samplePeriod)
private

Measure initial accelerometer turn-on bias.

Parameters
samplePeriod[ms] Sample period/delay between samples. Use this to set sample rate for recording turn-on biases.
Returns
True if successful, false if not

◆ MeasureInitGyroBiases()

bool InertialNavSystem::MeasureInitGyroBiases ( uint32_t  samplePeriod)
private

Measure initial gyro turn-on biases.

Parameters
samplePeriod[ms] Sample period/delay between samples. Use this to set sample rate for recording turn-on biases.
Returns
True if successful, false if not

◆ operator=()

InertialNavSystem& InertialNavSystem::operator= ( const InertialNavSystem )
delete

◆ SetSampleRate()

void InertialNavSystem::SetSampleRate ( float  fs_hz)

◆ Update()

bool InertialNavSystem::Update ( )

Record accelerometer and gyro measurements, apply noise filters, and update accel.

roll/pitch angles.

Returns
True if success, false if not.

◆ UpdateAccelAngles()

void InertialNavSystem::UpdateAccelAngles ( )
private

Compute accelerometer roll and pitch angles.

Member Data Documentation

◆ Accel

Vectorf InertialNavSystem::Accel

◆ AccelMagSensor

FXOS8700AccelMag InertialNavSystem::AccelMagSensor
private

◆ AccelRaw

Vectorf InertialNavSystem::AccelRaw

◆ AccelTOBias

Vectorf InertialNavSystem::AccelTOBias

◆ AxLPF

LowPassFilter InertialNavSystem::AxLPF
private

◆ AyLPF

LowPassFilter InertialNavSystem::AyLPF
private

◆ AzLPF

LowPassFilter InertialNavSystem::AzLPF
private

◆ Gyro

Vectorf InertialNavSystem::Gyro

◆ GyroRaw

Vectorf InertialNavSystem::GyroRaw

◆ GyroSensor

FXAS21002Gyro InertialNavSystem::GyroSensor
private

◆ GyroTOBias

Vectorf InertialNavSystem::GyroTOBias

◆ pitch

float InertialNavSystem::pitch
private

◆ prevUpdateMicros

uint32_t InertialNavSystem::prevUpdateMicros

◆ roll

float InertialNavSystem::roll
private

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