Control client
To control a device from a client, request the IControlClient from the device instance. Implementations of this interface typically delegate control operations to existing MAVLink microservices.
The Control microservice is only available for supported vehicle types and will be registered automatically when a matching implementation exists.
You can get the control client from a device:
Basic usage:
IControlClient (source)
Represents a client that can control a vehicle.
Method | Return Type | Description |
---|---|---|
|
| Returns true if the vehicle is currently in Auto mode. |
|
| Switches the vehicle to Auto mode. |
|
| Returns true if the vehicle is in Guided mode. |
|
| Switches the vehicle to Guided mode. |
|
| Sets a navigation target to the given point. |
|
| Initiates the landing sequence. |
|
| Performs a return to launch operation asynchronously. |
|
| Initiates the takeoff process and ascends to the specified altitude in meters. |
Parameters:
GeoPoint
represents a location on Earth using WGS 84 coordinates. It consists of latitude, longitude, and altitude in meters.
The CancellationToken
parameter allows cancelling the operation before it completes, for example if the navigation or takeoff should be aborted.
Implementations
Different vehicle types have their own implementations of IControlClient
:
ArduCopterControlClient — commands mapped to mode, position and heartbeat microservices.
ArduPlaneControlClient and ArduQuadPlaneControlClient — similar but adapted for planes.