Giter Site home page Giter Site logo

upkie / pink_balancer Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 71 KB

Upkie agent that can balance and crouch

License: Apache License 2.0

Python 90.19% Makefile 6.46% Shell 3.35%
inverse-kinematics legged-robots locomotion pid-control python robotics wheeled-biped

pink_balancer's Introduction

Upkie wheeled biped robot

CI Documentation Coverage PyPI version Chat

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.

Getting started

You can play with a balancing Upkie right away from your command line:

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

Click on the robot in the simulator window to apply external forces. If you have a gaming controller connected to your computer, steer its joysticks to move the robot around ๐ŸŽฎ

Installation

Conda

Conda version

conda install -c conda-forge upkie

PyPI

PyPI version

pip install upkie

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, terminated, truncated, _ = env.step(action)
        if terminated or truncated:
            observation, _ = env.reset()
        pitch = observation[0]
        action[0] = 10.0 * pitch

To run this agent, you will first need to start a simulation:

./start_simulation.sh

Then execute the Python code above. To run the agent on the robot, do the same but running the pi3hat spine instead of the simulation.

Agents

The demo agent simply balances in place by PID control. There are more advanced Upkie agents distributed in their own repositories. Check out the ones you are interested in:

  • MPC balancer: balance in place using model predictive control.
  • Pink balancer: an extended PID balancer than can crouch and lift its legs.
  • PPO balancer: balance in place with a policy trained by reinforcement learning.

Head over to the new_agent template to create your own.

Frequently Asked Questions

Citation

If you built an Upkie or use parts of this project in your works, please cite it as follows:

@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},
  license = {Apache-2.0},
  url = {https://github.com/upkie/upkie},
  version = {3.4.0},
  year = {2024}
}

pink_balancer's People

Contributors

stephane-caron avatar

Watchers

 avatar  avatar

Forkers

ubgk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.