Skip to main content

Python module to control Upkie wheeled bipeds.

Project description

Upkie wheeled biped robot

CI Build instructions Documentation Coverage PyPI version Chat

Upkie is a fully open source self-balancing wheeled biped robot. It has wheels for balancing, and legs to go off-road or negotiate uneven terrains. Upkies are designed to be buildable at home with tools and components ordered online, like mjbots actuators. Motion control runs onboard the robot's Raspberry Pi.

This repository contains all the software and instructions required to build and operate an Upkie. Development can be done in Python or C++, on Linux or macOS. Questions are welcome in the Chat and Discussions forum.

Installation

To code for Upkie in Python, just install:

pip install upkie

This Python interface is already fast enough for real-time control. If later on you want to optimize parts of your code, you can move them to C++ spines.

Simulation

Assuming you have a C++ compiler (setup one-liners: Fedora, Ubuntu), you can run an Upkie simulation right from the command line. It won't install anything on your machine, everything will run locally from the repository:

git clone https://github.com/upkie/upkie.git
cd upkie
./start_pid_balancer.sh

Click on the robot in the simulator window to apply external forces.

Example

You can develop your own agent using the Gymnasium environments distributed in upkie.envs. For example, here is a simple proportional-feedback balancer:

import gymnasium as gym
import upkie.envs

upkie.envs.register()

with gym.make("UpkieGroundVelocity-v3", frequency=200.0) as env:
    observation = env.reset()
    action = 0.0 * env.action_space.sample()
    for step in range(1_000_000):
        observation, reward, done, _ = env.step(action)
        if done:
            observation = env.reset()
        pitch = observation[0]
        action[0] = 10.0 * pitch

To test this agent on your computer, run the agent and simulation spine in two separate processes: python this_agent.py in one shell, and ./start_simulation.sh in the other.

To run this agent on the robot, scp the script to the Raspberry Pi, start a pi3hat spine and execute the script on the Pi itself.

To go further

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

Uploaded Source

Built Distribution

upkie-3.2.0-py3-none-any.whl (63.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for upkie-3.2.0.tar.gz
Algorithm Hash digest
SHA256 22dec96bd250f5f17f774bb5df11a7d5895eb227311829e81c45421fce8a1d92
MD5 60ae17d639fc5637e821dc3b617ac64b
BLAKE2b-256 e2cf1c7a25113aadacc33b31f61d261b8fea3566b506ead77ef90b4289f2b035

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for upkie-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f76c5cb1d27957e6b14b4b2e51c4f8205099da231d5ef076f6066b4bf1122078
MD5 101bf82724d062e50e324d8fedf5aacc
BLAKE2b-256 9c10fd6f0c3d516c0f31788a5fd5a560c47ad424d58c6cf6a8a4205264b41249

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