🧪 New tutorials are being published — build from robot arms to sensors step by step
Skip to content

Embodied AI Intro (LeRobot)

For developers doing robot learning for the first time. Using HuggingFace LeRobot + Juxi Technology SO-ARM101 as the example: collect → train → evaluate full pipeline.

1. What is Embodied AI?

Embodied AI lets agents interact with the physical world through body sensors. Imitation learning is a core path: human teleoperation demonstrations → data collection → policy training → robot reproduces actions.

Why it matters: traditional programming can't cover complex manipulation (screwing, folding clothes), but imitation learning only needs "demonstrate + train".

2. Hardware Setup

ComponentRecommendedNotes
Robot armSO-ARM101 (leader + follower)Dual-arm teleoperation, 6 DOF
ComputeJetson Orin NX Super / 4090 hostTrain on big compute, infer on Jetson
VisionRealSense / USB cameraEnvironment capture during teleop

3. Environment Setup

bash
git clone https://github.com/Juxi-Technology/lerobot.git
cd lerobot
pip install -e ".[feetech]"        # SO-ARM uses feetech servos

# Jetson users: verify PyTorch first
python3 -c "import torch; print(torch.cuda.is_available())"

4. Data Collection (Teleoperation)

bash
# Calibrate (first time)
lerobot-calibrate \
  --robot.type=so101_follower --robot.port=/dev/ttyACM0 --robot.id=my_arm

# Record data
lerobot-record \
  --robot.type=so101_follower --robot.port=/dev/ttyACM0 \
  --teleop.type=so101_leader --teleop.port=/dev/ttyACM1 \
  --dataset.repo_id=juxi/pick_cube \
  --dataset.num_episodes=50 \
  --dataset.single_task="Pick the red cube" \
  --dataset.episode_time_s=30

Collection tips:

  • ≥50 episodes per task, vary positions/techniques
  • Keep cameras fixed and objects visible
  • Consistent demo style (same demonstrator)

5. Training

bash
# ACT policy (beginner-friendly)
lerobot-train \
  --dataset.repo_id=juxi/pick_cube \
  --policy.type=act \
  --output_dir=outputs/train/act_pick \
  --steps=300000 \
  --policy.device=cuda

Policy selection:

PolicyStrengthsBest For
ACTStable, data-efficientEntry point, fine manipulation
DiffusionRobust multi-modal actionsHigh-frequency precise tasks
Pi0 / GR00TStrong generalizationMulti-task, cross-object

6. Evaluation

bash
# Replay dataset (data quality check)
lerobot-dataset-viz --repo-id juxi/pick_cube

# Evaluate policy
lerobot-record \
  --robot.type=so101_follower --robot.port=/dev/ttyACM0 \
  --policy.path=outputs/train/act_pick/checkpoints/last/pretrained_model \
  --dataset.repo_id=juxi/eval_pick \
  --policy.device=cuda
MetricDescription
Success rateTask completion ratio
Trajectory smoothnessJitter level
GeneralizationWorks with different objects/positions?

7. FAQ

Q: Training is slow?

A: Data size, steps, and compute scale together; start with 50 episodes / 100k steps to validate the pipeline.

Q: Policy only does one action?

A: Single-task training needs multi-task datasets; GR00T/Pi0 foundation models can be fine-tuned with small data to multi-task.

Q: Jerky actions after training?

A: Check data quality (stable demos), add smoothing, lower the control frequency.

Q: Out of memory?

A: Reduce batch_size, lower image resolution, use the 16GB Jetson model.


Support