The MPC balancer allows Upkie to stand upright, balancing with its wheels only, by closed-loop model predictive control. It performs better than the previous PID balancer, with significantly less hacks.
We recommend using Anaconda to install the agent and all its dependencies in a clean environment:
conda create -f environment.yaml
conda activate mpc_balancer
Alternatively, you should be able to install the packages listed in the environment file from PyPI.
Start the pi3hat spine to run the agent on your robot, or the Bullet spine to check the agent first in simulation (recommended). Then, run the agent by:
python mpc_balancer.py