AUTHOR: Kevin Thomas
CREATION DATE: January 11, 2026
UPDATE DATE: February 28, 2026
Train a robot brain from zero to 100% success in 60 seconds flat — no hardware, pure NumPy, pure magic. Built on HuggingFace LeRobot standards.
python3 -m venv .venv && source .venv/bin/activate
pip install ".[dev]"python run_sim.py --task pusht --mode trainCollects demo episodes with a scripted expert, trains an MLP via behaviour-cloning (Adam optimiser), then evaluates. Saves best_policy.npz (lowest loss) and last_policy.npz to --output-dir.
Available tasks: pusht, pick_place, reach
| Flag | Default | Description |
|---|---|---|
--demo-episodes |
20 | Expert demo episodes to collect |
--train-steps |
3000 | Behaviour-cloning gradient steps |
--eval-episodes |
5 | Evaluation rollouts after training |
--hidden-dim |
256 | MLP hidden layer width |
--output-dir |
./sim_output |
Where to save models and data |
--seed |
42 | Random seed |
python run_sim.py --task pusht --mode evalLoads best_policy.npz from --output-dir and runs evaluation episodes. Requires --mode train first.
python run_sim.py --task reach --mode teleopDrive the arm with WASD / arrow keys and record demonstrations.
python run_sim.py --task pick_place --mode visualizePyGame live rendering of a random policy.
| Task | DOF | Action | Observation |
|---|---|---|---|
pusht |
2-D | (dx, dy) | 6-D state (agent + block + target) + optional RGB |
pick_place |
3-D | 6 joint vels + 1 gripper | 13-D state + optional 384x384 RGB |
reach |
3-D | 6 joint vels | 9-D state + optional 384x384 RGB |
run_sim.py CLI entry point
lerobot_sim/
envs/ Gymnasium environments + factory + configs
policies/ BasePolicy, RandomPolicy, Expert policies, MLPPolicy, Trainer
datasets/ Episode recording + HF Hub loader
robots/ 6-DOF simulated arm (SO-100 style)
teleop/ Keyboard and gamepad input
visualization/ PyGame renderer + HUD + replay
utils/ Constants + helpers
Observations use observation.state / observation.image keys. The factory returns {suite: {task_id: VectorEnv}} matching lerobot.envs.factory.make_env. Datasets are NumPy archives convertible to Parquet + MP4 for Hub upload.
This project includes an env.py at the root so it can be loaded directly via LeRobot EnvHub:
from lerobot.envs.factory import make_env
envs = make_env("your-user/lerobot-sim", trust_remote_code=True)- LeRobot Robot Learning Tutorial — free hands-on course covering teleoperation, dataset recording, policy training, and inference
- LeRobot Documentation — full API docs, installation, and hardware guides
- LeRobot GitHub — upstream source code
The lerobot-policy-deployment-app/ folder contains a complete Arduino App Lab application that deploys the trained MLP policy to an Arduino UNO Q. Enter state observations through a web interface, and the board drives servos in real time using the NumPy forward pass while displaying episode status on the 8 x 13 LED matrix. See lerobot-policy-deployment-app/README.md for full details.
Kevin Thomas
- Creation Date: January 11, 2026
- Last Updated: February 28, 2026
Apache 2.0