Skip to main content

Python module to control Upkie wheeled biped robots.

Project description

Upkie wheeled biped robots

CI Documentation Coverage Conda version PyPI version

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++, 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 out-of-the-box with balancing and locomotion capabilities. You can try them out in simulation using pixi:

pixi run example-follow-joystick

Or using uv:

uv run examples/follow_joystick.py

Once the agent is running, you can direct your Upkie using a gamepad 🎮

  • Left joystick ⬆️ ⬇️: go forward or backward
  • Left joystick ⬅️ ➡️: turn left or right
  • Right button: (B on an Xbox controller, red circle on a PS4 controller) emergency stop 🚨

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 that you can install from conda or pip:

pip install upkie

This library provides Gymnasium environments to control real and simulation robots with the same code. For instance, the following example balances the robot like a wheeled inverted pendulum in PyBullet:

import gymnasium as gym
import numpy as np
import upkie.envs

upkie.envs.register()

with gym.make("Upkie-PyBullet-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()

To switch to the real robot, replace "PyBullet" by "Spine" in the environment name.

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.

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 = {12.0.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

  • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

upkie-12.0.0.tar.gz (74.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

upkie-12.0.0-py3-none-any.whl (80.8 kB view details)

Uploaded Python 3

File details

Details for the file upkie-12.0.0.tar.gz.

File metadata

  • Download URL: upkie-12.0.0.tar.gz
  • Upload date:
  • Size: 74.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for upkie-12.0.0.tar.gz
Algorithm Hash digest
SHA256 8d61669652af42a4a09605b41204b7d7b1e9769910b8fda9a6c25d4f277e0508
MD5 8b03557f3db2aff49ab1fa41e9a3e6ec
BLAKE2b-256 ef4460fe6efea696250eab8d1368b7635e911077f2dd6ebdbc43c00c4aae1df6

See more details on using hashes here.

File details

Details for the file upkie-12.0.0-py3-none-any.whl.

File metadata

  • Download URL: upkie-12.0.0-py3-none-any.whl
  • Upload date:
  • Size: 80.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for upkie-12.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 badf8cc8ea1b38116fa12096ad7eb35d83dc0f17a098f58cec0341a5ae4039f1
MD5 36b0e9eff088463526960e441282e116
BLAKE2b-256 b250f2f809d1e441b3d18e20fbe8def83f95070688f0159d89f68d01a414bbba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page