Skip to content

Teaching AI robot arm to pick up gum using imitation learning with LeRobot and SO-ARM101

Notifications You must be signed in to change notification settings

CreatorKanata/gum-pickup-so-arm101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– SO-ARM101 Gum Pickup Task with LeRobot

Teaching AI Robot Arm SO-ARM101 to Pick Up Gum (Candy) Using Imitation Learning

Hugging Face Dataset Hugging Face Model WandB

๐ŸŽฌ Demo Videos

Run Inference

run-inference.mp4
Camera Views

camera-video.mp4

๐ŸŽฏ Overview

This repository demonstrates how to train an AI robot arm (SO-ARM101) to perform a gum pickup task using Hugging Face's LeRobot framework. The project covers the complete workflow from data collection through teleoperation to training and autonomous execution.

Key Features

  • ๐ŸŽฎ Teleoperation: Intuitive leader-follower configuration for demonstration recording
  • ๐Ÿ“น Multi-camera System: Dual camera setup with overhead and hand-view perspectives
  • ๐Ÿง  Imitation Learning: Training with ACT (Action Chunking with Transformers) policy
  • ๐Ÿ“Š Open Dataset: Publicly available dataset and model on Hugging Face Hub

๐Ÿ› ๏ธ System Requirements

Hardware

Software Environment

  • OS: Ubuntu 24.0
  • Kernel: Linux-6.14.0-27-generic-x86_64-with-glibc2.39
  • Python: 3.10
  • GPU: NVIDIA GeForce RTX 4070

System Layout

System Structure

Camera Views

Camera Visions

๐Ÿš€ Quick Start

1. Environment Setup

# Create a Conda environment for LeRobot
conda create -y -n lerobot python=3.10
conda activate lerobot

Reference: https://huggingface.co/docs/lerobot/installation

2. Robot Arm Calibration

Reference: https://huggingface.co/docs/lerobot/so101

Follower Arm (for execution)

python -m lerobot.calibrate \
  --robot.type=so101_follower \
  --robot.port=/dev/tty.usbserial_lerobot_follower \
  --robot.id=lerobot_follower_arm

Leader Arm (for teleoperation)

python -m lerobot.calibrate \
  --teleop.type=so101_leader \
  --teleop.port=/dev/tty.usbserial_lerobot_leader \
  --teleop.id=lerobot_leader_arm

Test Teleoperation

python -m lerobot.teleoperate \
  --robot.type=so101_follower \
  --robot.port=/dev/tty.usbserial_lerobot_follower \
  --robot.id=lerobot_follower_arm \
  --teleop.type=so101_leader \
  --teleop.port=/dev/tty.usbserial_lerobot_leader \
  --teleop.id=lerobot_leader_arm

3. Data Collection

Record a dataset

python kanata_record.py
  • Number of episodes: 10
  • Episode duration: 20 seconds
  • Reset time: 10 seconds between episodes
  • Task: Pick up gum and place it on a white plate

4. Model Training

python -m lerobot.scripts.train \
  --dataset.repo_id=CreatorKanata/gum-pickup-so-arm101 \
  --policy.type=act \
  --output_dir=outputs/train/act-gum-pickup-so-arm101 \
  --job_name=gum-pickup-so-arm101 \
  --policy.device=cuda \
  --wandb.enable=true \
  --policy.repo_id=CreatorKanata/act-gum-pickup-so-arm101

5. Run Inference

python kanata_control.py

๐Ÿ“Š Training Results

๐Ÿค— Hugging Face Resources

๐Ÿ“ Project Structure

gum-pickup-so-arm101/
โ”œโ”€โ”€ kanata_record.py      # Data collection script
โ”œโ”€โ”€ kanata_control.py     # Inference execution script
โ”œโ”€โ”€ images/              # Documentation images
โ”‚   โ”œโ”€โ”€ gum-pickup.jpg
โ”‚   โ”œโ”€โ”€ system-structure.jpg
โ”‚   โ”œโ”€โ”€ camera-visions.jpg
โ”‚   โ”œโ”€โ”€ wandb-overview.png
โ”‚   โ”œโ”€โ”€ wandb-train-charts.png
โ”‚   โ””โ”€โ”€ huggingface-*.png
โ”œโ”€โ”€ videos/              # Demo videos
โ”‚   โ”œโ”€โ”€ run-inference.mp4
โ”‚   โ””โ”€โ”€ camera-video.mp4
โ”œโ”€โ”€ CLAUDE.md           # Guidelines for Claude Code
โ””โ”€โ”€ README.md           # This file

๐Ÿ”ง Customization

Camera Configuration

Adjust in the camera_config section of both scripts:

  • USB camera index: index_or_path=6
  • RealSense serial number: serial_number_or_name="841612072123"

Task Parameters

  • NUM_EPISODES: Number of episodes to record/evaluate
  • EPISODE_TIME_SEC: Duration of each episode
  • RESET_TIME_SEC: Reset time between episodes
  • FPS: Frame rate

References

About

Teaching AI robot arm to pick up gum using imitation learning with LeRobot and SO-ARM101

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages