{"id":19528320,"url":"https://github.com/upkie/mpc_balancer","last_synced_at":"2025-04-26T11:33:10.850Z","repository":{"id":224077471,"uuid":"762342408","full_name":"upkie/mpc_balancer","owner":"upkie","description":"Model predictive control to balance Upkie wheeled bipeds","archived":false,"fork":false,"pushed_at":"2024-11-04T06:55:43.000Z","size":70,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-04T07:30:05.852Z","etag":null,"topics":["legged-robots","locomotion","model-predictive-control","python","robotics","wheeled-biped"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/upkie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-23T15:24:54.000Z","updated_at":"2024-11-04T06:55:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"67f32b27-3fe7-468c-bf54-b2c9f83349a2","html_url":"https://github.com/upkie/mpc_balancer","commit_stats":null,"previous_names":["upkie/mpc_balancer"],"tags_count":0,"template":false,"template_full_name":"upkie/new_agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upkie%2Fmpc_balancer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upkie%2Fmpc_balancer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upkie%2Fmpc_balancer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/upkie%2Fmpc_balancer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/upkie","download_url":"https://codeload.github.com/upkie/mpc_balancer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224032373,"owners_count":17244418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["legged-robots","locomotion","model-predictive-control","python","robotics","wheeled-biped"],"created_at":"2024-11-11T01:18:29.903Z","updated_at":"2025-04-26T11:33:10.842Z","avatar_url":"https://github.com/upkie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MPC balancer\n\n[![upkie](https://img.shields.io/badge/upkie-7.0.0-aabbcc)](https://github.com/upkie/upkie/tree/v7.0.0)\n\nMake an Upkie to stand upright by closed-loop model predictive control.\n\n## Installation\n\nWe recommend using Anaconda to install the agent and all its dependencies in a clean environment:\n\n```console\nconda env create -f environment.yaml\nconda activate mpc_balancer\n```\n\nAlternatively, you should be able to install the packages listed in the environment file from PyPI.\n\n## Usage\n\nTo run in simulation, clone the [upkie](https://github.com/upkie/upkie) repository and run:\n\n```console\n./start_simulation.sh\n```\n\nActivate your conda environment and run the agent by:\n\n```console\npython run_agent.py\n```\n\n## Solvers\n\nThis agent only works with QP solvers that support warm starting. At present we only support one solver:\n\n| Solver | Algorithm | License | Warm-start |\n| ------ | --------- | ------- |------------|\n| [ProxQP](https://github.com/Simple-Robotics/proxsuite) | Augmented Lagrangian | BSD-2-Clause | ✔️ |\n\nYou can take a peek at the [ProxQP balancer](https://github.com/stephane-caron/proxqp_balancer) (research code) for more solvers.\n\n## Export dependencies to your Upkie\n\nThis agent can export a pixi environment to your Upkie using `pixi-pack`. If you don't have pixi yet, you will need to [install it](https://pixi.sh/latest/#installation) first. Then, to pack an environment from your computer, run:\n\n```bash\nmake pack_env\n```\n\nThis will create an `environment.tar` archive in the current directory. You can upload it to your Upkie by `make upload` and unpack it from the agent's remote directory by:\n\n```bash\nyour_user@your_upkie:~/mpc_balancer$ make unpack_env\n\n```\n\nIf `pixi-pack` is not installed on your Upkie, you can download the `pixi-pack-aarch64-unknown-linux-gnu` binary from the [pixi-pack release page](https://github.com/Quantco/pixi-pack/releases). Finally, activate the environment and run the agent:\n\n```bash\nconda activate mpc_balancer\npython mpc_balancer/run.py\n```\n\n## See also\n\n- [PPO balancer](https://github.com/upkie/ppo_balancer): an MLP agent trained for the same task by reinforcement learning.\n- [ProxQP balancer](https://github.com/stephane-caron/proxqp_balancer): prototype for this agent used in the code for the [ProxQP paper](https://inria.hal.science/hal-04198663v2). Currently supports more QP solvers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupkie%2Fmpc_balancer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fupkie%2Fmpc_balancer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fupkie%2Fmpc_balancer/lists"}