mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-12 05:37:34 +08:00
create temperature_compensation module
- this is a new module for temperature compensation that consolidates the functionality previously handled in the sensors module (calculating runtime thermal corrections) and the events module (online thermal calibration) - by collecting this functionality into a single module we can optionally disable it on systems where it's not used and save some flash (if disabled at build time) or memory (disabled at run time)
This commit is contained in:
@@ -5,12 +5,37 @@
|
||||
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
||||
#
|
||||
|
||||
set TEMP_CALIB_ARGS ""
|
||||
set TEMP_COMP_START ""
|
||||
|
||||
if param compare TC_A_ENABLE 1
|
||||
then
|
||||
set TEMP_COMP_START "true"
|
||||
fi
|
||||
|
||||
if param compare TC_B_ENABLE 1
|
||||
then
|
||||
set TEMP_COMP_START "true"
|
||||
fi
|
||||
|
||||
if param compare TC_G_ENABLE 1
|
||||
then
|
||||
set TEMP_COMP_START "true"
|
||||
fi
|
||||
|
||||
if [ "x$TEMP_COMP_START" != "x" ]
|
||||
then
|
||||
temperature_compensation start
|
||||
fi
|
||||
|
||||
unset TEMP_COMP_START
|
||||
|
||||
|
||||
#
|
||||
# Determine if a thermal calibration should be started.
|
||||
#
|
||||
|
||||
set TEMP_CALIB_ARGS ""
|
||||
|
||||
if param compare SYS_CAL_ACCEL 1
|
||||
then
|
||||
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -a"
|
||||
@@ -34,7 +59,7 @@ fi
|
||||
#
|
||||
if [ "x$TEMP_CALIB_ARGS" != "x" ]
|
||||
then
|
||||
send_event temperature_calibration ${TEMP_CALIB_ARGS}
|
||||
temperature_compensation calibrate ${TEMP_CALIB_ARGS}
|
||||
fi
|
||||
|
||||
unset TEMP_CALIB_ARGS
|
||||
unset TEMP_CALIB_ARGS
|
||||
|
||||
Reference in New Issue
Block a user