Upkie
Open-source wheeled biped robots
Install / Use
/learn @upkie/UpkieREADME
Upkie wheeled biped robots
<img src="https://github.com/upkie/upkie/assets/1189580/2fc5ee4a-81b0-425c-83df-558c7147cc59" align="right" width="250" />Upkies are open-source wheeled biped robots featuring wheels for balance and legs to negotiate uneven terrains. They are designed to be buildable with off-the-shelf tools and components, such as mjbots actuators. You can develop in Python or C++, on Linux or macOS, then deploy your behaviors directly to the robot's Raspberry Pi. There are videos showing the robots in action on the Upkies' YouTube channel.
This repository contains all the materials needed to build and control an Upkie. Questions are welcome in the discussions forum or in the chat room.
Building your own
Upkies come with step by step build instructions.
Getting started
Upkies come with a model predictive controller that can balance and roam around. You can try it out in simulation by:
./start_mpc_balancer.sh
Once the agent is running, you can direct your Upkie using a gamepad 🎮
- Left joystick: go forward right backward
- Right joystick: turn left or right
- Directional pad: down to crouch, up to stand up
- Right button: (B on an Xbox controller, red circle on a PS4 controller) emergency stop 🚨 all motors will turn off
Click on the robot in the simulator window to apply external forces and see how the robot reacts.
Creating your own behaviors
Software for Upkies comes is packaged in an upkie Python library. You can install it:
- From conda-forge:
conda install -c conda-forge upkie - From PyPI:
pip install upkie
When running on the real robot, your code will command the robot's actuators via another process called the spine. There are also simulation spines for testing before deploying to a robot. Let's start a Bullet simulation spine:
<img src="https://raw.githubusercontent.com/upkie/upkie/refs/heads/main/docs/images/bullet-spine.png" height="100" align="right" />./start_simulation.sh
Now that we have a spine is running, we can control the robot in Python. For example:
import gymnasium as gym
import numpy as np
import upkie.envs
upkie.envs.register()
with gym.make("Upkie-Spine-Pendulum", frequency=200.0) as env:
observation, _ = env.reset()
gain = np.array([10.0, 1.0, 0.0, 0.1])
for step in range(1_000_000):
action = gain.dot(observation).reshape((1,))
observation, reward, terminated, truncated, _ = env.step(action)
if terminated or truncated:
observation, _ = env.reset()
Other Gymnasium environments provide various levels of absraction to control the robot. They are listed in the Gym environments page of the documentation.
Going further
Examples
There are smaller standalone examples in the examples directory. For instance:
- Domain randomization: shows how to add domain-randomization wrappers to an Upkie environment.
- Lying genuflection: genuflect while lying on a horizontal floor.
- Model predictive control: a self-contained MPC balancer
- PD balancer: balance by proportional-derivative feedback to wheel velocities.
Some examples have optional dependencies, like those for the Genesis and PyBullet simulators. You can activate a virtual environment and install them as optional dependencies, or use Pixi:
pixi run --environment genesis ./examples/genesis_balancing.py
Tasks
Upkies come with a set of default behaviors that you can executed as Pixi tasks. To get started, make sure you have installed pixi.
| Name | Task |
|-------------------------|----------------------------------------------------------|
| mpc-balancer | Run the MPC balancer with a running spine / real robot |
| mpc-balancer-genesis | Run the MPC balancer in Genesis |
| mpc-balancer-pybullet | Run the MPC balancer in PyBullet |
You can execute a task by pixi run <task-name>, for instance:
pixi run mpc-balancer-pybullet
Tasks are available both on your machine and on your Upkie's Raspberry Pi (Pixi comes pre-installed on the SD card image). They are implemented by agents. You can make your own agents by forking this repository or using the new_agent template to get started.
Contributing
Contributions are welcome to both the hardware and software of Upkies! Check out the contribution guidelines.
Citation
If you built an Upkie or use parts of this project in your works, please cite the project and its contributors:
@software{upkie,
title = {{Upkie open source wheeled biped robot}},
author = {Caron, St\'{e}phane and Perrin-Gilbert, Nicolas and Ledoux, Viviane and G\"{o}kbakan, \"{U}mit Bora and Raverdy, Pierre-Guillaume and Raffin, Antonin and Tordjman{-}{-}Levavasseur, Valentin and Arlaud, Etienne and Duclusaud, Marc},
url = {https://github.com/upkie/upkie},
license = {Apache-2.0},
version = {10.1.0},
year = {2026}
}
Don't forget to add yourself to the BibTeX above and to CITATION.cff if you contribute to the project.
See also
Reinforcement learning playgrounds for Upkies
<img src="https://github.com/user-attachments/assets/f6293fbc-5c59-4e56-bc7f-0ee930503f11" align="right" height="300px">- MjLab Upkie: GPU-accelerated playground based on MjLab and MuJoCo Warp (requires an Nvidia GPU). Can train whole-body policies such as the one depicted to the right.
- RLB3 upkie: new CPU playground to train policies for Upkie-Pendulum environments via RL Baselines3 Zoo
- PPO balancer: legacy CPU playground to train policies for Upkie-Pendulum environments using Stable-Baselines3 (video)
Open-source robotics
- Awesome Open Source Robots: Upkies are one among many open-source open-hardware robot initiative: check out the others!
- mjbots: The company that manufactures the brushless servos used in Upkies, that are open source in firmware, hardware and software.
- Open Dynamic Robot Initiative: An open torque-controlled modular robot architecture for legged locomotion research.
