PX4 Firmware
PX4 Autopilot Software http://px4.io
TemperatureCalibrationBase Class Referenceabstract

Base class for temperature calibration types with abstract methods (for all different sensor types) More...

#include <common.h>

Inheritance diagram for TemperatureCalibrationBase:
Collaboration diagram for TemperatureCalibrationBase:

Public Member Functions

 TemperatureCalibrationBase (float min_temperature_rise, float min_start_temperature, float max_start_temperature)
 
virtual ~TemperatureCalibrationBase ()
 
virtual int update ()=0
 check & update new sensor data. More...
 
virtual int finish ()=0
 do final fitting & write the parameters. More...
 
virtual void reset_calibration ()=0
 reset all driver-level calibration parameters More...
 

Protected Member Functions

int set_parameter (const char *format_str, unsigned index, const void *value)
 set a system parameter (without system notification) and print an error if it fails More...
 

Protected Attributes

float _min_temperature_rise
 minimum difference in temperature before the process finishes More...
 
float _min_start_temperature
 minimum temperature before the process starts More...
 
float _max_start_temperature
 maximum temperature above which the process does not start and an error is declared More...
 

Detailed Description

Base class for temperature calibration types with abstract methods (for all different sensor types)

Definition at line 58 of file common.h.

Constructor & Destructor Documentation

◆ TemperatureCalibrationBase()

TemperatureCalibrationBase::TemperatureCalibrationBase ( float  min_temperature_rise,
float  min_start_temperature,
float  max_start_temperature 
)
inline

Definition at line 61 of file common.h.

◆ ~TemperatureCalibrationBase()

virtual TemperatureCalibrationBase::~TemperatureCalibrationBase ( )
inlinevirtual

Definition at line 65 of file common.h.

References finish(), reset_calibration(), set_parameter(), and update().

Here is the call graph for this function:

Member Function Documentation

◆ finish()

virtual int TemperatureCalibrationBase::finish ( )
pure virtual

do final fitting & write the parameters.

Call this exactly once after update() returned 110

Returns
0 on success, <0 otherwise

Implemented in TemperatureCalibrationBaro, TemperatureCalibrationGyro, and TemperatureCalibrationAccel.

Referenced by TemperatureCalibration::task_main(), and ~TemperatureCalibrationBase().

Here is the caller graph for this function:

◆ reset_calibration()

virtual void TemperatureCalibrationBase::reset_calibration ( )
pure virtual

reset all driver-level calibration parameters

Implemented in TemperatureCalibrationBaro, TemperatureCalibrationGyro, and TemperatureCalibrationAccel.

Referenced by TemperatureCalibration::task_main(), and ~TemperatureCalibrationBase().

Here is the caller graph for this function:

◆ set_parameter()

int TemperatureCalibrationBase::set_parameter ( const char *  format_str,
unsigned  index,
const void *  value 
)
inlineprotected

set a system parameter (without system notification) and print an error if it fails

Parameters
format_strfor example "CAL_GYRO%u_XOFF"
indexwhich index (will replace u in format_str)
value
Returns
0 on success

Definition at line 102 of file common.h.

References param_find(), and param_set_no_notification().

Referenced by TemperatureCalibrationAccel::finish_sensor_instance(), TemperatureCalibrationGyro::finish_sensor_instance(), TemperatureCalibrationBaro::finish_sensor_instance(), TemperatureCalibrationAccel::reset_calibration(), TemperatureCalibrationGyro::reset_calibration(), and ~TemperatureCalibrationBase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

virtual int TemperatureCalibrationBase::update ( )
pure virtual

check & update new sensor data.

Returns
progress in range [0, 100], 110 when finished, <0 on error, -TC_ERROR_INITIAL_TEMP_TOO_HIGH if starting temperature is too hot -TC_ERROR_COMMUNICATION if no sensors found

Implemented in TemperatureCalibrationCommon< Dim, PolyfitOrder >, TemperatureCalibrationCommon< 1, POLYFIT_ORDER >, and TemperatureCalibrationCommon< 3, 3 >.

Referenced by TemperatureCalibration::task_main(), and ~TemperatureCalibrationBase().

Here is the caller graph for this function:

Member Data Documentation

◆ _max_start_temperature

float TemperatureCalibrationBase::_max_start_temperature
protected

maximum temperature above which the process does not start and an error is declared

Definition at line 97 of file common.h.

Referenced by TemperatureCalibrationAccel::update_sensor_instance(), TemperatureCalibrationGyro::update_sensor_instance(), and TemperatureCalibrationBaro::update_sensor_instance().

◆ _min_start_temperature

float TemperatureCalibrationBase::_min_start_temperature
protected

◆ _min_temperature_rise

float TemperatureCalibrationBase::_min_temperature_rise
protected

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