mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 16:33:39 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user