# Module 1.6: End-to-End Pick and Place Loop

- Course: [Course 1: Frames, Transform Networks & Intro to Kinematics](https://roboticsconcepts.dev/courses/frames-transform-networks-kinematics.md)
- HTML Page: https://roboticsconcepts.dev/courses/frames-transform-networks-kinematics/end-to-end-pick-and-place-loop/
- Key Concepts: Camera-to-gripper transform chain, IK planning & FK verification, Frame choices in learned policies

Every piece we've built in Course 1 — degrees of freedom, local frames, TF trees, forward kinematics, and inverse kinematics — comes together in the simplest real manipulation task: spotting an object with a camera, picking it up, and placing it somewhere new.

## Walking the five-stage tabletop loop

Suppose an overhead camera spots an orange block on a lab table. The detector gives pixels or coordinates in the camera's local frame — say, 1.2 m below the lens and 7 cm to the left. Before the robot arm can move, it has to translate that detection through the TF tree into its own shoulder base frame.

From there, IK finds the joint angles needed to reach the block, FK double-checks that those angles actually land within a millimeter of the target without hitting joint limits, the gripper closes, and a second IK call routes the block to the drop zone.

## Interactive Sandbox: End-to-End Pick-and-Place Loop & Policy Frames

Slide the block along the table, then click Next Stage step-by-step from Camera Detect all the way to Place at Drop. Afterward, toggle the three Policy Frame options to compare how classical and learned systems use these exact same frames.

## Where classical pipelines meet modern robot learning

You might wonder: if you train a neural policy or Vision-Language-Action (VLA) model end-to-end, do coordinate frames stop mattering? Quite the opposite. One of the biggest design choices in modern robot learning is picking the policy's observation and action frame.

Predicting raw joint angles is fast and simple, but tied to one specific robot setup. Predicting end-effector deltas in the base frame lets you reuse an IK/PD controller underneath. Predicting actions relative to a wrist camera frame helps the policy generalize when the table height or robot placement changes.

## The complete perception-to-action transform chain

```text
p_base = T_base←world · T_world←camera · p_camera   →   q* = IK(p_base)   →   verify FK(q*) ≈ p_base
```

Perception lives in sensor frames, kinematics lives in joint space, and TF trees are the bridge that keeps them talking in the same units.

## Check Your Intuition

**Question:** If you slide the entire workbench 30 cm to the right in the lab without recalibrating the room-to-base transform, which policy representation adapts best using only wrist-camera images?

- [ ] Absolute joint angles memorized from the old table position
- [ ] World-frame (x, y) target coordinates
- [✓] Camera-relative end-effector deltas

**Explanation:** Because camera-relative deltas express motion relative to what the wrist camera currently sees, shifting the table in the room doesn't break the local geometry.

## Where You'll See This in Modern Robotics

Next up in Course 2, we scale from single planar arms to full multi-branched robots described in URDF/MJCF and move from static poses to instantaneous velocities and Jacobians.

## Companion Python Notebook: 06 · End-to-End Tabletop Pick-and-Place Loop

Chain camera detection, TF tree lookup, IK solving, and FK verification in Python, and test what happens when the workbench shifts.

- Open in molab (WASM): https://molab.marimo.io/github/alchemicduncan/robotics-concepts-dev/blob/main/notebooks/course-1/06_end_to_end_pick_and_place.py/wasm
- Open in Google Colab: https://colab.research.google.com/github/alchemicduncan/robotics-concepts-dev/blob/main/notebooks/colab/course-1/06_end_to_end_pick_and_place.ipynb
- Download .py: https://roboticsconcepts.dev/downloads/notebooks/course-1/06_end_to_end_pick_and_place.py
- Download .ipynb: https://roboticsconcepts.dev/downloads/notebooks/colab/course-1/06_end_to_end_pick_and_place.ipynb
- Run locally: `uvx marimo edit --sandbox notebooks/course-1/06_end_to_end_pick_and_place.py`
