diff options
Diffstat (limited to 'apps/commander/commander.c')
-rw-r--r-- | apps/commander/commander.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/commander/commander.c b/apps/commander/commander.c index 7277e9fa4..33ed5ebc2 100644 --- a/apps/commander/commander.c +++ b/apps/commander/commander.c @@ -1496,14 +1496,20 @@ int commander_thread_main(int argc, char *argv[]) } //printf("RC: y:%i/t:%i s:%i chans: %i\n", rc_yaw_scale, rc_throttle_scale, mode_switch_rc_value, rc.chan_count); - if (sp_man.override_mode_switch > STICK_ON_OFF_LIMIT) { + if (sp_man.aux1_cam_pan_flaps < -STICK_ON_OFF_LIMIT) { update_state_machine_mode_manual(stat_pub, ¤t_status, mavlink_fd); + } else { + if (sp_man.override_mode_switch > STICK_ON_OFF_LIMIT) { + //update_state_machine_mode_manual(stat_pub, ¤t_status, mavlink_fd); + // XXX hack + update_state_machine_mode_stabilized(stat_pub, ¤t_status, mavlink_fd); - } else if (sp_man.override_mode_switch < -STICK_ON_OFF_LIMIT) { - update_state_machine_mode_auto(stat_pub, ¤t_status, mavlink_fd); + } else if (sp_man.override_mode_switch < -STICK_ON_OFF_LIMIT) { + update_state_machine_mode_auto(stat_pub, ¤t_status, mavlink_fd); - } else { - update_state_machine_mode_stabilized(stat_pub, ¤t_status, mavlink_fd); + } else { + update_state_machine_mode_stabilized(stat_pub, ¤t_status, mavlink_fd); + } } /* handle the case where RC signal was regained */ |