Week 10: From Demonstrations to a First Policy
From Demonstrations to a First Policy: Closing the Imitation-Learning Loop
Week 10 — From Demonstrations to a First Policy: Closing the Imitation-Learning Loop
Internship: JdeRobot 2026 — Ahmed Algharib Package: vibe_version · Platform: UR5e MuJoCo twin · ROS 2 Jazzy · MoveIt 2 Scope of this week: make collection robot-centric and reliable, collect and audit a real dataset, train a first policy, and evaluate it honestly offline.
TL;DR
- Collector is now robot-centric and obstacle-aware: poses checked relative to
base_link, candidate targets screened against live obstacles, robot-centric observations and gripper labels recorded (relative_pick_place.py). - 24 successful demonstrations collected across seeds 73, 1, 2, 3, 91.
- Audit → train → offline-evaluate workflow built: data validated (shapes, finite values, success labels, collision-check metadata) before training.
- First full-action model trained: 19 train / 5 held-out; joint MSE improved 0.1312 → 0.0845.
- Error forensics: per-episode validation errors; raw vs wrapped angle comparison shows wraparound does not explain residual error.
- Engineering quality: build succeeds, 51/51 tests pass.
- Honest status: the model is an offline baseline only — no closed-loop rollout, no phase labels, no matched expert comparison yet.
1. Robot-Centric, Reliable Collection
- Poses are validated relative to
base_link, making episodes less dependent on world-frame shifts and base-pose changes. - Candidate target positions are screened against live obstacles before execution, rejecting infeasible candidates before motion.
- Recorded observations are robot-centric (joint state, velocities, end-effector and object poses in the robot frame) plus gripper/attach labels, giving the policy information relevant to the manipulation task.
- Active collector:
relative_pick_place.py.
2. Demonstration Collection
- 24 successful episodes across seeds 73, 1, 2, 3, 91.
- Transparency note: the seed-3 run stopped after 4 successful episodes; its remaining requested episodes were not completed. All audited batches contain valid, successful episodes only.
3. Dataset Audit → Training → Offline Evaluation Workflow
- Pre-training audit checks: array shapes, finiteness of all values, success-label consistency, and presence of collision-check metadata.
- Split: 19 training / 5 validation episodes.
- Full-action model (predicts the complete joint action vector) trained and evaluated offline.
- Headline metric: overall joint MSE 0.1312 (earlier 19-episode checkpoint) → 0.0845 (new audited split).
Comparison note: the two MSE values should be treated as results from different training/evaluation stages unless they were calculated using the same held-out episodes and evaluation procedure. A controlled comparison on an identical validation set is needed to establish a fair improvement.
4. Error Diagnostics
- Updated evaluator reports per-validation-episode joint errors, exposing which episodes contribute most to the loss.
- Raw vs wrapped angle comparison: wrapped errors are similar to raw errors, suggesting that angle wraparound does not explain the main residual error. The remaining error requires further investigation.
5. Engineering Quality
- Package builds cleanly; 51/51 tests pass (dataset schema, audit rules, recorder, evaluator).
6. What Is Not Done Yet (Honest Limitations)
- The model is an offline baseline: no learned-policy MuJoCo rollout has been demonstrated; it must not be used as a controller yet.
- Recordings lack task-phase labels (approach / grasp / transfer / place), so error attribution per phase is not currently possible.
- No matched-scenario comparison against the MoveIt expert has been completed (task success, placement error, cycle time).
7. Next Milestones
- Phase-aware diagnosis: label episode phases; report errors per phase to localize weaknesses.
- Bounded simulation rollout: limited-horizon closed-loop evaluation with safety guards and takeover criteria.
- Fair expert comparison: identical scenarios and metrics for the learned policy versus the classical MoveIt expert.
- State-of-the-art integration: use the literature review below to guide dataset design, policy architecture, and evaluation.
8. State-of-the-Art Literature Survey
This week included a targeted review of 2023–2026 literature on Imitation Learning (IL) for robotic manipulation, focusing on the use of algorithmic planners as expert demonstrators.
8.1 The Core Paradigm: Planner-Generated Demonstrations
A common workflow uses sampling-based planners, such as our OMPL RRT-Connect pipeline, to generate demonstrations for Behavioral Cloning (BC).
OPTIMUS (Wang et al., 2023) explores planner-generated demonstrations for manipulation tasks. Other recent work highlights an important challenge: sampling-based planners can produce different trajectories for the same task, depending on sampling and planning conditions. This variation can make the learning problem harder for a behavior-cloning model.
Action item: audit our 24-episode dataset for trajectory variation and consistency. Investigate trajectory filtering or smoothing only where it preserves valid task execution and does not remove important manipulation behavior.
8.2 Data Quality and Spatial Generalization
Modern IL research emphasizes both demonstration quality and diversity:
- Data quality: RoboMimic (Mandlekar et al., 2021) provides a widely used framework for studying imitation learning and demonstration datasets. Data filtering and consistent demonstrations are important considerations when building reliable policies. This supports our use of pre-training audits and the separation of successful demonstrations from failed planning attempts.
- Spatial generalization: object positions, target placements, and robot configurations are important dimensions of generalization. Our Week 9 spatial-variation study and robot-centric
base_linkrepresentation are relevant steps, but coordinate transformations alone do not guarantee generalization. The dataset must contain sufficient variation in the scenarios the policy is expected to handle.
8.3 Technical Implementation Considerations
- Robot-centric framing: representing object and target poses relative to the robot base can reduce dependence on arbitrary world-frame placement. Full homogeneous transformations are useful when converting poses between coordinate frames. However, this representation alone does not guarantee generalization to unseen workcell or robot-base configurations.
- Workspace constraints: the UR5e has a nominal maximum reach of approximately 0.85 m. This is not a universal usable-workspace boundary. Feasibility also depends on joint limits, end-effector orientation, collision geometry, and the robot’s configuration. Workspace and collision checks should therefore be based on the actual robot model and planning scene rather than a single radial limit.
9. References
- RoboMimic (Mandlekar et al., 2021): arXiv:2108.03298
- Zhu et al. — Planner demonstrations and BC entropy (2024): arXiv:2412.09743
- Lin et al. — Data scaling laws (2024/2026): arXiv:2410.18647
Saxena et al. — Large-scale datasets, ICLR 2025: arXiv:2506.13536 Project Page - Li et al. — IL Survey (2025): arXiv:2508.17449
- Tsuji et al. — Contact-rich survey (2025): arXiv:2506.13498
- Welte & Rayyes — Interactive IL (2025): Frontiers
- OPTIMUS (2023): arXiv:2305.16309
- Data quality in IL (2023): arXiv:2306.02437
- MimicGen (2023): arXiv:2310.17596
- DemoGen (2025): arXiv:2502.16932
Appendix — Reproduce
1
2
3
4
ros2 run vibe_version pick_place_relative --object yellow_box --episodes 5 --seed 73
python3 -m vibe_version.audit_dataset
python3 -m vibe_version.train --split 19 5
python3 -m vibe_version.evaluate --per-episode --wrap-check