https://github.com/upkie/pink_balancer
Upkie agent that can balance and crouch
https://github.com/upkie/pink_balancer
inverse-kinematics legged-robots locomotion pid-control python robotics wheeled-biped
Last synced: 6 months ago
JSON representation
Upkie agent that can balance and crouch
- Host: GitHub
- URL: https://github.com/upkie/pink_balancer
- Owner: upkie
- License: apache-2.0
- Created: 2024-01-08T15:55:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T11:06:50.000Z (8 months ago)
- Last Synced: 2025-05-07T16:11:24.781Z (6 months ago)
- Topics: inverse-kinematics, legged-robots, locomotion, pid-control, python, robotics, wheeled-biped
- Language: Python
- Homepage:
- Size: 207 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pink balancer
[](https://github.com/upkie/upkie/tree/v6.1.0)
An agent for [Upkie](https://github.com/upkie/upkie/) that combines wheeled balancing with inverse kinematics computed by [Pink](https://github.com/stephane-caron/pink). This is the controller that runs in the [first](https://www.youtube.com/shorts/8b36XcCgh7s) [two](https://www.youtube.com/watch?v=NO_TkHGS0wQ) videos of Upkie.
## Installation
### On your machine
```console
conda env create -f environment.yaml
conda activate ppo_balancer
```
### On your Upkie
The PPO balancer uses [pixi](https://pixi.sh/latest/#installation) and [pixi-pack](https://github.com/Quantco/pixi-pack/releases) to pack a standalone Python environment to run policies on your Upkie. First, create `environment.tar` and upload it by:
```console
make pack_pixi_env
make upload
```
Then, unpack the remote environment:
```console
$ ssh user@your-upkie
user@your-upkie:~$ cd ppo_balancer
user@your-upkie:ppo_balancer$ make unpack_pixi_env
```
## Usage
Start the simulation or pi3hat spine, then run:
```console
make run_agent
```
### Gamepad commands
Once the agent is running, you can direct your Upkie using the game controller 🎮
- **Left joystick:** go forward right backward
- **Right joystick:** turn left or right
- **Directional pad:** down to crouch, up to stand up
- **Right button:** (B on an Xbox controller, red circle on a PS4 controller) emergency stop 🚨 all motors will turn off