Firmware
Classes | Public Member Functions | List of all members
sensors::TemperatureCompensation Class Reference

class TemperatureCompensation Applies temperature compensation to sensor data. More...

#include <temperature_compensation.h>

Public Member Functions

int parameters_update (bool hil_enabled=false)
 (re)load the parameters. More...
 
int set_sensor_id_gyro (uint32_t device_id, int topic_instance)
 supply information which device_id matches a specific uORB topic_instance (needed if a system has multiple sensors of the same type) More...
 
int set_sensor_id_accel (uint32_t device_id, int topic_instance)
 
int set_sensor_id_baro (uint32_t device_id, int topic_instance)
 
int apply_corrections_gyro (int topic_instance, matrix::Vector3f &sensor_data, float temperature, float *offsets, float *scales)
 Apply Thermal corrections to gyro (& other) sensor data. More...
 
int apply_corrections_accel (int topic_instance, matrix::Vector3f &sensor_data, float temperature, float *offsets, float *scales)
 
int apply_corrections_baro (int topic_instance, float &sensor_data, float temperature, float *offsets, float *scales)
 
void print_status ()
 output current configuration status to console
 

Detailed Description

class TemperatureCompensation Applies temperature compensation to sensor data.

Loads the parameters from PX4 param storage.

Member Function Documentation

§ apply_corrections_gyro()

int sensors::TemperatureCompensation::apply_corrections_gyro ( int  topic_instance,
matrix::Vector3f &  sensor_data,
float  temperature,
float *  offsets,
float *  scales 
)

Apply Thermal corrections to gyro (& other) sensor data.

Parameters
topic_instanceuORB topic instance
sensor_datainput sensor data, output sensor data with applied corrections
temperaturemeasured current temperature
offsetsreturns offsets that were applied (length = 3, except for baro), depending on return value
scalesreturns scales that were applied (length = 3), depending on return value
Returns
-1: error: correction enabled, but no sensor mapping set (
See also
set_sendor_id_gyro) 0: no changes (correction not enabled), 1: corrections applied but no changes to offsets & scales, 2: corrections applied and offsets & scales updated

§ parameters_update()

int sensors::TemperatureCompensation::parameters_update ( bool  hil_enabled = false)

(re)load the parameters.

Make sure to call this on startup as well

§ set_sensor_id_gyro()

int sensors::TemperatureCompensation::set_sensor_id_gyro ( uint32_t  device_id,
int  topic_instance 
)

supply information which device_id matches a specific uORB topic_instance (needed if a system has multiple sensors of the same type)

Returns
index for compensation parameter entry containing matching device ID on success, <0 otherwise

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