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

Build instructions and software for Upkie wheeled bipeds. Develop in Python or C++ on Linux or macOS, run on the robot's Raspberry Pi. Questions are welcome in the Discussions forum or on the Chat.

Installation

Everything needed to develop with Upkie in Python lies in a single package:

pip install upkie

Yes, it's as simple as that. 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/tasts-robots/upkie.git
cd upkie
./start_wheel_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-v1", 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-2.0.0.tar.gz (307.2 kB view details)

Uploaded Source

Built Distribution

upkie-2.0.0-py3-none-any.whl (62.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for upkie-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c7ac1b60384e1ccbb3128cdf444d156298c1b33ffc9e38a661678585b119cca1
MD5 a2a668dee1c6c18c0c22b2bf803b91da
BLAKE2b-256 841e9dcc1a1eaddb9d4a60c69ef79e2e9763170b4fd2d3dd2dfe27818bc28950

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for upkie-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e73b93e02d5e084f74e193965258bc860c1a990a7373964148ac97645465789e
MD5 da63d801006bca2691602a0e8c14dab9
BLAKE2b-256 d8f218de0ccd7047fceae88c1e0d56de804a425dfc1882bd9c1ea3212972c818

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