Your inputs and answers
A policy’s inputs and answers are its own. infer gets what the caller sent, unchanged unless it annotates it torch.Tensor, and what
it returns goes back as it is, a torch tensor as a numpy array; the platform checks nothing. When your code raises, the caller
gets your error with your traceback (Your own inputs and outputs). On a robot,
your loop plays what it returns (your own loop); a template’s
client.py builds its inputs and turns its rows into your controller’s commands.
Chunks and control rate
An answer is usually a chunk: a block of future rows, so the robot needs no round trip per step. How it plays is
the policy’s to declare, on @seq.policy:
| declared | what it says |
|---|---|
hz | required: the steps a second its rows play at (the policy’s rate, never the robot’s) |
action_chunk_valid_len | how many rows of one answer are valid; the rest are never played |
action_chunk_replan_at | the step, counted from when its act is sent, at which the robot asks for the next answer (unset: the last valid step); the valid rows after it play while the next answer comes |
Your loop plays the rows at the policy’s rate on its own clock (each row at its own time point, so a
late row is never made up by firing the next ones in a burst) and asks for the next answer while the
current one plays, at the replan step counted from when it sent the act; an answer that arrives after the last
valid row has played leaves the arm with nothing to play until it comes (your own
loop). A policy’s action_chunk_valid_len and action_chunk_replan_at change
with seq policy set, no new deploy (how).
How much to send each act
Every observation goes up before the act that reads it, so what you send is part of every answer’s wait. A
larger body takes more round trips to upload and arrives later, and past the rows it has left the arm runs out and
holds. Send what the policy reads, and nothing more: nothing knows which of your keys the policy uses, so a dict
carrying more is uploaded whole every time. A camera frame wrapped in sequence_ai.Video travels
compressed, as video (observe() and act()).
sequence-ai says so once a session when an observation is past
1 MB (a Python UserWarning at your own line); it goes as it is either way:
my_robot_user.py:42: UserWarning: my_toy_user: an observation sent 3.0 MB, past 1.0 MB - to send camera frames smaller, wrap each in sequence_ai.Video, which sends them as compressed video