Skip to content

MichaelRazum/xarm-cuber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xArm Cuber

xArm Cuber in action

Python project for controlling a HiWonder xArm to manipulate and solve a Rubik's Cube. Includes motion control, camera integration, and cube-solving policy execution.

Features

  • Dual-process architecture: Concurrent vision analysis and robot execution
  • Computer vision: Real-time cube detection, color classification, and state tracking with rubikvision
  • Learned policies: SmolVLA or ACT
  • Real-time visualization: Rerun integration for live monitoring and debugging

Installation

# Clone with submodules
git clone --recursive https://github.com/yourusername/xarm-cuber.git
cd xarm-cuber

# Setup Python environment
conda create -n cube python=3.10
conda activate cube

# Install dependencies  
pip install -e thirdparty/lerobot/src
pip install -e thirdparty/rubikvision

Running the Solver

# Run autonomous solver
python src/main.py \
--robot.cameras="$CAMERAS_CONFIG" \
--robot.type=xarm_follower \
--robot.port=/dev/ttyUSB0 \
--policy.path="$POLICY_PATH" \
--dataset.repo_id="$REPO_ID" \
--dataset.single_task="task" \
--display_data=true \
--resume=true \
--policy.chunk_size=20 \
--policy.n_action_steps=20

Architecture

┌──────────────────┐                     ┌──────────────────┐
│   Robot &        │◄──── action ──────► │   Vision &       │
│   Camera         │                     │   Planning       │
│   Process        │──── image/busy ───► │   Process        │
│                  │                     │                  │
│ - Camera capture │                     │ - Cube detection │
│ - Policy control │                     │ - State analysis │
│ - Action chunking│                     │ - Solve planning │
│ - Robot commands │                     │ - Action mapping │
│ - Task execution │                     │ - Kociemba solve │
│ - Rerun logging  │                     │ - Rerun logging  │
└──────────────────┘                     └──────────────────┘

Flow: Camera → Vision Analysis → Action Planning → Robot Execution → Repeat
Communication: PyTorch shared memory (image, busy flag, action commands)

Training Your Own Policies

# Record demonstrations
bash scripts/record_demo.sh

# Train ACT policy
bash scripts/train_act.sh

Acknowledgments

  • LeRobot for the robotics framework
  • Kociemba algorithm for optimal cube solving sequences

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •