Skip to main content

Python module to control Upkie wheeled bipeds.

Project description

Upkie wheeled biped robot

CI Documentation Coverage Conda version PyPI version

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:

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

First, 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 interact with it using one of the Gymnasium environments. For example, here is a linear-feedback balancer for UpkieGroundVelocity:

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 running a simulation or real-robot spine. Head over to the examples directory for more examples.

Agents

This repository only distributes a PID balancer used for testing. Actual Upkie agents are distributed in 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.

Head over to the new_agent template to create your own, and feel free to open a PR here to add your agents to the list above.

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 = {5.2.0},
  year = {2024}
}

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-5.2.0.tar.gz (474.5 kB view details)

Uploaded Source

Built Distribution

upkie-5.2.0-py3-none-any.whl (50.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for upkie-5.2.0.tar.gz
Algorithm Hash digest
SHA256 2a8b6469f8bf03a46536e6684e6726438a7a17b3dfc1d2a47fb491b29f55ceb6
MD5 37fd6666d623c230898356bfc59114ce
BLAKE2b-256 a9b8960f29d384159e8cb501265f2639602ed37103f6dda3dd2b2423f544ee83

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for upkie-5.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8af3e1d3e2b5e4a0776e5d3f303e93c1c38df6b566ca8d4bc0470a5fa3a2b1d
MD5 22ba683b7dcb5f6b75359036c02874ee
BLAKE2b-256 5bddb688e6e8345025cbf3dff5d79ca10bf0dac534c1429dd5441539564dbafd

See more details on using hashes here.

Supported by

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