Physical AI · Lab 09
Don't Trust Your Actions
Your robot says SUCCESS. But did it actually grasp the object?
Your robot's grasp command reports SUCCESS, but sometimes the object is still on the table. Build independent postcondition verification and recovery instead of blindly trusting action status.
The core lesson: a SUCCESS return doesn't necessarily mean the world changed.
Stages
Robot API
solve(robot) is your agent. Pick up "red_box" and place it in "target". Plain Python plus import math; 60 actions per episode.
robot.observe()- Returns a noisy snapshot, not the truth. Also tells
move()where things are. robot.move(target)- Goes to
"red_box"(where the robot last saw it),"target"(from the map) or"home". robot.grasp(object_id)- Closes the gripper. Returns
{"status": "SUCCESS"}when the command executed. That does not mean the object is in the gripper. robot.place(target)- Opens the gripper over the target. SUCCESS again means only that the command ran.
What observe() returns
{
"timestamp": 7,
"robot": {"pose": {"x": 1.42, "y": 1.30, "theta": 0.12}},
"gripper": {"x": 1.77, "y": 1.34, "width_mm": 45.8,
"contact": True, "confidence": 0.93},
"detections": [
{"id": "red_box", "type": "box", "x": 1.78, "y": 1.33,
"z": 0.12, "confidence": 0.91}, ...],
"camera": {"ok": True},
"map": {"target": {"x0": 3.7, "y0": 0.9, "x1": 4.5, "y1": 1.7}}
}
- Gripper width: about 46 mm when it holds the red box, about 2 mm when it closed on nothing, 85 mm when open. Noisy, and jammed fingers can mislead it (watch its confidence).
- Wrist camera:
zis the height above the table. A real grasp lifts the box about 0.12 m. Detections can be missing, low-confidence or wrong. - The two sensors fail in different ways. Neither is ground truth.
Key ideas
Action status vs world state
A controller can finish its routine perfectly while the world ends up different from what it intended. Status describes the command; observations describe the world.
Preconditions and postconditions
Before an action: is the robot ready? After it: does the world look the way the action promised? Checking postconditions with sensors is how robots catch silent failures.
Evidence from imperfect sensors
Combine independent signals, weigh them by confidence, and look again when they disagree or might change.
Loading
Action timeline
- Run the agent to see its actions.
Ctrl+Enter runs the selected seed, Shift+Ctrl+Enter runs all practice seeds.
Hints
Stuck?