diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-03-04 00:26:36 +0400 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-03-04 00:26:36 +0400 |
commit | d634f7942297931553b9852ef6917ebd9ac4e322 (patch) | |
tree | 9a1a6a6a3b0e6918cf2ff8e7b8f8eb8797fa4a9d /src | |
parent | 3107f4d62cb07de70619093be57ce2b634763eba (diff) | |
parent | b76e26c5e5f37c4fb086a68e0427d9d297e8d225 (diff) | |
download | px4-firmware-d634f7942297931553b9852ef6917ebd9ac4e322.tar.gz px4-firmware-d634f7942297931553b9852ef6917ebd9ac4e322.tar.bz2 px4-firmware-d634f7942297931553b9852ef6917ebd9ac4e322.zip |
Merge branch 'beta' into beta_mavlink2
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/commander/commander.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index d5af63120..d114a2e5c 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -902,7 +902,7 @@ int commander_thread_main(int argc, char *argv[]) orb_copy(ORB_ID(safety), safety_sub, &safety); /* disarm if safety is now on and still armed */ - if (safety.safety_switch_available && !safety.safety_off && armed.armed) { + if (status.hil_state == HIL_STATE_OFF && safety.safety_switch_available && !safety.safety_off && armed.armed) { arming_state_t new_arming_state = (status.arming_state == ARMING_STATE_ARMED ? ARMING_STATE_STANDBY : ARMING_STATE_STANDBY_ERROR); if (TRANSITION_CHANGED == arming_state_transition(&status, &safety, new_arming_state, &armed)) { mavlink_log_info(mavlink_fd, "[cmd] DISARMED by safety switch"); @@ -962,7 +962,7 @@ int commander_thread_main(int argc, char *argv[]) orb_copy(ORB_ID(battery_status), battery_sub, &battery); /* only consider battery voltage if system has been running 2s and battery voltage is valid */ - if (hrt_absolute_time() > start_time + 2000000 && battery.voltage_filtered_v > 0.0f) { + if (status.hil_state == HIL_STATE_OFF && hrt_absolute_time() > start_time + 2000000 && battery.voltage_filtered_v > 0.0f) { status.battery_voltage = battery.voltage_filtered_v; status.battery_current = battery.current_a; status.condition_battery_voltage_valid = true; |