Inspect a VLA action chunk
Check action shape, timing, and limits before handing predictions to a controller.
Opening the Python editor…
Requirements and learning goals
Before you start
- Python 3
- Understand VLA inputs and outputs
You will be able to
- Calculate a chunk's time horizon
- Reject malformed and out-of-range action samples
The browser exercise above works without extra setup. The project brief below assumes the listed prerequisites and gives you a task and checks to perform. Need a guided first project?
Why predict several steps?
An is a sequence of predicted future actions. It lets a supply several control steps per call. A longer sequence can keep the controller supplied while inference runs, but executing all of it without checking new observations can miss a changed scene.
If a chunk has 10 steps at 20 steps per second, it covers 0.5 seconds. The execution frequency comes from the policy and robot configuration; do not infer it from how fast a model responds.
Record proposed actions and their source timestamps through application streams before enabling actuation, so you can inspect rejected and stale chunks.
Try a small contract check
This synthetic example represents two joint targets in radians. It does not run a model or control a robot. Save it as check_chunk.py:
import math
limits = [(-1.0, 1.0), (-0.5, 0.5)]
chunk = [[0.10, 0.20], [0.12, 0.18], [0.14, 0.16]]
hz = 20
def valid(rows):
return bool(rows) and all(
len(row) == len(limits) and all(
math.isfinite(value) and low <= value <= high
for value, (low, high) in zip(row, limits)
)
for row in rows
)
assert valid(chunk)
assert not valid([[0.1]])
assert not valid([[float("nan"), 0.2]])
assert not valid([[1.5, 0.2]])
print(f"Valid chunk: {len(chunk) / hz:.2f} seconds")Run python3 check_chunk.py. Expect Valid chunk: 0.15 seconds. Change a joint target beyond its limit and confirm rejection.
What this check does not prove
Values inside joint limits can still collide or move too quickly. Real integration also needs the checkpoint's normalization rules, joint order, coordinate conventions, and controller-specific limits. Validate input types before applying this numerical check to external data.
Tag predictions with the source observation and request ID. A new request or cancellation must invalidate queued actions from the old request. Returning a fresh prediction does not make its source image fresh.
Optional extension
Using a compatible simulator and task-adapted checkpoint, compare success and inference delay across fixed starting scenes. Keep the same scenes for a scripted baseline. A chunk passing validation is not evidence that the task succeeded.
The LeRobot policy implementation shows action queues; the control-loop lesson covers stale observations and cancellation.
Before you move on
Can you do each of these?
- Calculate a chunk's time horizon
- Reject malformed and out-of-range action samples
0 of 2 checkpoints solved. Try checkpoint 1
All lessons in this topic
- 1. Run a VLM on a live camera
- 2. Understand vision-language-action models
- 3. Inspect a VLA action chunk
- 4. Ground a request in supported robot skills
- 5. Connect perception to action without blocking control
- 6. Record the evidence around a failed action
- 7. Compare a learned approach with a scripted baseline