control_service
service Control
Used for low-level control of a vehicle.
This service is hosted by the driver module and represents the global
control interface for the vehicle. Most methods called here will result
in actuation of the vehicle if it is armed (be careful!). Some methods,
like TakeOff, may take some time to complete. For this reason, it is
not advisable to set a timeout/deadline on the RPC call. However, to
ensure that the service is progressing, a client can either check
telemetry or listen for IN_PROGRESS response heartbeats which are
streamed back from the RPC while executing an operation.
rpc Connect
Connect to the vehicle.
Connects to the underlying vehicle hardware. Generally, this method is called by the law authority on startup and is not called by user code.
Accepts
ConnectRequest
Returns
Response
rpc Disconnect
Disconnect from the vehicle.
Disconnects from the underlying vehicle hardware. Generally, this method is called by the law authority when it attempts a driver restart and is not called by user code.
Accepts
DisconnectRequest
Returns
Response
rpc Arm
Order the vehicle to arm.
Arms the vehicle. This is required before any other commands
are run, otherwise the methods will return FAILED_PRECONDITION.
Once the vehicle is armed, all subsequent actuation methods
will move the vehicle. Make sure to go over the manufacturer
recommended vehicle-specific pre-operation checklist before arming.
Accepts
ArmRequest
Returns
Response
rpc Disarm
Order the vehicle to disarm.
Disarms the vehicle. Prevents any further actuation methods from executing, unless the vehicle is re-armed.
Accepts
DisarmRequest
Returns
Response
rpc Joystick
Send a joystick command to the vehicle.
Causes the vehicle to accelerate towards a provided velocity setpoint over a provided duration. This is useful for fine-grained control based on streamed datasink results or for tele-operating the vehicle from a remote commander.
Accepts
JoystickRequest
Returns
Response
rpc TakeOff
Order the vehicle to take off.
Causes the vehicle to take off to a specified take off altitude. If the vehicle is not a UAV, this method will be unimplemented.
Accepts
TakeOffRequest
Returns
Response
rpc Land
Order the vehicle to land.
Causes the vehicle to land at its current location. If the vehicle is not a UAV, this method will be unimplemented.
Accepts
LandRequest
Returns
Response
rpc Hold
Order the vehicle to hold/loiter.
Causes the vehicle to hold at its current location and to
cancel any ongoing movement commands (ReturnToHome e.g.).
Accepts
HoldRequest
Returns
Response
rpc Kill
Orders an emergency shutdown of the vehicle motors.
Causes the vehicle to immediately turn off its motors. If the vehicle is a UAV, this will result in a freefall. Use this method only in emergency situations.
Accepts
KillRequest
Returns
Response
rpc SetHome
Set the home location of the vehicle.
Changes the home location of the vehicle. Future ReturnToHome
commands will move the vehicle to the provided location instead
of its starting position.
Accepts
SetHomeRequest
Returns
Response
rpc ReturnToHome
Order the vehicle to return to its home position.
Causes the vehicle to return to its home position. If the home position
has not been explicitly set, this will be its start position (defined
as its takeoff position for UAVs). If the home position has been
explicitly set, by SetHome, the vehicle will return to that
position instead.
Accepts
ReturnToHomeRequest
Returns
Response
rpc SetGlobalPosition
Order the vehicle to move to a global position.
Causes the vehicle to transit to the provided global position. The vehicle
will interpret the heading of travel according to heading_mode:
TO_TARGET-> turn to face the target position bearingHEADING_START-> turn to face the provided heading in the global position object.
This will be the heading the vehicle maintains for the duration of transit.
Generally only UAVs will support HEADING_START.
The vehicle will move towards the target at the specified maximum velocity
until the vehicle has reached its destination. Error tolerance is determined
by the driver. Maximum velocity is interpreted from max_velocity as follows:
x_vel-> maximum horizontal velocityy_vel-> ignoredz_vel-> maximum vertical velocity (UAV only)
If no maximum velocity is provided, the driver will use a preset speed usually determined by the manufacturer or hardware settings.
(UAV only) During motion, the vehicle will also ascend or descend towards the
target altitude, linearly interpolating this movement over the duration of
travel. The vehicle will interpret altitude from altitude_mode as follows:
ABSOLUTE-> altitude is relative to MSL (Mean Sea Level)RELATIVE-> altitude is relative to take off position
Accepts
SetGlobalPositionRequest
Returns
Response
rpc SetRelativePosition
Order the vehicle to move to a relative position.
Causes the vehicle to transit to the provided relative position. The vehicle
will interpret the input position according to frame as follows:
BODY-> (x,y,z) = (forward offset, right offset, up offset) from current positionNEU-> (x,y,z) = (north offset, east offset, up offset) from start position
The vehicle will move towards the target at the specified maximum velocity
until the vehicle has reached its destination. Error tolerance is determined
by the driver. Maximum velocity is interpreted from max_velocity as follows:
x_vel-> maximum horizontal velocityy_vel-> ignoredz_vel-> maximum vertical velocity (UAV only)
If no maximum velocity is provided, the driver will use a preset speed usually determined by the manufacturer or hardware settings.
Accepts
SetRelativePositionRequest
Returns
Response
rpc SetVelocity
Order the vehicle to accelerate to a velocity.
Causes the vehicle to accelerate until it reaches a provided velocity.
Error tolerance is determined by the driver. The vehicle will interpret
the input velocity according to frame as follows:
BODY-> (x_vel,y_vel,z_vel) = (forward velocity, right velocity, up velocity)NEU-> (x_vel,y_vel,z_vel) = (north velocity, east velocity, up velocity)
Accepts
SetVelocityRequest
Returns
Response
rpc SetHeading
Order the vehicle to set a new heading.
Causes the vehicle to turn to face the provided global position. The vehicle
will interpret the final heading according to heading_mode:
TO_TARGET-> turn to face the target position bearingHEADING_START-> turn to face the provided heading in the global position object.
Accepts
SetHeadingRequest
Returns
Response
rpc SetGimbalPose
Order the vehicle to set the pose of a gimbal.
Causes the vehicle to actuate a gimbal to a new pose. The vehicle
will interpret the new pose type from pose_mode as follows:
ABSOLUTE-> absolute angleRELATIVE-> angle relative to current positionVELOCITY-> angular velocities
The vehicle will interpret the new pose angles according to frame
as follows:
BODY-> (pitch,roll,yaw) = (body pitch, body roll, body yaw)NEU-> (pitch,roll,yaw) = (body pitch, body roll, global yaw)
Accepts
SetGimbalPoseRequest
Returns
Response
rpc ConfigureImagingSensorStream
Configure the vehicle imaging stream.
Sets which imaging sensors are streaming and sets their target frame rates.
Accepts
ConfigureImagingSensorStreamRequest
Returns
Response
rpc ConfigureTelemetryStream
Configure the vehicle telemetry stream.
Sets the frequency of the telemetry stream.
Accepts
ConfigureTelemetryStreamRequest
Returns
Response
enum AltitudeMode
Altitude mode switch.
Fields
field ABSOLUTE (0)
field RELATIVE (1)
enum HeadingMode
Heading mode switch.
Fields
field TO_TARGET (0)
field HEADING_START (1)
enum ReferenceFrame
Reference frame mode switch.
Fields
field BODY (0)
field NEU (1)
enum PoseMode
Pose mode switch.
Fields
field ANGLE (0)
field OFFSET (1)
field VELOCITY (2)
message ConnectRequest
Fields
field request (Request)
message DisconnectRequest
Fields
field request (Request)
message ArmRequest
Fields
field request (Request)
message DisarmRequest
Fields
field request (Request)
message JoystickRequest
Fields
field request (Request)
field velocity (Velocity)
field duration (/google/protobuf/Duration)
message TakeOffRequest
Fields
field request (Request)
field take_off_altitude (float)
message LandRequest
Fields
field request (Request)
message HoldRequest
Fields
field request (Request)
message KillRequest
Fields
field request (Request)
message SetHomeRequest
Fields
field request (Request)
field location (Location)
message ReturnToHomeRequest
Fields
field request (Request)
message SetGlobalPositionRequest
Fields
field request (Request)
field location (Location)
field heading_mode (HeadingMode) TO_TARGET)
field altitude_mode (AltitudeMode) ABSOLUTE)
field max_velocity (Velocity)
message SetRelativePositionRequest
Fields
field request (Request)
field position (Position)
field max_velocity (Velocity)
field frame (ReferenceFrame)
message SetVelocityRequest
Fields
field request (Request)
field velocity (Velocity)
field frame (ReferenceFrame)
message SetHeadingRequest
Fields
field request (Request)
field location (Location)
field heading_mode (HeadingMode)
message SetGimbalPoseRequest
Fields
field request (Request)
field gimbal_id (uint32)
field pose (Pose)
field pose_mode (PoseMode)
field frame (ReferenceFrame)
message ImagingSensorConfiguration
Configuration for an imaging sensor.
Fields
field id (uint32)
field set_primary (bool)
field set_fps (uint32)
message ConfigureImagingSensorStreamRequest
Fields
field request (Request)
field configurations (ImagingSensorConfiguration)
message ConfigureTelemetryStreamRequest
Fields
field request (Request)
field frequency (uint32)