Validate a robot goal with a dry-run adapter
Reject wrong frames and stale targets in Python, then plan hardware commissioning.
Opening the Python editor…
Requirements and learning goals
Before you start
- Python 3
- Pixel-to-world ray exercise; no robot required for the dry run
You will be able to
- Define the hardware boundary
- Validate freshness and frames
- Write a hardware commissioning plan
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?
A twin-derived target is a position estimated using camera observations and the twin's geometry. A hardware adapter translates that goal into the real robot's navigation interface. This lesson defines that boundary and tests it without motion, so the robot can reject a target whose coordinates or age it cannot trust.
Use remote ROS inspection to verify the physical robot's frames, message types, and fresh observations before reusing the simulated app.
Keep the pipeline explicit
The intended path is camera image, detection, calibrated world ray, accepted surface hit, reachable stand-off goal, robot controller. Each boundary needs a frame, timestamp, and failure behavior.
Wendy can deploy the application and inspect the robot's interfaces. It does not make a simulated calibration valid for a physical installation. The warehouse demo is simulation-only; physical transfer is integration work.
Build a dry-run adapter first
Save this as check_goal.py and run python3 check_goal.py. Expect (1.2, 0.8). Its age budget is illustrative and must come from your measured system requirements.
def accept_goal(goal, now):
if goal["frame"] != "warehouse":
raise ValueError("wrong frame")
age = now - goal["captured_at"]
if not 0 <= age <= 0.2:
raise ValueError("stale or future observation")
if not goal["route_clear"]:
raise ValueError("route not verified")
return goal["x"], goal["y"]
print(accept_goal(dict(frame="warehouse", captured_at=10.0,
route_clear=True, x=1.2, y=0.8), 10.1))Replace the print boundary with the robot's documented navigation interface only after verifying units, frame transforms, command mode, acknowledgements, and stop behavior. route_clear must come from fresh obstacle checks, not a hardcoded value.
Change captured_at to 9.0, then change frame to camera. Run each case separately and expect a ValueError. Restore the valid example afterward. You are done with the dry run when both invalid goals are rejected.
Optional extension: commission hardware
This extension requires a validated camera installation, the robot's SDK or ROS interface, and a supervised robot test area. The exercise above supplies none of those integrations.
First compare real camera estimates against surveyed targets with motors disabled. Next verify the robot's in the same world frame. Then test cancellation, stale observations, and connection loss through the adapter. Finally perform bounded supervised motion using the robot's prescribed commissioning procedure and physical stop.
Follow Wendy's sim-to-real interface checks. Record actual stopping distance and localization error. A successful upload or accepted goal is not arrival evidence.
Optional extension: move an obstacle after planning. The controller must recheck or stop rather than follow an obsolete twin route.
Before you move on
Can you do each of these?
- Define the hardware boundary
- Validate freshness and frames
- Write a hardware commissioning plan
0 of 2 checkpoints solved. Try checkpoint 1