commander: take main_state out of vehicle_status

This state is only commander internal. Therefore it doesn't need to be
in vehicle_status. Instead it is now in the commander_state message.
This commit is contained in:
Julian Oes
2016-04-11 18:01:48 +02:00
parent 1ad0ee0fae
commit 5ca5af5fcd
9 changed files with 214 additions and 164 deletions
+7 -8
View File
@@ -701,19 +701,18 @@ BlinkM::led()
led_blink = LED_BLINK;
if (new_data_vehicle_control_mode || no_data_vehicle_control_mode < 3) {
/* indicate main control state */
if (vehicle_status_raw.main_state == vehicle_status_s::MAIN_STATE_POSCTL) {
led_color_4 = LED_GREEN;
}
/* TODO: add other Auto modes */
else if (vehicle_status_raw.main_state == vehicle_status_s::MAIN_STATE_AUTO_MISSION) {
/* indicate main control state */
if (vehicle_control_mode.flag_control_auto_enabled) {
led_color_4 = LED_BLUE;
} else if (vehicle_status_raw.main_state == vehicle_status_s::MAIN_STATE_ALTCTL) {
} else if (vehicle_control_mode.flag_control_position_enabled) {
led_color_4 = LED_GREEN;
} else if (vehicle_control_mode.flag_control_altitude_enabled) {
led_color_4 = LED_YELLOW;
} else if (vehicle_status_raw.main_state == vehicle_status_s::MAIN_STATE_MANUAL) {
} else if (vehicle_control_mode.flag_control_manual_enabled) {
led_color_4 = LED_WHITE;
} else {