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
GNSSComputer Class Reference

#include <gnss_computer.h>

Public Member Functions

 GNSSComputer (TwoWire *userWire=&GPS_I2C)
 
 ~GNSSComputer ()
 
 GNSSComputer (const GNSSComputer &)=delete
 
GNSSComputeroperator= (const GNSSComputer &)=delete
 
bool ConfigureDevice (GNSSNetworks_t userNetwork=GNSS_NET_GPS, GNSSDynamics_t userDynModel=GNSS_DYNAMICS_PEDESTRIAN, GNSSNavRate_t userODR=GNSS_NAVRATE_10HZ)
 Configure the GPS sensor. More...
 
bool WaitForSatellites (uint32_t nSats=GNSS_MIN_SATS)
 Wait for satellites to be received by the GPS. More...
 
bool ListenForData ()
 Read data from GPS I2C port and feed the TinyGPS NMEA parser data. More...
 

Static Public Member Functions

static GNSSComputerGetInstance ()
 

Public Attributes

TinyGPSPlus NMEAParser
 

Private Member Functions

void SendUBXConfigMessage (const uint8_t *msg, size_t len)
 Send UBX configuration message over I2C. More...
 

Private Attributes

Vectord PosLLA
 
Vectorf PosECEF
 
Vectorf VelECEF
 
bool isConfigured
 
uint32_t lastDataCheck
 
uint32_t dataPollWait
 
int32_t gpsBaud
 
float navTs
 
float navRate
 
GNSSNetworks_t network
 
GNSSDynamics_t dynamicModel
 
GNSSNavRate_t updateRate
 
TwoWire * gpsWire
 

Constructor & Destructor Documentation

◆ GNSSComputer() [1/2]

GNSSComputer::GNSSComputer ( TwoWire *  userWire = &GPS_I2C)

◆ ~GNSSComputer()

GNSSComputer::~GNSSComputer ( )
inline

◆ GNSSComputer() [2/2]

GNSSComputer::GNSSComputer ( const GNSSComputer )
delete

Member Function Documentation

◆ ConfigureDevice()

bool GNSSComputer::ConfigureDevice ( GNSSNetworks_t  userNetwork = GNSS_NET_GPS,
GNSSDynamics_t  userDynModel = GNSS_DYNAMICS_PEDESTRIAN,
GNSSNavRate_t  userODR = GNSS_NAVRATE_10HZ 
)

Configure the GPS sensor.

Sends config. commands over I2C. Configures port settings, satellite network/s, GPS dynamic model, enables/disables NMEA messages, and sets output data rate.

Parameters
userNetworkNetwork to connect to. GPS, GLONASS, or GPS+GLONASS
userDynModelGPS's internal fusion algorithm dynamic model. Pedestrian, portable, and airborne <1G.
userODR[Hz] Output navigation rate. 5Hz or 10Hz
Returns
True if successfully configured, false if not

◆ GetInstance()

GNSSComputer & GNSSComputer::GetInstance ( )
static

◆ ListenForData()

bool GNSSComputer::ListenForData ( )

Read data from GPS I2C port and feed the TinyGPS NMEA parser data.

Also includes checks to ensure data integrity.

Returns
True if success, false if not.

Limit bytes to read to device I2C buffer size, 32 bytes for Arduino boards and Teensy 4.1

bytesToRead = bytesAvail; if (bytesToRead > 32) bytesToRead = 32;

◆ operator=()

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

◆ SendUBXConfigMessage()

void GNSSComputer::SendUBXConfigMessage ( const uint8_t *  msg,
size_t  len 
)
private

Send UBX configuration message over I2C.

Parameters
msguint8_t array of bytes to send.
lenLength of message

◆ WaitForSatellites()

bool GNSSComputer::WaitForSatellites ( uint32_t  minSats = GNSS_MIN_SATS)

Wait for satellites to be received by the GPS.

If the min. number of satellies are not aquired by a certain time period, the function returns false. Also contains aquisition checks.

Parameters
minSatsMinimum number of satellites to signal a valiid fix.
Returns
True if success, false if not

Member Data Documentation

◆ dataPollWait

uint32_t GNSSComputer::dataPollWait
private

◆ dynamicModel

GNSSDynamics_t GNSSComputer::dynamicModel
private

◆ gpsBaud

int32_t GNSSComputer::gpsBaud
private

◆ gpsWire

TwoWire* GNSSComputer::gpsWire
private

◆ isConfigured

bool GNSSComputer::isConfigured
private

◆ lastDataCheck

uint32_t GNSSComputer::lastDataCheck
private

◆ navRate

float GNSSComputer::navRate
private

◆ navTs

float GNSSComputer::navTs
private

◆ network

GNSSNetworks_t GNSSComputer::network
private

◆ NMEAParser

TinyGPSPlus GNSSComputer::NMEAParser

◆ PosECEF

Vectorf GNSSComputer::PosECEF
private

◆ PosLLA

Vectord GNSSComputer::PosLLA
private

◆ updateRate

GNSSNavRate_t GNSSComputer::updateRate
private

◆ VelECEF

Vectorf GNSSComputer::VelECEF
private

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