14#ifndef SENSOR_FUSION_CLASS_H_
15#define SENSOR_FUSION_CLASS_H_
32 kMagnetometerAccelerometer,
38#define MAX_NUM_SENSORS 4
51 const void *tcp_client = NULL);
52 void Begin(
int pin_i2c_sda = -1,
int pin_i2c_scl = -1);
Board configuration file.
Build configuration file.
ControlSubsystem * control_subsystem_
command and data streaming structure
float GetRollRadians(void)
float GetMagneticBMagTrial(void)
float GetPitchRadians(void)
float GetMagneticCalSolver(void)
uint8_t num_sensors_installed_
tracks how many sensors have been added to list
const uint8_t kLoopsPerAccelRead
how often an accelerometer read is performed
float GetRollDegrees(void)
void SaveMagneticCalibration(void)
Save current magnetic calibration to non-volatile memory.
bool InstallSensor(uint8_t sensor_i2c_addr, SensorType sensor_type)
Install Sensor in linked list The max length of the list is checked, and if there is room,...
uint8_t loops_per_fuse_counter_
counts how many times through loop have been done
float GetAccelXGees(void)
float GetTurnRateRadPerS(void)
const uint8_t kLoopsPerThermRead
how often a thermometer read is performed
float GetPitchDegrees(void)
float GetMagneticInclinationRad(void)
float GetRollRateRadPerS(void)
float GetMagneticInclinationDeg(void)
float GetHeadingRadians(void)
void UpdateWiFiStream(void *tcp_client)
Update the TCP client pointer. Call when a new TCP connection is made, as reported by WiFiServer::ava...
SensorFusionGlobals * sfg_
Primary sensor fusion data structure.
const uint8_t kLoopsPerMagRead
how often a magnetometer read is performed
float GetAccelYGees(void)
float GetPitchRateDegPerS(void)
void InjectCommand(const char *command)
Inject and process a single command in the control subsystem.
float GetPitchRateRadPerS(void)
float GetAccelYMPerSS(void)
void ProduceToolboxOutput(void)
Generate and send out data, formatted for NXP Orientation Sensor Toolbox. It is not mandatory to call...
PhysicalSensor * sensors_
linked list of up to 4 sensors
float GetTurnRateDegPerS(void)
float GetAccelXMPerSS(void)
float GetMagneticNoiseCovariance(void)
float GetMagneticFitErrorTrial(void)
void ReadSensors(void)
Reads all sensors. Applies HAL remapping, removes invalid values, and stores data for later processin...
void Begin(int pin_i2c_sda=-1, int pin_i2c_scl=-1)
const uint8_t kLoopsPerGyroRead
how often a gyroscope read is performed
float GetTemperatureC(void)
bool SendArbitraryData(const char *buffer, uint16_t data_length)
float GetMagneticFitError(void)
void InitializeStatusSubsystem(void)
Initialize the Status reporting system. Status is indicated by LEDs, but other means can be added.
bool InitializeInputOutputSubsystem(const Stream *serial_port=NULL, const void *tcp_client=NULL)
void RunFusion(void)
Apply fusion algorithm to sensor raw data. Sensor readings contained in global struct are calibrated ...
float GetMagneticBMag(void)
float GetTemperatureK(void)
float GetAccelZMPerSS(void)
void GetOrientationQuaternion(Quaternion *quat)
Return the orientation as a quaternion.
const uint8_t kLoopsPerFusionCalc
how often to fuse. Usually the max of previous 3 constants.
float GetRollRateDegPerS(void)
void InitializeSensorFusionGlobals(void)
Set the starting values of variables contained in sfg_.
float GetAccelZGees(void)
void ProcessCommands(void)
Process any incoming commands. Commands may arrive by serial or WiFi connection, depending on which o...
float GetHeadingDegrees(void)
int GetSystemStatus(void)
StatusSubsystem * status_subsystem_
visual status indicator structure
Defines control sub-system.
The sensor_fusion.h file implements the top level programming interface.
Application-specific status subsystem.
The ControlSubsystem encapsulates command and data streaming functions.
An instance of PhysicalSensor structure type should be allocated for each physical sensors (combo dev...
quaternion structure definition
The top level fusion structure.
StatusSubsystem() provides an object-like interface for communicating status to the user.