Mode
The mode microservice provides a high-level interface for reading and changing the operating mode of a MAVLink device.
It is a wrapper around MAVLink primitives: the microservice reads the current mode from HEARTBEAT
(base_mode / custom_mode) and requests mode changes via the Command Protocol (client implementations populate MAV_CMD_DO_SET_MODE
).
The mode microservice can be used in two roles:
A client implementing IModeClient
(for example, a ground control app) — sends mode change requests and observes the current mode via heartbeats.A server implementing IModeServer
(for example, an autopilot or simulator) — accepts mode change requests, applies them and reflects the current mode in heartbeats.
ICustomMode (source)
Reference for the ICustomMode
shape — an implementation describes a single autopilot-specific flight mode (examples: ArduCopter, ArduPlane, PX4, Unknown).
Property | Type | Description |
---|---|---|
|
| Gets the name of the property. |
|
| Gets the description of the property. |
|
| This flag indicates whether the vehicle can be set into this mode by the user command. You shouldn't show this mode in the user interface if this flag is true. |
Method | Return Type | Description |
---|---|---|
|
| Get args. |
|
| Checks if the given |
|
| Checks if the given |
|
| Fills mode-related fields in a |
ICustomMode.GetCommandLongArgs
Parameter | Type | Description |
---|---|---|
|
| Base mode. |
|
| Custom mode. |
|
| Custom submode. |
ICustomMode.IsCurrentMode(HeartbeatPayload? hb)
Parameter | Type | Description |
---|---|---|
|
| Heartbeat payload to check against this mode. |
ICustomMode.IsCurrentMode(CommandLongPayload payload)
Parameter | Type | Description |
---|---|---|
|
| Command payload to check against this mode. |
ICustomMode.Fill
Parameter | Type | Description |
---|---|---|
|
| Heartbeat payload to fill with the current mode info. |