Python module to control Upkie wheeled bipeds.
Project description
Upkie wheeled biped robot
Upkie is a fully open source self-balancing wheeled biped robot. It has wheels for balancing and legs to negotiate uneven terrains. Upkies are designed to be buildable at home using only tools and components ordered online, like mjbots actuators. You can develop in Python or C++, on Linux or macOS, then deploy your software to the robot's Raspberry Pi.
This repository contains all the materials needed to build and animate an Upkie:
- Hardware:
- Software:
- Going further:
Questions are welcome in the Chat and Discussions forum.
Installation
From conda-forge
conda install -c conda-forge upkie
From PyPI
pip install upkie
Getting started
Let's start a Bullet simulation spine:
./start_simulation.sh
Click on the robot in the simulator window to apply external forces. Once the simulation spine is running, we can control the robot using one of its Gymnasium environments, for instance:
import gymnasium as gym
import numpy as np
import upkie.envs
upkie.envs.register()
with gym.make("UpkieGroundVelocity-v3", 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()
The Python code is the same whether we run in simulation or on a real Upkie. Head over to the examples directory for more use cases.
Gymnasium environments
Upkie has environments compatible with the Gymnasium API, for instance:
UpkieGroundVelocity
: keep legs straight and balance with the wheels.UpkieServos
: control joint servos directly (position, velocity, torque)UpkieServoPositions
: control joint positions.UpkieServoTorques
: control joint torques.
Check out the full list of environments for details.
Agents
Larger Upkie agents have their own repositories:
- MPC balancer: balance in place using model predictive control.
- Pink balancer: a more advanced agent that can crouch and stand up while balancing.
- PPO balancer: balance in place with a policy trained by reinforcement learning.
- PID balancer: legacy agent used to test new Upkies with minimal dependencies.
Head over to the new_agent template to create your own, and feel free to open a PR here to add your agent to the list.
How can I participate?
Contributions are welcome to both the hardware and software of Upkies! If you are a developer/maker with some robotics experience looking to hack on open source, check out the contribution guidelines. On the software side, you can also report any bug you encounter in the issue tracker.
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, \"{Umit} Bora and Raverdy, Pierre-Guillaume and Raffin, Antonin and Tordjman--Levavasseur, Valentin},
url = {https://github.com/upkie/upkie},
license = {Apache-2.0},
version = {6.0.0},
year = {2024}
}
See also
- Awesome Open Source Robots: Upkies are one among many open-source open-hardware robot initiative: check out the others!
- Open Dynamic Robot Initiative: Low-cost actuators, fully open source quadrupeds and bipeds.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file upkie-6.0.0.tar.gz
.
File metadata
- Download URL: upkie-6.0.0.tar.gz
- Upload date:
- Size: 501.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a04df0c8568ff698f583d773db0cdc0bc93c202f36e6e3ee7821317a6acf0ae |
|
MD5 | db3bc77c036c71c7833d36aaf786b1a4 |
|
BLAKE2b-256 | 78b0030c50662ff5ed78e89ad6459abd4360cb90173489b2cb0e7957a3e7a74a |
File details
Details for the file upkie-6.0.0-py3-none-any.whl
.
File metadata
- Download URL: upkie-6.0.0-py3-none-any.whl
- Upload date:
- Size: 52.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47c191d21bcc0ee6df11dc40a6b6ea7167dd89e7a5af391fd918c03fa45e4af9 |
|
MD5 | 1b222aff658df7ecbbd8ec1ce4f77b3e |
|
BLAKE2b-256 | 2d7f861e9fad27b3e849b4a1b158c51141e7fb795f92eb741a1c9c55211959d1 |