Commands client
Use ICommandClient to send MAVLink commands (COMMAND_LONG and COMMAND_INT) to a remote system/component.
Use case
You can get CommandClient through the microservice locator:
Request-response call example:
Fire-and-forget call example (without waiting for COMMAND_ACK):
API
CommandProtocolConfig
Property | Type | Default | Description |
|---|---|---|---|
|
|
| Timeout for request/response mission calls. |
|
|
| Retry count for request/response calls. |
ICommandClient
Represents a command client that is capable of sending commands to an external system.
Property | Type | Description |
|---|---|---|
|
| Gets the observable sequence for receiving command acknowledgement payloads. |
Method | Return Type | Description |
|---|---|---|
|
| Sends a command with long parameter to the vehicle. |
|
| Executes a long-duration command with specified parameters. |
|
| Executes a long command and waits for the response packet. |
|
| Sends a long command to the specified MavCmd with the provided parameters. |
|
| Message encoding a command with parameters as scaled integers. Scaling depends on the actual command value. |
|
| Message encoding a command with parameters as scaled integers. Scaling depends on the actual command value. |
ICommandClient.CommandLong (delegate overload)
Parameter | Type | Description |
|---|---|---|
|
| The delegate used to edit the command payload. |
|
| The cancellation token to cancel the task. |
ICommandClient.CommandLong (params overload)
Parameter | Type | Description |
|---|---|---|
|
| The MAVLink command to execute. |
|
| The first parameter value. |
|
| The second parameter value. |
|
| The third parameter value. |
|
| The fourth parameter value. |
|
| The fifth parameter value. |
|
| The sixth parameter value. |
|
| The seventh parameter value. |
|
| A |
ICommandClient.CommandLongAndWaitPacket<TAnswerPacket>
Parameter | Type | Description |
|---|---|---|
|
| The command to be executed. |
|
| The first command parameter. |
|
| The second command parameter. |
|
| The third command parameter. |
|
| The fourth command parameter. |
|
| The fifth command parameter. |
|
| The sixth command parameter. |
|
| The seventh command parameter. |
|
| The cancellation token to cancel the command execution. |
ICommandClient.SendCommandLong
Parameter | Type | Description |
|---|---|---|
|
| The MavCmd command to send. |
|
| The first parameter of the command. |
|
| The second parameter of the command. |
|
| The third parameter of the command. |
|
| The fourth parameter of the command. |
|
| The fifth parameter of the command. |
|
| The sixth parameter of the command. |
|
| The seventh parameter of the command. |
|
| The cancellation token to cancel the command (optional). |
ICommandClient.SendCommandInt
Parameter | Type | Description |
|---|---|---|
|
| The scheduled action for the mission item. |
|
| The coordinate system of the COMMAND. |
|
| Not used (set false). |
|
| Autocontinue to next wp. |
|
| PARAM1, see MAV_CMD enum. |
|
| PARAM2, see MAV_CMD enum. |
|
| PARAM3, see MAV_CMD enum. |
|
| PARAM4, see MAV_CMD enum. |
|
| PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7. |
|
| PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7. |
|
| PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). |
|
| The cancellation token to cancel the command (optional). |
ICommandClient.CommandInt
Parameter | Type | Description |
|---|---|---|
|
| The scheduled action for the mission item. |
|
| The coordinate system of the COMMAND. |
|
| Not used (set false). |
|
| Autocontinue to next wp. |
|
| PARAM1, see MAV_CMD enum. |
|
| PARAM2, see MAV_CMD enum. |
|
| PARAM3, see MAV_CMD enum. |
|
| PARAM4, see MAV_CMD enum. |
|
| PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7. |
|
| PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7. |
|
| PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame). |
|
| The cancellation token to cancel the command (optional). |
CommandClientHelper
Method | Return Type | Description |
|---|---|---|
|
| Sends a command with long parameter to the vehicle and validates the result. |
|
| Executes a long-duration command with specified parameters and validates the result. |
|
| Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM. |
|
| Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM (generic version). |
|
| Request the target system(s) emit a single instance of a specified message (i.e. a "one-shot" version of MAV_CMD_SET_MESSAGE_INTERVAL). |
|
| Requests single message and waits for packet |
|
| Requests the autopilot version from the target system by sending a one-shot |
|
| Sets the flight mode of the target system using |
|
| Request the reboot or shutdown of system components using |
|
| Returns a human-readable description for an |
|
| Returns a human-readable description for a |
ICommandClient.CommandLongAndCheckResult (delegate overload)
Parameter | Type | Description |
|---|---|---|
|
| The command client. |
|
| Delegate to populate the |
|
| Optional cancel token argument. |
ICommandClient.CommandLongAndCheckResult (params overload)
Parameter | Type | Description |
|---|---|---|
|
| The command client. |
|
| The MAVLink command. |
|
| Command parameter 1. |
|
| Command parameter 2. |
|
| Command parameter 3. |
|
| Command parameter 4. |
|
| Command parameter 5. |
|
| Command parameter 6. |
|
| Command parameter 7. |
|
| Optional cancel token argument. |
ICommandClient.SetMessageInterval
Parameter | Type | Description |
|---|---|---|
|
| The command client. |
|
| The MAVLink message ID to configure. |
|
| Interval in microseconds between messages. |
|
| Optional cancel token argument. |
ICommandClient.RequestMessageOnce
Parameter | Type | Description |
|---|---|---|
|
| The MAVLink command client. |
|
| The MAVLink message ID to request. |
|
| Optional cancel token argument. |
ICommandClient.SetMessageInterval<TPacket>
Parameter | Type | Description |
|---|---|---|
|
| The command client. |
|
| Interval in microseconds between messages. |
|
| Optional cancel token argument. |
ICommandClient.RequestMessageOnce<TPacket>
Parameter | Type | Description |
|---|---|---|
|
| The command client. |
|
| Optional cancel token argument. |
ICommandClient.GetAutopilotVersion
Parameter | Type | Description |
|---|---|---|
|
| The command client. |
|
| Optional cancel token argument. |
ICommandClient.DoSetMode
Parameter | Type | Description |
|---|---|---|
|
| The command client. |
|
| The base mode bitmask. |
|
| Autopilot-specific custom mode. |
|
| Autopilot-specific custom sub-mode. |
|
| Optional cancel token argument. |
ICommandClient.PreflightRebootShutdown
Parameter | Type | Description |
|---|---|---|
|
| The command client. |
|
| Reboot/shutdown action for the autopilot. |
|
| Reboot/shutdown action for the companion computer. |
|
| Optional cancel token argument. |
CompanionRebootShutdown.GetAutopilotRebootShutdownDescription
Parameter | Type | Description |
|---|---|---|
|
| The autopilot reboot/shutdown action. |
CompanionRebootShutdown.GetCompanionRebootShutdownDescription
Parameter | Type | Description |
|---|---|---|
|
| The companion computer reboot/shutdown action. |
CommandException
Represents an exception that is thrown when a MAVLink command execution results in a non-success acknowledgment. Contains the CommandAckPayload detailing the result of the command.
Constructor | Description |
|---|---|
| Initializes a new instance of the |
Property | Type | Description |
|---|---|---|
|
| Gets the command acknowledgment payload returned by the device. |
Method | Return Type | Description |
|---|---|---|
|
| Builds a human-readable error message from a |
CommandException.GetMessage
Parameter | Type | Description |
|---|---|---|
|
| The acknowledgment payload to format. |