Hi everyone.
I’ve setup my drone so that the LEDs change colour depending on the flight mode.
I also use custom Mavlink messages and an RP2040 based device that listens in & let’s you change the colours.
It’s open source of course, and so just in case it gains some traction I’m curious if anyone has any strong opinions on the default colours for different flight modes.
Contribute to DanielAdelodun/MAVLink_Lights development by creating an account on GitHub.
I’m getting the flight mode off of the possible Heartbeat statuses, and mapping them as below. Also interesting in other ways to decide on flightmode.
enum PX4_CUSTOM_MAIN_MODE {
PX4_CUSTOM_MAIN_MODE_MANUAL = 1, // CD5C5C (IndianRed)
PX4_CUSTOM_MAIN_MODE_ALTCTL, // D2691E (Chocolate)
PX4_CUSTOM_MAIN_MODE_POSCTL, // HAS SUB MODES
PX4_CUSTOM_MAIN_MODE_AUTO, // HAS SUB MODES
PX4_CUSTOM_MAIN_MODE_ACRO, // FF69B4 (HotPink)
PX4_CUSTOM_MAIN_MODE_OFFBOARD, // FFFF00 (Yellow)
PX4_CUSTOM_MAIN_MODE_STABILIZED, // CD5C5C (IndianRed)
PX4_CUSTOM_MAIN_MODE_RATTITUDE_LEGACY, // FFFFFF (White)
PX4_CUSTOM_MAIN_MODE_SIMPLE, // FFFFFF (White)
PX4_CUSTOM_MAIN_MODE_TERMINATION, // FFFFFF (White)
};
enum PX4_CUSTOM_SUB_MODE_AUTO {
PX4_CUSTOM_SUB_MODE_AUTO_READY = 1, // 00FF8F (SpringGreen)
PX4_CUSTOM_SUB_MODE_AUTO_TAKEOFF, // FFA07A (LightSalmon)
PX4_CUSTOM_SUB_MODE_AUTO_LOITER, // FF8C00 (DarkOrange)
PX4_CUSTOM_SUB_MODE_AUTO_MISSION, // 00FF00 (Green)
PX4_CUSTOM_SUB_MODE_AUTO_RTL, // 00FFFF (Cyan)
PX4_CUSTOM_SUB_MODE_AUTO_LAND, // FFA500 (Orange)
PX4_CUSTOM_SUB_MODE_AUTO_RESERVED_DO_NOT_USE, // FFFFFF (White)
PX4_CUSTOM_SUB_MODE_AUTO_FOLLOW_TARGET, // 98FB98 (PaleGreen)
PX4_CUSTOM_SUB_MODE_AUTO_PRECLAND, // FFFFFF (White)
PX4_CUSTOM_SUB_MODE_AUTO_VTOL_TAKEOFF, // FFFFFF (White)
PX4_CUSTOM_SUB_MODE_EXTERNAL1,
PX4_CUSTOM_SUB_MODE_EXTERNAL2,
PX4_CUSTOM_SUB_MODE_EXTERNAL3,
PX4_CUSTOM_SUB_MODE_EXTERNAL4,
PX4_CUSTOM_SUB_MODE_EXTERNAL5,
PX4_CUSTOM_SUB_MODE_EXTERNAL6,
PX4_CUSTOM_SUB_MODE_EXTERNAL7,
PX4_CUSTOM_SUB_MODE_EXTERNAL8,
};
enum PX4_CUSTOM_SUB_MODE_POSCTL {
PX4_CUSTOM_SUB_MODE_POSCTL_POSCTL = 0, // 0000FF (Blue)
PX4_CUSTOM_SUB_MODE_POSCTL_ORBIT, // A020F0 (Purple)
PX4_CUSTOM_SUB_MODE_POSCTL_SLOW // 9370DB (MediumPurple)
};