diff --git a/apps/commander/state_machine_helper.c b/apps/commander/state_machine_helper.c index 1e82bc417b..f9ec6ba915 100644 --- a/apps/commander/state_machine_helper.c +++ b/apps/commander/state_machine_helper.c @@ -503,8 +503,8 @@ void update_state_machine_mode_manual(int status_pub, struct vehicle_status_s *c current_status->flight_mode = VEHICLE_FLIGHT_MODE_MANUAL; current_status->flag_control_manual_enabled = true; //XXX /* enable attitude control per default */ - current_status->flag_control_attitude_enabled = false; - current_status->flag_control_rates_enabled = true; + current_status->flag_control_attitude_enabled = true; + current_status->flag_control_rates_enabled = false; if (old_mode != current_status->flight_mode) state_machine_publish(status_pub, current_status, mavlink_fd); if (current_status->state_machine == SYSTEM_STATE_GROUND_READY || current_status->state_machine == SYSTEM_STATE_STABILIZED || current_status->state_machine == SYSTEM_STATE_AUTO) { @@ -518,8 +518,8 @@ void update_state_machine_mode_stabilized(int status_pub, struct vehicle_status_ int old_mode = current_status->flight_mode; current_status->flight_mode = VEHICLE_FLIGHT_MODE_STABILIZED; current_status->flag_control_manual_enabled = true; //XXX - current_status->flag_control_attitude_enabled = false; - current_status->flag_control_rates_enabled = true; + current_status->flag_control_attitude_enabled = true; + current_status->flag_control_rates_enabled = false; if (old_mode != current_status->flight_mode) state_machine_publish(status_pub, current_status, mavlink_fd); if (current_status->state_machine == SYSTEM_STATE_GROUND_READY || current_status->state_machine == SYSTEM_STATE_MANUAL || current_status->state_machine == SYSTEM_STATE_AUTO) { @@ -533,8 +533,8 @@ void update_state_machine_mode_auto(int status_pub, struct vehicle_status_s *cur int old_mode = current_status->flight_mode; current_status->flight_mode = VEHICLE_FLIGHT_MODE_AUTO; current_status->flag_control_manual_enabled = true; //XXX - current_status->flag_control_attitude_enabled = false; - current_status->flag_control_rates_enabled = true; + current_status->flag_control_attitude_enabled = true; + current_status->flag_control_rates_enabled = false; if (old_mode != current_status->flight_mode) state_machine_publish(status_pub, current_status, mavlink_fd); if (current_status->state_machine == SYSTEM_STATE_GROUND_READY || current_status->state_machine == SYSTEM_STATE_MANUAL || current_status->state_machine == SYSTEM_STATE_STABILIZED) { diff --git a/apps/multirotor_att_control/multirotor_att_control_main.c b/apps/multirotor_att_control/multirotor_att_control_main.c index 4b386ffd4f..18efe1ae2a 100644 --- a/apps/multirotor_att_control/multirotor_att_control_main.c +++ b/apps/multirotor_att_control/multirotor_att_control_main.c @@ -224,13 +224,13 @@ mc_thread_main(int argc, char *argv[]) /** STEP 3: Identify the controller setup to run and set up the inputs correctly */ /* run attitude controller */ - // if (state.flag_control_attitude_enabled && !state.flag_control_rates_enabled) { - // multirotor_control_attitude(&att_sp, &att, NULL, &actuators); - // orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); - // } else if (state.flag_control_attitude_enabled && state.flag_control_rates_enabled) { - // multirotor_control_attitude(&att_sp, &att, &rates_sp, NULL); - // orb_publish(ORB_ID(vehicle_rates_setpoint), rates_sp_pub, &rates_sp); - // } + if (state.flag_control_attitude_enabled && !state.flag_control_rates_enabled) { + multirotor_control_attitude(&att_sp, &att, NULL, &actuators); + orb_publish(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_pub, &actuators); + } else if (state.flag_control_attitude_enabled && state.flag_control_rates_enabled) { + multirotor_control_attitude(&att_sp, &att, &rates_sp, NULL); + orb_publish(ORB_ID(vehicle_rates_setpoint), rates_sp_pub, &rates_sp); + } if (state.flag_control_rates_enabled) {