Merge branch 'beta' into beta_mavlink2

This commit is contained in:
Anton Babushkin 2014-03-04 00:26:36 +04:00
commit d634f79422
1 changed files with 2 additions and 2 deletions

View File

@ -902,7 +902,7 @@ int commander_thread_main(int argc, char *argv[])
orb_copy(ORB_ID(safety), safety_sub, &safety); orb_copy(ORB_ID(safety), safety_sub, &safety);
/* disarm if safety is now on and still armed */ /* 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); 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)) { if (TRANSITION_CHANGED == arming_state_transition(&status, &safety, new_arming_state, &armed)) {
mavlink_log_info(mavlink_fd, "[cmd] DISARMED by safety switch"); 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); orb_copy(ORB_ID(battery_status), battery_sub, &battery);
/* only consider battery voltage if system has been running 2s and battery voltage is valid */ /* 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_voltage = battery.voltage_filtered_v;
status.battery_current = battery.current_a; status.battery_current = battery.current_a;
status.condition_battery_voltage_valid = true; status.condition_battery_voltage_valid = true;