Leika is an open-source quadruped robot built around the ESP32 microcontroller. The project combines embedded firmware, web-based control interfaces, and a physics-based simulation environment to create a complete robotics development platform. Using FreeRTOS for real-time task management, the robot handles inverse kinematics, gait generation, sensor fusion, and wireless communication simultaneously.
The project includes a PyBullet simulation environment for testing control algorithms and training reinforcement learning policies before deploying to hardware.
The robot implements a sense-plan-act control architecture:
The kinematics system allows control through Cartesian coordinates rather than raw joint angles. This abstraction simplifies motion planning and enables intuitive control.
The robot's body pose in the world reference frame:
$$T_{body}=\left[x_b,y_b,z_b,\phi, \theta,\psi\right]$$
Where:
Foot positions in the world reference frame:
$$P_{feet}=\{(x_{f_i},y_{f_i},z_{f_i})|i=1,2,3,4\}$$
The inverse kinematics solver converts these high-level commands into joint angles for the 12 servos (3 per leg). The kinematics library is implemented in C++ for the ESP32 firmware and TypeScript for the web controller, enabling both real-time control and browser-based visualization.
The web interface is built with SvelteKit and compiled to static assets that are embedded directly in the ESP32 firmware. This approach eliminates the need for external servers and ensures the controller is always synchronized with the firmware version.
Features:
The motion system is implemented as a finite state machine supporting multiple locomotion modes:
Trot Gait (12-Point Bezier)
8-Phase Crawl Gait
Static/Dynamic Posing
| Input | Parameter | Range |
|---|---|---|
| Left joystick X | Step length (X) | -1 to 1 |
| Left joystick Y | Step length (Z) | -1 to 1 |
| Right joystick X | Turn angle | -1 to 1 |
| Right joystick Y | Body pitch | -1 to 1 |
| Height slider | Body height | 0 to 1 |
| Speed slider | Step velocity | 0 to 1 |
| S1 slider | Step height | 0 to 1 |
| Stop button | Emergency stop | 0 or 1 |
A PyBullet-based physics simulation is available for algorithm development and reinforcement learning training:
cd simulation
pip install -r requirements.txt
python play.py
Features:
The simulation environment allows testing control algorithms and training policies before deploying to hardware. See simulation/README.md for detailed documentation.
The original design supporting 12 servos with full 3-DOF leg control. Suitable for experimentation and learning about quadruped robotics.
A crossbreed between Kangal, SpotMicro and Open Quadruped
A smaller and more affordable variant currently under development. Leika Mini aims to lower the entry barrier while being fully compatible with the platform.
| Parameter | Leika (Standard) | Leika Mini | Yertle |
|---|---|---|---|
| Coxa Length | 60.5mm | 35.0mm | 35.0mm |
| Coxa Offset | 10.0mm | 0.0mm | 0.0mm |
| Femur Length | 111.2mm | 60.0mm | 130.0mm |
| Tibia Length | 118.5mm | 60.0mm | 130.0mm |
| Body Length (L) | 207.5mm | 160.0mm | 240.0mm |
| Body Width (W) | 78.0mm | 80.0mm | 78.0mm |
| Max Leg Reach | 219.7mm | 95.0mm | 255.0mm |
| Body Height Range | 98.9-197.7mm | 42.8-85.5mm | 114.8-229.5mm |
Motion Limits:
The kinematics system automatically adapts to the selected hardware variant through compile-time configuration flags (SPOTMICRO_ESP32, SPOTMICRO_ESP32_MINI, SPOTMICRO_YERTLE).
The robot body is constructed from 3D-printed parts based on various Spot Micro community designs:
| Component | Specification | Required | Notes |
|---|---|---|---|
| ESP32 | Microcontroller | Yes | ESP32-S3 (N8R8) recommended for better performance |
| PCA9685 | 16-channel PWM servo driver | Yes | Reinforce with thicker solder traces |
| 12x Servo motors | 20-36kg torque | Yes | Minimum MG996R, highly recommend the pricer CLS6336HV |
| LM2596/XL4015 | DC-DC buck converter | Yes | Set to 5V for ESP32 and peripherals |
| MPU6050 | IMU (accelerometer + gyroscope) | Recommended | GY-87 or MPU-9250 include magnetometer |
| HMC5883 | Magnetometer | Optional | Included in GY-87/MPU-9250 |
| PAJ7620U2 | Gesture sensor | Optional | For interaction capabilities |
| OV2640/OV5640 | Camera module | Optional | 120-160° FOV recommended |
| 2x HC-SR04 | Ultrasonic distance sensors | Optional | For obstacle detection |
| 0.96" SD1306 | OLED display | Optional | Status display |
| Battery | 7.6-8.4V | Yes | 4x 18650 in 2S2P or 2S LiPo |
| Power switch | Main power | Yes | Rated for battery current |
Complete build instructions are available in the documentation:
Prerequisites:
Build and flash:
git clone https://github.com/runeharlyk/SpotMicroESP32-Leika
cd SpotMicroESP32-Leika
cd app
pnpm install
cd ..
pio run -t upload
pio run -t uploadfs
Configuration is managed through factory_settings.ini and features.ini in the esp32/ directory.
To experiment with the simulation environments without hardware:
cd simulation
pip install -r requirements.txt
python play.py
For development workflows and contribution guidelines, see docs/6_developing.md and docs/7_contributing.md.
├── app/ # SvelteKit web controller
├── docs/ # Build and software documentation
├── esp32/ # ESP32 firmware (PlatformIO)
│ ├── include/ # Firmware headers
│ ├── src/ # Firmware source
│ └── lib/ # Third-party libraries (TensorFlow Lite Micro)
├── simulation/ # PyBullet simulation environment
├── hardware/ # 3D printable parts and CAD files
├── scripts/ # Utility scripts
Track planned features and active development on the project board. Report bugs or request features through GitHub issues.
If you're interested in quadruped robotics, check out:
This project is licensed under the MIT License - see LICENSE.md for details.
Rune Harlyk - runeharlyk.dk
Project Repository: https://github.com/runeharlyk/SpotMicroESP32-Leika