mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 17:53:35 +08:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user