# Module 6.5: Sim-to-Real Transfer and Vision-Language-Action (VLA) Systems

- Course: [Course 6: Modern Robot Learning & Embodied AI](https://roboticsconcepts.dev/courses/modern-robot-learning-embodied-ai.md)
- HTML Page: https://roboticsconcepts.dev/courses/modern-robot-learning-embodied-ai/sim-to-real-transfer-and-vla-systems/
- Key Concepts: Domain randomization (friction, mass, latency), Sim-to-real reality gap, Hierarchical VLA meta-controllers

Every simulator is a polite fiction. Floors in simulation have crisp Coulomb friction, links weigh exactly what the CAD file says, and observations arrive with zero delay. Unbox a real robot on dusty tile with a heavier mug and 35 milliseconds of USB camera lag, and a brittle policy trained in one idealized simulator falls apart on its first step.

## Closing the reality gap with Domain Randomization

If we can't model every loose belt, slick floorboard, and cable snag to perfection, we can do the next best thing: train the policy across a wide range of imperfectly modeled worlds. On every simulated episode, Domain Randomization (DR) scrambles physical parameters — floor friction, link and payload masses, actuator stiffness, sensor noise, and control latency.

Crucially, if you pair DR with a short observation history (or recurrent memory), the policy doesn't just become conservatively sluggish. By watching how the robot actually responds over the last half-second of commands, it implicitly infers whether the floor is icy or the payload is heavy and adjusts its push online.

## Hierarchical Vision-Language-Action (VLA) systems

Once low-level motor skills transfer cleanly to hardware, the remaining piece is general reasoning: understanding an instruction like 'put the ceramic bowl next to the sink after wiping the spill' and adapting to objects the robot has never seen in your lab.

This is where Vision-Language-Action (VLA) models fit into the stack. Built atop pretrained vision-language backbones, a VLA fuses camera images and natural language prompts into robot actions. On real machines, VLAs increasingly run as hierarchical meta-controllers: a heavier vision-language backbone reasons at a few hertz and emits semantic subgoals or short action chunks, while a fast motor head (50+ Hz) and classical safety filters execute smooth contact-rich motion underneath.

## Interactive Sandbox: Sim-to-Real Domain Randomization & Friction Mismatch Explorer

Perturb Floor friction, Payload mass, and Control latency in the Sim-to-Real Mismatch Explorer below. Toggle between the Nominal Policy and the Domain-Randomized Policy to see how unmodeled lag and heavy payloads pull a nominal controller off course.

## Putting the whole curriculum together

Look closely at what happens in the explorer when you raise Control latency toward 40–60 ms or drop Floor friction down to 0.4x: the nominal policy begins slipping and ringing around the target curve because its feedback gains assume instant response and ideal traction. Meanwhile, the domain-randomized policy trims peak accelerations, adapts for sag, and preserves high success rates across the sweep.

Across Courses 1 through 6, the big lesson is that modern embodied AI didn't replace classical robotics — it sits right on top of it. Frames, Jacobians, state estimation, planning, PD control, and learned policies all reinforce each other inside every capable machine working in the real world.

## Domain-randomized policy objective across physics distribution p(ξ)

```text
max_θ  𝔼_{ξ ~ p(ξ)} [ ∑_t γᵗ r(s_t, a_t; ξ) ] ,   ξ = (μ_friction, m_payload, τ_latency, ...)
```

Maximizing expected return across a distribution of physical parameters ξ forces the policy to stay robust and infer hidden dynamics from observation history.

## Check Your Intuition

**Question:** Your walking policy succeeds 100% in simulation, yet on real hardware the legs oscillate wildly and fall over within two seconds. Checking logs, you find the real camera-to-motor loop has 35 ms of unmodeled delay. What is the cleanest fix?

- [ ] Remove the IMU sensor so fewer numbers enter the network
- [✓] Add randomized observation/action latency buffers (e.g., 0–50 ms) during simulated training via domain randomization
- [ ] Lower the simulator physics timestep to 1 Hz

**Explanation:** Training with randomized communication and actuator latency forces the policy to account for delayed feedback instead of relying on zero-delay simulator timing.

## Where You'll See This in Modern Robotics

Contemporary generalist systems (like π₀, GR00T, and OpenVLA derivatives) pair internet-scale VLM pretraining with fast flow-matching or diffusion action heads, bridging high-level language grounding with 50 Hz physical dexterity.

## Companion Python Notebook: 05 · Domain Randomization & Sim-to-Real Robustness

Compare nominal vs. domain-randomized policies across perturbed friction, payload mass, and control latency, plus a hierarchical VLA skill router.

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