Sensor Fusion Library 0.6.1
Orientation sensing for Espressif (ESP32, ESP8266) processors
Loading...
Searching...
No Matches
fusion.h File Reference

Lower level sensor fusion interface. More...

#include "sensor_fusion.h"
Include dependency graph for fusion.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

COMPUTE_1DOF_P_BASIC constants
#define FLPFSECS_1DOF_P_BASIC   1.5F
 pressure low pass filter time constant (s)
 
COMPUTE_3DOF_G_BASIC constants
#define FLPFSECS_3DOF_G_BASIC   1.0F
 tilt orientation low pass filter time constant (s)
 
COMPUTE_3DOF_B_BASIC constants
#define FLPFSECS_3DOF_B_BASIC   7.0F
 2D eCompass orientation low pass filter time constant (s)
 
COMPUTE_6DOF_GB_BASIC constants
#define FLPFSECS_6DOF_GB_BASIC   7.0F
 
COMPUTE_6DOF_GY_KALMAN constants
#define FQVY_6DOF_GY_KALMAN   2E2
 gyro sensor noise variance units (deg/s)^2
 
#define FQVG_6DOF_GY_KALMAN   1.2E-3
 accelerometer sensor noise variance units g^2
 
#define FQWB_6DOF_GY_KALMAN   2E-2F
 gyro offset random walk units (deg/s)^2
 
#define FMIN_6DOF_GY_BPL   -7.0F
 minimum permissible power on gyro offsets (deg/s)
 
#define FMAX_6DOF_GY_BPL   7.0F
 maximum permissible power on gyro offsets (deg/s)
 
COMPUTE_9DOF_GBY_KALMAN constants

gyro sensor noise covariance units deg^2 increasing this parameter improves convergence to the geomagnetic field

#define FQVY_9DOF_GBY_KALMAN   2E2
 gyro sensor noise variance units (deg/s)^2
 
#define FQVG_9DOF_GBY_KALMAN   1.2E-3
 accelerometer sensor noise variance units g^2 defining minimum deviation from 1g sphere
 
#define FQVB_9DOF_GBY_KALMAN   5E0
 magnetometer sensor noise variance units uT^2 defining minimum deviation from geomagnetic sphere.
 
#define FQWB_9DOF_GBY_KALMAN   2E-2F
 gyro offset random walk units (deg/s)^2
 
#define FMIN_9DOF_GBY_BPL   -7.0F
 minimum permissible power on gyro offsets (deg/s)
 
#define FMAX_9DOF_GBY_BPL   7.0F
 maximum permissible power on gyro offsets (deg/s)
 

Functions

Fusion Function Prototypes

These functions comprise the core of the basic sensor fusion functions excluding magnetic and acceleration calibration. Parameter descriptions are not included here, as details are provided in sensor_fusion.h.

void fInitializeFusion (SensorFusionGlobals *sfg)
 
void fFuseSensors (struct SV_1DOF_P_BASIC *pthisSV_1DOF_P_BASIC, struct SV_3DOF_G_BASIC *pthisSV_3DOF_G_BASIC, struct SV_3DOF_B_BASIC *pthisSV_3DOF_B_BASIC, struct SV_3DOF_Y_BASIC *pthisSV_3DOF_Y_BASIC, struct SV_6DOF_GB_BASIC *pthisSV_6DOF_GB_BASIC, struct SV_6DOF_GY_KALMAN *pthisSV_6DOF_GY_KALMAN, struct SV_9DOF_GBY_KALMAN *pthisSV_9DOF_GBY_KALMAN, struct AccelSensor *pthisAccel, struct MagSensor *pthisMag, struct GyroSensor *pthisGyro, struct PressureSensor *pthisPressure, struct MagCalibration *pthisMagCal)
 
void fInit_1DOF_P_BASIC (struct SV_1DOF_P_BASIC *pthisSV, struct PressureSensor *pthisPressure, float flpftimesecs)
 
void fInit_3DOF_G_BASIC (struct SV_3DOF_G_BASIC *pthisSV, struct AccelSensor *pthisAccel, float flpftimesecs)
 
void fInit_3DOF_B_BASIC (struct SV_3DOF_B_BASIC *pthisSV, struct MagSensor *pthisMag, float flpftimesecs)
 
void fInit_3DOF_Y_BASIC (struct SV_3DOF_Y_BASIC *pthisSV)
 
void fInit_6DOF_GB_BASIC (struct SV_6DOF_GB_BASIC *pthisSV, struct AccelSensor *pthisAccel, struct MagSensor *pthisMag, float flpftimesecs)
 
void fInit_6DOF_GY_KALMAN (struct SV_6DOF_GY_KALMAN *pthisSV, struct AccelSensor *pthisAccel, struct GyroSensor *pthisGyro)
 
void fInit_9DOF_GBY_KALMAN (struct SV_9DOF_GBY_KALMAN *pthisSV, struct AccelSensor *pthisAccel, struct MagSensor *pthisMag, struct GyroSensor *pthisGyro, struct MagCalibration *pthisMagCal)
 
void fRun_1DOF_P_BASIC (struct SV_1DOF_P_BASIC *pthisSV, struct PressureSensor *pthisPressure)
 
void fRun_3DOF_G_BASIC (struct SV_3DOF_G_BASIC *pthisSV, struct AccelSensor *pthisAccel)
 
void fRun_3DOF_B_BASIC (struct SV_3DOF_B_BASIC *pthisSV, struct MagSensor *pthisMag)
 
void fRun_3DOF_Y_BASIC (struct SV_3DOF_Y_BASIC *pthisSV, struct GyroSensor *pthisGyro)
 
void fRun_6DOF_GB_BASIC (struct SV_6DOF_GB_BASIC *pthisSV, struct MagSensor *pthisMag, struct AccelSensor *pthisAccel)
 
void fRun_6DOF_GY_KALMAN (struct SV_6DOF_GY_KALMAN *pthisSV, struct AccelSensor *pthisAccel, struct GyroSensor *pthisGyro)
 
void fRun_9DOF_GBY_KALMAN (struct SV_9DOF_GBY_KALMAN *pthisSV, struct AccelSensor *pthisAccel, struct MagSensor *pthisMag, struct GyroSensor *pthisGyro, struct MagCalibration *pthisMagCal)
 

Detailed Description

Lower level sensor fusion interface.

This file can be used to "tune" the performance of specific algorithms within the sensor fusion library. It also defines the lower level function definitions for specific algorithms. Normally, the higher level hooks in sensor_fusion.h will be used, and those shown here will be left alone.

Definition in file fusion.h.

Macro Definition Documentation

◆ FLPFSECS_1DOF_P_BASIC

#define FLPFSECS_1DOF_P_BASIC   1.5F

pressure low pass filter time constant (s)

Definition at line 30 of file fusion.h.

◆ FLPFSECS_3DOF_B_BASIC

#define FLPFSECS_3DOF_B_BASIC   7.0F

2D eCompass orientation low pass filter time constant (s)

Definition at line 40 of file fusion.h.

◆ FLPFSECS_3DOF_G_BASIC

#define FLPFSECS_3DOF_G_BASIC   1.0F

tilt orientation low pass filter time constant (s)

Definition at line 35 of file fusion.h.

◆ FLPFSECS_6DOF_GB_BASIC

#define FLPFSECS_6DOF_GB_BASIC   7.0F

Definition at line 45 of file fusion.h.

◆ FMAX_6DOF_GY_BPL

#define FMAX_6DOF_GY_BPL   7.0F

maximum permissible power on gyro offsets (deg/s)

Definition at line 54 of file fusion.h.

◆ FMAX_9DOF_GBY_BPL

#define FMAX_9DOF_GBY_BPL   7.0F

maximum permissible power on gyro offsets (deg/s)

Definition at line 66 of file fusion.h.

◆ FMIN_6DOF_GY_BPL

#define FMIN_6DOF_GY_BPL   -7.0F

minimum permissible power on gyro offsets (deg/s)

Definition at line 53 of file fusion.h.

◆ FMIN_9DOF_GBY_BPL

#define FMIN_9DOF_GBY_BPL   -7.0F

minimum permissible power on gyro offsets (deg/s)

Definition at line 65 of file fusion.h.

◆ FQVB_9DOF_GBY_KALMAN

#define FQVB_9DOF_GBY_KALMAN   5E0

magnetometer sensor noise variance units uT^2 defining minimum deviation from geomagnetic sphere.

Definition at line 63 of file fusion.h.

◆ FQVG_6DOF_GY_KALMAN

#define FQVG_6DOF_GY_KALMAN   1.2E-3

accelerometer sensor noise variance units g^2

Definition at line 51 of file fusion.h.

◆ FQVG_9DOF_GBY_KALMAN

#define FQVG_9DOF_GBY_KALMAN   1.2E-3

accelerometer sensor noise variance units g^2 defining minimum deviation from 1g sphere

Definition at line 62 of file fusion.h.

◆ FQVY_6DOF_GY_KALMAN

#define FQVY_6DOF_GY_KALMAN   2E2

gyro sensor noise variance units (deg/s)^2

Definition at line 50 of file fusion.h.

◆ FQVY_9DOF_GBY_KALMAN

#define FQVY_9DOF_GBY_KALMAN   2E2

gyro sensor noise variance units (deg/s)^2

Definition at line 61 of file fusion.h.

◆ FQWB_6DOF_GY_KALMAN

#define FQWB_6DOF_GY_KALMAN   2E-2F

gyro offset random walk units (deg/s)^2

Definition at line 52 of file fusion.h.

◆ FQWB_9DOF_GBY_KALMAN

#define FQWB_9DOF_GBY_KALMAN   2E-2F

gyro offset random walk units (deg/s)^2

Definition at line 64 of file fusion.h.

Function Documentation

◆ fFuseSensors()

void fFuseSensors ( struct SV_1DOF_P_BASIC pthisSV_1DOF_P_BASIC,
struct SV_3DOF_G_BASIC pthisSV_3DOF_G_BASIC,
struct SV_3DOF_B_BASIC pthisSV_3DOF_B_BASIC,
struct SV_3DOF_Y_BASIC pthisSV_3DOF_Y_BASIC,
struct SV_6DOF_GB_BASIC pthisSV_6DOF_GB_BASIC,
struct SV_6DOF_GY_KALMAN pthisSV_6DOF_GY_KALMAN,
struct SV_9DOF_GBY_KALMAN pthisSV_9DOF_GBY_KALMAN,
struct AccelSensor pthisAccel,
struct MagSensor pthisMag,
struct GyroSensor pthisGyro,
struct PressureSensor pthisPressure,
struct MagCalibration pthisMagCal 
)

Definition at line 66 of file fusion.c.

◆ fInit_1DOF_P_BASIC()

void fInit_1DOF_P_BASIC ( struct SV_1DOF_P_BASIC pthisSV,
struct PressureSensor pthisPressure,
float  flpftimesecs 
)

Definition at line 152 of file fusion.c.

◆ fInit_3DOF_B_BASIC()

void fInit_3DOF_B_BASIC ( struct SV_3DOF_B_BASIC pthisSV,
struct MagSensor pthisMag,
float  flpftimesecs 
)

Definition at line 205 of file fusion.c.

◆ fInit_3DOF_G_BASIC()

void fInit_3DOF_G_BASIC ( struct SV_3DOF_G_BASIC pthisSV,
struct AccelSensor pthisAccel,
float  flpftimesecs 
)

Definition at line 177 of file fusion.c.

◆ fInit_3DOF_Y_BASIC()

void fInit_3DOF_Y_BASIC ( struct SV_3DOF_Y_BASIC pthisSV)

Definition at line 233 of file fusion.c.

◆ fInit_6DOF_GB_BASIC()

void fInit_6DOF_GB_BASIC ( struct SV_6DOF_GB_BASIC pthisSV,
struct AccelSensor pthisAccel,
struct MagSensor pthisMag,
float  flpftimesecs 
)

Definition at line 248 of file fusion.c.

◆ fInit_6DOF_GY_KALMAN()

void fInit_6DOF_GY_KALMAN ( struct SV_6DOF_GY_KALMAN pthisSV,
struct AccelSensor pthisAccel,
struct GyroSensor pthisGyro 
)

Definition at line 280 of file fusion.c.

◆ fInit_9DOF_GBY_KALMAN()

void fInit_9DOF_GBY_KALMAN ( struct SV_9DOF_GBY_KALMAN pthisSV,
struct AccelSensor pthisAccel,
struct MagSensor pthisMag,
struct GyroSensor pthisGyro,
struct MagCalibration pthisMagCal 
)

Definition at line 342 of file fusion.c.

◆ fInitializeFusion()

void fInitializeFusion ( SensorFusionGlobals sfg)

Definition at line 31 of file fusion.c.

◆ fRun_1DOF_P_BASIC()

void fRun_1DOF_P_BASIC ( struct SV_1DOF_P_BASIC pthisSV,
struct PressureSensor pthisPressure 
)

Definition at line 413 of file fusion.c.

◆ fRun_3DOF_B_BASIC()

void fRun_3DOF_B_BASIC ( struct SV_3DOF_B_BASIC pthisSV,
struct MagSensor pthisMag 
)

Definition at line 483 of file fusion.c.

◆ fRun_3DOF_G_BASIC()

void fRun_3DOF_G_BASIC ( struct SV_3DOF_G_BASIC pthisSV,
struct AccelSensor pthisAccel 
)

Definition at line 433 of file fusion.c.

◆ fRun_3DOF_Y_BASIC()

void fRun_3DOF_Y_BASIC ( struct SV_3DOF_Y_BASIC pthisSV,
struct GyroSensor pthisGyro 
)

Definition at line 528 of file fusion.c.

◆ fRun_6DOF_GB_BASIC()

void fRun_6DOF_GB_BASIC ( struct SV_6DOF_GB_BASIC pthisSV,
struct MagSensor pthisMag,
struct AccelSensor pthisAccel 
)

Definition at line 576 of file fusion.c.

◆ fRun_6DOF_GY_KALMAN()

void fRun_6DOF_GY_KALMAN ( struct SV_6DOF_GY_KALMAN pthisSV,
struct AccelSensor pthisAccel,
struct GyroSensor pthisGyro 
)

Definition at line 629 of file fusion.c.