mode switching for all platforms, additional fixed wing modes

This commit is contained in:
Lorenz Meier
2012-11-25 13:55:28 +01:00
parent dc72d467d4
commit faa672f8bb
5 changed files with 215 additions and 132 deletions
+12 -6
View File
@@ -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, &current_status, mavlink_fd);
} else if (sp_man.override_mode_switch < -STICK_ON_OFF_LIMIT) {
update_state_machine_mode_auto(stat_pub, &current_status, mavlink_fd);
} else {
update_state_machine_mode_stabilized(stat_pub, &current_status, mavlink_fd);
if (sp_man.override_mode_switch > STICK_ON_OFF_LIMIT) {
//update_state_machine_mode_manual(stat_pub, &current_status, mavlink_fd);
// XXX hack
update_state_machine_mode_stabilized(stat_pub, &current_status, mavlink_fd);
} else if (sp_man.override_mode_switch < -STICK_ON_OFF_LIMIT) {
update_state_machine_mode_auto(stat_pub, &current_status, mavlink_fd);
} else {
update_state_machine_mode_stabilized(stat_pub, &current_status, mavlink_fd);
}
}
/* handle the case where RC signal was regained */