Description

IMU fusion driver.

Data Structures

struct  sl_imu_sensor_fusion
 Structure to store the sensor fusion data.
 

Functions

void sl_imu_fuse_accelerometer_set_sample_rate (sl_imu_sensor_fusion_t *f, float rate)
 Set the accelerometer sample rate in the sl_imu_sensor_fusion_t structure.
 
void sl_imu_fuse_accelerometer_update_filter (sl_imu_sensor_fusion_t *f, float avec[3])
 Add the current accelerometer data to the accumulator.
 
void sl_imu_fuse_gyro_set_sample_rate (sl_imu_sensor_fusion_t *f, float rate)
 Set the gyro sample rate and related values in the sl_imu_sensor_fusion_t structure.
 
void sl_imu_fuse_gyro_update (sl_imu_sensor_fusion_t *f, float gvec[3])
 Update the fusion calculation with a new gyro data.
 
void sl_imu_fuse_gyro_clear_correction_vector (sl_imu_sensor_fusion_t *f)
 Clear the gyro correction vector.
 
void sl_imu_fuse_gyro_calculate_correction_vector (sl_imu_sensor_fusion_t *f, bool accValid, bool dirValid, float dirZ)
 Calculate the gyro correction vector.
 
void sl_imu_fuse_new (sl_imu_sensor_fusion_t *f)
 Initialize a new sl_imu_sensor_fusion_t structure.
 
void sl_imu_fuse_reset (sl_imu_sensor_fusion_t *f)
 Clear the values of the sensor fusion object.
 
void sl_imu_fuse_update (sl_imu_sensor_fusion_t *f)
 Update the fusion calculation.
 

Function Documentation

◆ sl_imu_fuse_accelerometer_set_sample_rate()

void sl_imu_fuse_accelerometer_set_sample_rate ( sl_imu_sensor_fusion_t *  f,
float  rate 
)

Set the accelerometer sample rate in the sl_imu_sensor_fusion_t structure.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object
[in]rateSample rate of the accelerometer

◆ sl_imu_fuse_accelerometer_update_filter()

void sl_imu_fuse_accelerometer_update_filter ( sl_imu_sensor_fusion_t *  f,
float  avec[3] 
)

Add the current accelerometer data to the accumulator.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object
[in]avecAccelerometer vector

◆ sl_imu_fuse_gyro_set_sample_rate()

void sl_imu_fuse_gyro_set_sample_rate ( sl_imu_sensor_fusion_t *  f,
float  rate 
)

Set the gyro sample rate and related values in the sl_imu_sensor_fusion_t structure.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object
[in]rateSample rate of the gyroscope

◆ sl_imu_fuse_gyro_update()

void sl_imu_fuse_gyro_update ( sl_imu_sensor_fusion_t *  f,
float  gvec[3] 
)

Update the fusion calculation with a new gyro data.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object
[in]gvecGyroscope vector

◆ sl_imu_fuse_gyro_clear_correction_vector()

void sl_imu_fuse_gyro_clear_correction_vector ( sl_imu_sensor_fusion_t *  f)

Clear the gyro correction vector.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object

◆ sl_imu_fuse_gyro_calculate_correction_vector()

void sl_imu_fuse_gyro_calculate_correction_vector ( sl_imu_sensor_fusion_t *  f,
bool  accValid,
bool  dirValid,
float  dirZ 
)

Calculate the gyro correction vector.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object
[in]accValidTrue if the acceleration value is within limits
[in]dirValidTrue if the direction value is valid
[in]dirZThe direction of the Z axis

◆ sl_imu_fuse_new()

void sl_imu_fuse_new ( sl_imu_sensor_fusion_t *  f)

Initialize a new sl_imu_sensor_fusion_t structure.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object to be initialized

◆ sl_imu_fuse_reset()

void sl_imu_fuse_reset ( sl_imu_sensor_fusion_t *  f)

Clear the values of the sensor fusion object.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object

◆ sl_imu_fuse_update()

void sl_imu_fuse_update ( sl_imu_sensor_fusion_t *  f)

Update the fusion calculation.

Parameters
[in,out]fPointer to the sl_imu_sensor_fusion_t object