events: refactor temperature_calibration command to take options and use a single vehicle_command

This makes it easier to start calibration for all sensors at once.
This commit is contained in:
Beat Küng
2017-02-02 15:42:09 +01:00
committed by Lorenz Meier
parent 603cd1e6dc
commit b6f3cf9425
3 changed files with 62 additions and 82 deletions
+9 -3
View File
@@ -1062,21 +1062,27 @@ then
# Check if we should start a thermal calibration
# TODO move further up and don't start unnecessary services if we are calibrating
#
set TEMP_CALIB_ARGS ""
if param compare SYS_CAL_GYRO 1
then
send_event start_temp_gyro_cal
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -g"
param set SYS_CAL_GYRO 0
fi
if param compare SYS_CAL_ACCEL 1
then
send_event start_temp_accel_cal
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -a"
param set SYS_CAL_ACCEL 0
fi
if param compare SYS_CAL_BARO 1
then
send_event start_temp_baro_cal
set TEMP_CALIB_ARGS "${TEMP_CALIB_ARGS} -b"
param set SYS_CAL_BARO 0
fi
if [ "x$TEMP_CALIB_ARGS" != "x" ]
then
send_event temperature_calibration ${TEMP_CALIB_ARGS}
fi
unset TEMP_CALIB_ARGS
# End of autostart
fi