Send manual control frames
You can now drive an asset in real time while it executes a manual control task. The new
SendManualControlFrame API, available in
preview, sends a single frame of control input, such as a joystick
movement, for a task in STATUS_EXECUTING. Call it repeatedly as the operator’s input changes. Lattice forwards each
frame to the agent executing the task, which receives it through
StreamManualControlFrames.
Manage the control session
Your client owns the control session. Each frame carries the following fields:
sessionEpochMicros: A Unix timestamp in microseconds that identifies the session. Generate it once when you take control, and send the same value with every frame.sequence: The frame’s position in the session. Increase it with each frame so the agent can detect out-of-order delivery, and reset it to 1 when you start a new session.specification: The control instructions, as agoogle.protobuf.Anyin a format specific to the task. Lattice passes it to the agent without inspecting it.
A frame with a higher epoch replaces the current session, which lets another operator take over control. Lattice
rejects frames with a lower epoch as stale with an HTTP 409 Conflict, which the SDKs surface as a ConflictError.
Agents receive the epoch and sequence on each ManualControlFrame, so they can ignore frames from a stale session.
Send a frame
The following example starts a control session and sends its first frame:
Over gRPC, call the
SendManualControlFrame
RPC with the same fields. It rejects a stale epoch with an ABORTED error.
To get started, install the SDK for REST. The API is available
starting in Python 5.4.0, Go v5.4.0, Java 6.4.0, TypeScript 5.4.0, and Rust 2.5.0.