aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2013-06-29 21:01:20 +0400
committerAnton Babushkin <anton.babushkin@me.com>2013-06-29 21:01:20 +0400
commitaeb363720925cf25fe159b065dbc55717d73c165 (patch)
tree2280933260aaba6aa222a2ffb4ee150ef177b939 /src/modules
parent7dfaed3ee7718c15731070f3e3bd54d725f72029 (diff)
parent2f1de6621b34f76ddf3a0ff00ac8e9fcb8e60bea (diff)
downloadpx4-firmware-aeb363720925cf25fe159b065dbc55717d73c165.tar.gz
px4-firmware-aeb363720925cf25fe159b065dbc55717d73c165.tar.bz2
px4-firmware-aeb363720925cf25fe159b065dbc55717d73c165.zip
Merge branch 'arm_safe_fix' into seatbelt_multirotor
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/commander/commander.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/commander/commander.c b/src/modules/commander/commander.c
index bb8580328..bb3aac0ff 100644
--- a/src/modules/commander/commander.c
+++ b/src/modules/commander/commander.c
@@ -1857,8 +1857,10 @@ int commander_thread_main(int argc, char *argv[])
(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)) {
+ current_status.flag_control_manual_enabled &&
+ current_status.manual_sas_mode == VEHICLE_MANUAL_SAS_MODE_ROLL_PITCH_ABS_YAW_ABS &&
+ sp_man.yaw < -STICK_ON_OFF_LIMIT &&
+ sp_man.throttle < STICK_THRUST_RANGE * 0.1f) {
if (stick_off_counter > STICK_ON_OFF_COUNTER_LIMIT) {
update_state_machine_disarm(stat_pub, &current_status, mavlink_fd);
stick_on_counter = 0;
@@ -1870,7 +1872,10 @@ int commander_thread_main(int argc, char *argv[])
}
/* check if left stick is in lower right position --> arm */
- if (sp_man.yaw > STICK_ON_OFF_LIMIT && sp_man.throttle < STICK_THRUST_RANGE * 0.2f) {
+ if (current_status.flag_control_manual_enabled &&
+ current_status.manual_sas_mode == VEHICLE_MANUAL_SAS_MODE_ROLL_PITCH_ABS_YAW_ABS &&
+ sp_man.yaw > STICK_ON_OFF_LIMIT &&
+ sp_man.throttle < STICK_THRUST_RANGE * 0.1f) {
if (stick_on_counter > STICK_ON_OFF_COUNTER_LIMIT) {
update_state_machine_arm(stat_pub, &current_status, mavlink_fd);
stick_on_counter = 0;