Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

$\text{MPC}^2$: Model Predictive Control with Morphology-aware Proportional Control

Official implementation of $\text{MPC}^2$ (paper link) — a hierarchical model-based planning algorithm for zero-shot, near-real-time control of high-dimensional musculoskeletal systems. This repository is built on MuJoCo MPC.

Overview

Controlling high-dimensional nonlinear systems is challenging due to large state and action spaces. $\text{MPC}^2$ addresses this by combining:

  • A sampling-based model predictive position controller for high-level posture planning
  • A morphology-aware proportional controller that coordinates actuators using the system's Jacobian matrices

This enables stable control of a 700-actuator whole-body human musculoskeletal model (MS-Human-700) across diverse motion tasks — without any training. The method also generalizes to an ostrich musculoskeletal model (120 actuators) and an arm/hand model (85 actuators) for dexterous manipulation.

Quick Start

Prerequisites

  • CMake ≥ 3.16
  • C++20 compiler (Clang 12+ or GCC 11+)
  • Conda (recommended for dependencies)

Get the Code

git clone --recurse-submodules https://github.com/LNSGroup/MPC2.git
cd MPC2

The --recurse-submodules flag is required to pull the MS-Human-700 and OstrichRL musculoskeletal models. If you already cloned without it, run:

git submodule update --init --recursive

Build

# Install OsqpEigen (required dependency)
conda install conda-forge::osqp-eigen

# Configure and build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --target mjpc -j$(nproc)

Run a Task

./build/bin/mjpc --task="Walk"

Press +/- to adjust simulation speed. Default speed: 0.01× (for 32-core CPU).

Tasks

All tasks use the MS-Human-700 full-body musculoskeletal model (700 muscle-tendon units) unless noted otherwise.

Task Description Command
Stand Maintain upright balance for 10 seconds on flat ground --task="Stand"
Walk Walk forward over flat terrain for 10 meters --task="Walk"
Rough Walk forward over rough terrain --task="Rough"
Slope Walk up and down inclined slopes --task="Slope"
HandCube Dexterous manipulation: rotate a cube to a target orientation using an arm/hand model (85 actuators) --task="HandCube"
WalkOstrich Walk forward using the ostrich musculoskeletal model (120 actuators) --task="WalkOstrich"

Task Switching

Tasks can be switched via the GUI task selector, or by passing the --task flag:

./build/bin/mjpc --task="Slope"

The default startup task is set in mjpc/main.cc:

ABSL_FLAG(std::string, task, "Walk", "Which model to load on startup.");

Models

This repository uses two musculoskeletal models as git submodules:

Model Description Source
MS-Human-700 Whole-body human model: 90 bodies, 206 joints, 700 muscles LNSGroup/MS-Human-700
OstrichRL Ostrich model: 56 joints, 120 muscles vittorione94/ostrichrl

To clone with submodules:

git clone --recurse-submodules https://github.com/LNSGroup/MPC2.git

Citation

@inproceedings{
wei2025motion,
title={Motion Control of High-Dimensional Musculoskeletal Systems with Hierarchical Model-Based Planning},
author={Yunyue Wei and Shanning Zhuang and Vincent Zhuang and Yanan Sui},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://arxiv.org/abs/2505.08238}
}

About

Official implementation of Model Predictive Control with Morphology-aware Proportional Control(MPC^2) submission at ICLR 2025.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages