diff options
author | Julian Oes <joes@student.ethz.ch> | 2013-02-18 16:35:34 -0800 |
---|---|---|
committer | Julian Oes <joes@student.ethz.ch> | 2013-02-18 16:35:34 -0800 |
commit | b7faaca435551064e6fdb070a9e762b4146ae4e8 (patch) | |
tree | 52f790046a396d523d5a0ffb46a18617766d5242 /apps/commander/commander.c | |
parent | f8326300e89c63c57662868d6253b06a13621401 (diff) | |
download | px4-firmware-b7faaca435551064e6fdb070a9e762b4146ae4e8.tar.gz px4-firmware-b7faaca435551064e6fdb070a9e762b4146ae4e8.tar.bz2 px4-firmware-b7faaca435551064e6fdb070a9e762b4146ae4e8.zip |
Checkpoint: Arming/Disarming works
Diffstat (limited to 'apps/commander/commander.c')
-rw-r--r-- | apps/commander/commander.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/commander/commander.c b/apps/commander/commander.c index 27c5f1989..ac535dd9a 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1649,6 +1649,13 @@ int commander_thread_main(int argc, char *argv[]) /* End battery voltage check */ + /* If in INIT state, try to proceed to STANDBY state */ + if (current_status.arming_state == ARMING_STATE_INIT) { + do_arming_state_update(stat_pub, ¤t_status, mavlink_fd, ARMING_STATE_STANDBY); + } else { + // XXX: Add emergency stuff if sensors are lost + } + /* * Check for valid position information. @@ -1894,12 +1901,11 @@ int commander_thread_main(int argc, char *argv[]) * Check if left stick is in lower left position --> switch to standby state. * Do this only for multirotors, not for fixed wing aircraft. */ - if (((current_status.system_type == VEHICLE_TYPE_QUADROTOR) || - (current_status.system_type == VEHICLE_TYPE_HEXAROTOR) || - (current_status.system_type == VEHICLE_TYPE_OCTOROTOR) - ) && - ((sp_man.yaw < -STICK_ON_OFF_LIMIT)) && - (sp_man.throttle < STICK_THRUST_RANGE * 0.2f)) { +// if (((current_status.system_type == VEHICLE_TYPE_QUADROTOR) || +// (current_status.system_type == VEHICLE_TYPE_HEXAROTOR) || +// (current_status.system_type == VEHICLE_TYPE_OCTOROTOR) +// ) && + if ((sp_man.yaw < -STICK_ON_OFF_LIMIT) && (sp_man.throttle < STICK_THRUST_RANGE * 0.2f)) { if (stick_off_counter > STICK_ON_OFF_COUNTER_LIMIT) { do_arming_state_update(stat_pub, ¤t_status, mavlink_fd, ARMING_STATE_STANDBY); stick_off_counter = 0; |