LeLab - Web Interface for LeRobot
June 18, 2025 ยท View on GitHub
A modern web-based interface for controlling and monitoring robots using the LeRobot framework. This application provides an intuitive dashboard for robot teleoperation, data recording, and calibration management.
๐ค About
LeLab bridges the gap between LeRobot's powerful robotics capabilities and user-friendly web interfaces. It offers:
- Real-time robot control through an intuitive web dashboard
- Dataset recording for training machine learning models
- Live teleoperation with WebSocket-based real-time feedback
- Configuration management for leader/follower robot setups
- Joint position monitoring and visualization
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Frontend โ โ FastAPI โ โ LeRobot โ
โ (React/TS) โโโโโบโ Backend โโโโโบโ Framework โ
โ โ โ โ โ โ
โ โข Dashboard โ โ โข REST APIs โ โ โข Robot โ
โ โข Controls โ โ โข WebSockets โ โ Control โ
โ โข Monitoring โ โ โข Recording โ โ โข Sensors โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โจ Features
๐ฎ Robot Control
- Teleoperation: Direct robot arm control through web interface
- Joint monitoring: Real-time joint position feedback via WebSocket
- Safety controls: Start/stop teleoperation with status monitoring
๐น Data Recording
- Dataset creation: Record episodes for training ML models
- Session management: Start, stop, and manage recording sessions
- Episode controls: Skip to next episode or re-record current one
- Real-time status: Monitor recording progress and status
โ๏ธ Configuration
- Config management: Handle leader and follower robot configurations
- Calibration support: Load and manage calibration settings
- Health monitoring: System health checks and diagnostics
๐ Web Interface
- Modern UI: Built with React, TypeScript, and Tailwind CSS
- Real-time updates: WebSocket integration for live data
- Responsive design: Works on desktop and mobile devices
๐ Quick Start
Prerequisites
- Python 3.8+
- Node.js 16+ (for frontend development)
- LeRobot framework installed and configured
- Compatible robot hardware
Installation
-
Clone the repository
git clone <your-repo-url> cd leLab -
Install the Python backend
# If installing in virtual environment python -m venv .venv source .venv/bin/activate # If installing globally # Note: Git-LFS required: brew install git-lfs pip install -e .
Running the Application
After installation, you can use the lelab command-line tools:
# Start only the backend server (default)
lelab
# Start both backend and frontend servers
lelab-fullstack
# Start only the frontend development server
lelab-frontend
Command Options:
lelab- Starts only the FastAPI backend server onhttp://localhost:8000lelab-fullstack- Starts both FastAPI backend (port 8000) and Vite frontend (port 8080) with auto-browser openinglelab-frontend- Starts only the frontend development server with auto-browser opening
Frontend Repository:
The frontend is automatically cloned from leLab-space when you run lelab-frontend or lelab-fullstack. The system will:
- Check if the frontend already exists in the parent directory
- Clone the repository if it doesn't exist
- Install dependencies with
npm install - Start the development server and auto-open your browser
Key Endpoints
POST /move-arm- Start robot teleoperationPOST /stop-teleoperation- Stop current teleoperationGET /joint-positions- Get current joint positionsPOST /start-recording- Begin dataset recordingPOST /stop-recording- End recording sessionGET /get-configs- Retrieve available configurationsWS /ws/joint-data- WebSocket for real-time joint data
๐๏ธ Project Structure
leLab/
โโโ app/ # FastAPI backend
โ โโโ main.py # Main FastAPI application
โ โโโ recording.py # Dataset recording logic
โ โโโ teleoperating.py # Robot teleoperation logic
โ โโโ calibrating.py # Robot calibration logic
โ โโโ training.py # ML training logic
โ โโโ config.py # Configuration management
โ โโโ scripts/ # Command-line scripts
โ โ โโโ backend.py # Backend-only startup
โ โ โโโ frontend.py # Frontend-only startup
โ โ โโโ fullstack.py # Full-stack startup
โ โโโ static/ # Static web files
โโโ ../leLab-space/ # React frontend (auto-cloned)
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โโโ pages/ # Page components
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ contexts/ # React contexts
โ โโโ public/ # Static assets
โ โโโ package.json # Frontend dependencies
โโโ pyproject.toml # Python project configuration
โโโ README.md # This file
๐ง Development
Backend Development
# Install in editable mode
pip install -e .
# Run backend only with auto-reload
lelab
Frontend Development
# Automatically clones, installs deps, and starts dev server
lelab-frontend
Full-Stack Development
# Start both backend and frontend with auto-reload
lelab-fullstack
Development Notes:
- The frontend repository is automatically managed (cloned/updated)
- Both commands auto-open your browser to the appropriate URL
- Backend runs on
http://localhost:8000 - Frontend runs on
http://localhost:8080with API proxying
๐ค Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- LeRobot - The underlying robotics framework
- FastAPI - Modern web framework for building APIs
- React - Frontend user interface library
Note: Make sure your LeRobot environment is properly configured and your robot hardware is connected before running the application.