aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Jansen <jnsn.johan@gmail.com>2015-03-08 14:51:23 +0100
committerLorenz Meier <lm@inf.ethz.ch>2015-04-20 09:14:12 +0200
commitb70138c631985fe09a3f373a3084346811199878 (patch)
tree13f064e82c5d5312b0ad90b8f517c89ef43213ed
parentc5a178a777c29f72e8d6ec6e9fc0623515aa4773 (diff)
downloadpx4-firmware-b70138c631985fe09a3f373a3084346811199878.tar.gz
px4-firmware-b70138c631985fe09a3f373a3084346811199878.tar.bz2
px4-firmware-b70138c631985fe09a3f373a3084346811199878.zip
Commander: Re-run preflight check after calibration
-rw-r--r--src/modules/commander/commander.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp
index bf17a7b31..01f084007 100644
--- a/src/modules/commander/commander.cpp
+++ b/src/modules/commander/commander.cpp
@@ -2703,12 +2703,22 @@ void *commander_low_prio_loop(void *arg)
tune_negative(true);
}
+ // Update preflight check status
+ // we do not set the calibration return value based on it because the calibration
+ // might have worked just fine, but the preflight check fails for a different reason,
+ // so this would be prone to false negatives.
+ status.condition_system_sensors_initialized = Commander::preflightCheck(mavlink_fd, true, true, true, true, true);
+
arming_state_transition(&status, &safety, vehicle_status_s::ARMING_STATE_STANDBY, &armed, true /* fRunPreArmChecks */, mavlink_fd);
break;
}
case VEHICLE_CMD_PREFLIGHT_STORAGE: {
+ // Update preflight check status
+ status.condition_system_sensors_initialized = Commander::preflightCheck(mavlink_fd, true, true, true, true, true);
+
+ arming_state_transition(&status, &safety, vehicle_status_s::ARMING_STATE_STANDBY, &armed, true /* fRunPreArmChecks */, mavlink_fd);
if (((int)(cmd.param1)) == 0) {
int ret = param_load_default();