From faa672f8bb257ec0ee357ad55da3195b79aeb54b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 25 Nov 2012 13:55:28 +0100 Subject: mode switching for all platforms, additional fixed wing modes --- apps/commander/commander.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'apps/commander/commander.c') 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 */ -- cgit v1.2.3