Pythonic wrapper for Piper robotic arm control with automatic CAN device setup and intuitive API.
from easy_piper import EasyPiper
# That's it! Automatic CAN detection and configuration
arm = EasyPiper()
# Use the arm
arm.enable(wait=True)
arm.switch_mode_joint(speed_percent=30)
arm.go_zero_joints()- β Automatic CAN Setup - Detects and configures CAN devices automatically
- β Unit Conversion - Use degrees, mm, NΒ·m (not 0.001Γ units)
- β Pythonic API - Clear, intuitive method names
- β Multiple Control Modes - Joint space, Cartesian space, teach mode
- β Gripper Control - Position and force control
- β Comprehensive Feedback - Read joints, TCP pose, gripper state, and more
- π₯ PiperRecorder - Record trajectories for imitation learning
- π LeRobot Compatible - HDF5 format compatible with LeRobot library
- π Visualization Tools - Plot and analyze recorded data
# Clone with submodules
git clone --recursive https://github.com/<YOUR_USERNAME>/easy_piper.git
cd easy_piper
# Install piper_sdk submodule
cd piper_sdk
pip install -e .
cd ..
# Install EasyPiper
pip install -e .
# Or with recording support
pip install -e .[recorder]# Clone the repository
git clone https://github.com/<YOUR_USERNAME>/easy_piper.git
cd easy_piper
# Initialize submodules
git submodule update --init --recursive
# Install dependencies
pip install -r requirements.txt
# Install piper_sdk
cd piper_sdk
pip install -e .
cd ..
# Install EasyPiper
pip install -e .For detailed setup instructions, see SETUP_GUIDE.md.
from easy_piper import EasyPiper
# Initialize (automatic CAN detection)
arm = EasyPiper()
# Enable the arm
arm.enable(wait=True)
# Joint space control
arm.switch_mode_joint(speed_percent=30)
arm.move_joints([0, 30, -60, 0, 90, 0]) # degrees
# Cartesian space control
arm.switch_mode_cartesian(speed_percent=20)
arm.move_tcp_pose([300, 0, 400, 180, 0, 0]) # mm and degrees
# Gripper control
arm.gripper_open()
arm.gripper_close()
arm.gripper_set_position(50) # mm
# Disable when done
arm.disable()from easy_piper import LeRobotDataRecorder
# Initialize recorder
recorder = LeRobotDataRecorder(can_name="can_piper", output_dir="./recordings")
# In your control loop
recorder.start_episode("episode_001")
for step in range(1000):
# Get robot state
joints = arm.read_joints()
gripper = arm.read_gripper_angle()
# Record frame
recorder.record_frame(joints, gripper)
recorder.stop_episode()Or use the interactive CLI:
python3 -m piper_recorder
# Then use commands: start, stop, status, quiteasy_piper/
βββ src/
β βββ easy_piper/ # Main package
β βββ __init__.py # Package initialization
β βββ easy_piper.py # Core EasyPiper class
β βββ piper_recorder.py # Data recorder for imitation learning
βββ examples/ # Example scripts
β βββ simple_example.py
β βββ easy_piper_demo.py
β βββ load_recording_example.py
β βββ quick_start_recorder.py
βββ scripts/ # Utility scripts
β βββ can_activate.sh
β βββ find_all_can_port.sh
βββ docs/ # Documentation
β βββ EASY_PIPER_README.md
β βββ EASY_PIPER_CHEATSHEET.md
β βββ PIPER_RECORDER_README.md
β βββ CAN_SETUP_GUIDE.md
β βββ MODE_SWITCH_CHEATSHEET.md
βββ tests/ # Unit tests
βββ notebooks/ # Jupyter notebooks
βββ piper_sdk/ # Git submodule (Piper SDK)
βββ piper_sdk_gui/ # Git submodule (UI, optional)
βββ setup.py # Package setup
βββ requirements.txt # Python dependencies
βββ LICENSE # MIT License
βββ CONTRIBUTING.md # Contribution guidelines
- User Guide - Complete guide with all features
- API Cheatsheet - Quick reference for all methods
- Quick Card - Ultra-condensed reference
- Recorder Guide - Data recording documentation
- CAN Setup - Detailed CAN configuration guide
- Mode Switching - SDK mode control reference
EasyPiper automatically detects and configures CAN devices. For manual setup:
# Find available CAN devices
./scripts/find_all_can_port.sh
# Activate a specific device
./scripts/can_activate.sh can_piperSee docs/CAN_SETUP_GUIDE.md for detailed instructions.
- Robotics Research - Control Piper arms with Pythonic interface
- Imitation Learning - Collect demonstration data in LeRobot format
- Automation - Build automated pick-and-place systems
- Education - Teach robotics programming with intuitive API
- Prototyping - Quickly test robot behaviors
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
pip install -e .[dev]pytest tests/black .
flake8 .- Python 3.7+
- Linux (tested on Ubuntu 20.04+)
- CAN-bus hardware
- Piper robotic arm
piper_sdk- Official Piper SDK (included as submodule)numpy- Numerical operationspython-can- CAN bus communicationh5py- HDF5 file format (for recording)matplotlib- Visualization (optional)
This project is licensed under the MIT License - see the LICENSE file for details.
- Built on top of Agilex Robotics Piper SDK
- Compatible with LeRobot for imitation learning
- Author: Charith Munasinghe
- Issues: GitHub Issues
- Follow the SETUP_GUIDE.md
- Run
python3 examples/simple_example.py - Read the User Guide
- Check out more examples
Happy robot controlling! π€