Files
lerobot/ui/launch.sh
T
Pepijn f97f57e950 feat: add native Svelte UI for robot recording, teleop, and eval
Adds a generic web dashboard at ui/ that works with any robot/teleop
type in lerobot. Calls lerobot-record, lerobot-teleoperate, and
lerobot-eval as background subprocesses.

Features:
- Setup tab: robot type/port/id, dynamic camera configuration
- Record tab: dataset config, teleop device, start/stop recording
- Teleop tab: start/stop teleoperation
- Evaluate tab: policy path, env type, device config
- Live MJPEG camera preview (paused during subprocess, auto-restarts)
- Terminal-style log panel streaming subprocess stdout/stderr
- Hardware discovery: serial ports, CAN interfaces, OpenCV cameras
- Config persistence via localStorage
- Dark theme, responsive camera grid

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 22:37:19 -07:00

51 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Launch LeRobot UI — backend (FastAPI) + frontend (Svelte/Vite)
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# ---- Python dependencies ----
if ! python -c "import fastapi" 2>/dev/null; then
echo "Installing Python dependencies..."
pip install -r requirements.txt
fi
# ---- Node dependencies ----
if [ ! -d "node_modules" ]; then
echo "Installing Node dependencies..."
npm install
fi
# ---- Start backend ----
echo "Starting backend server on :8000 ..."
python server.py &
BACKEND_PID=$!
# Give the backend a moment to bind its port
sleep 1
# ---- Start frontend ----
echo "Starting frontend dev server on :5173 ..."
npm run dev &
FRONTEND_PID=$!
# ---- Cleanup on exit ----
cleanup() {
echo ""
echo "Shutting down..."
kill "$BACKEND_PID" 2>/dev/null || true
kill "$FRONTEND_PID" 2>/dev/null || true
}
trap cleanup EXIT INT TERM
echo ""
echo "================================================"
echo " LeRobot UI → http://localhost:5173"
echo " Backend API → http://localhost:8000"
echo " Press Ctrl+C to stop"
echo "================================================"
echo ""
wait