Skip to content
Back to skills

Mpc Control

ASecurity

"Operate the CPU-side quadruped convex MPC controller, its

  • 247 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 9, 2026
businesspythongoapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill mpc-control --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mpc Control?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mpc Control
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-mpc-control/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-mpc-control)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mpc-control
description: "Operate the CPU-side quadruped convex MPC controller, its
  robot/state/command interfaces, gait and FSM runners, policy bridge, and
  compiled solver extension."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# MPC control

Use this skill for low-level, CPU-side control questions: selecting a supported robot or
runner, converting state and commands into 12 joint torques, configuring gaits/FSM
transitions, checking the `mpc_osqp` binding, or diagnosing controller data-shape
failures. Keep Isaac Gym lifecycle and Hydra/RSL-RL training in the linked neighboring
skills rather than reproducing them here.

## Route first

- Read [the API contract](references/api-reference.md) before constructing records or
  calling a runner. It is the source of truth for enum values, array shapes, frame
  conventions, and policy boundaries.
- Follow [the workflow](references/workflows.md) for install/build order, CPU smoke
  checks, gamepad-free operation, and the state-to-torque loop.
- Use [troubleshooting](references/troubleshooting.md) for extension import errors,
  malformed simulator records, unsafe FSM transitions, and policy/checkpoint failures.
- For package installation, compiler/dependency ordering, or backend diagnostics, route
  to [setup-and-diagnostics](../setup-and-diagnostics/SKILL.md).
- For simulator assets, DOF effort mode, rigid-body records, terrains, viewer loops, or
  Isaac Gym availability, route to [isaac-gym-simulation](../isaac-gym-simulation/SKILL.md).
  For policy training/configuration, route to [rl-training](../rl-training/SKILL.md).

## Operating contract

1. Select one of `RobotType.ALIENGO`, `RobotType.A1`, or `RobotType.GO1`, and construct
   `Quadruped(robot_type)`. Do not invent a fourth robot model; Mini Cheetah is not an
   enabled public enum. Preserve the model's four-leg, three-joint-per-leg ordering.
2. Select `ControllerType.FSM`, `ControllerType.MIN`, or `ControllerType.POLICY`.
   `RobotRunnerFSM` adds state transitions, `RobotRunnerMin` calls convex MPC directly,
   and `RobotRunnerPolicy` computes learned MPC weights before entering the FSM.
3. Call `runner.init(robot_type)` once, then call `runner.run(dof_states, body_states,
   commands)` once per control step. Reset between episodes with the runner's `reset()`.
   The result is a NumPy `float32` vector of exactly 12 torques, ordered as four
   consecutive three-joint leg blocks.
4. Keep the input representation consistent. Normal simulator mode uses structured
   DOF/body records; `Parameters.bridge_MPC_to_RL` changes the low-level MPC path to
   numeric arrays, but the policy runner still expects the structured DOF fields.
5. Commands begin with `[x_velocity, y_velocity, yaw_rate]`. Optional MPC weights must
   be nonnegative and have the exact documented length. A zero command is safe input,
   not an implicit request to enter locomotion.
6. Never claim a simulation or RL run is verified on an installation without Isaac Gym.
   CPU imports, model construction, gait arithmetic, and the solver binding are
   separately checkable; RL/simulation remains a required-backend block when that
   closed-source package cannot be imported.

## Controller boundaries

- `DesiredStateCommand` stores velocity/yaw commands and a 13-element MPC weight
  vector. `ConvexMPCLocomotion` chooses the gait, estimates contact/ground state,
  solves for stance forces, and fills swing/stance leg commands.
- `LegController` combines feed-forward force/torque, Cartesian PD, and joint PD through
  each leg Jacobian. `zeroCommand()` must precede each controller call so stale commands
  cannot survive a failed branch; `updateCommand()` is the torque boundary.
- FSM mode starts from `Parameters.control_mode`. In normal operation, recovery stand,
  passive, and locomotion transition through `ControlFSM`; safety checks can redirect
  unsafe locomotion to recovery. Test mode runs the current state without transition
  checks.
- The policy bridge is optional and heavyweight: it imports the RL/policy stack, needs a
  valid checkpoint and CUDA policy runtime, produces 12 scaled nonnegative weights, and
  appends the required thirteenth gravity-placeholder weight before MPC. It is not a
  substitute for the convex-MPC smoke test.

## Verification gate

Run the bundled `scripts/check_mpc_api.py` as a read-only API/extension probe. Treat an
extension import failure as a build/runtime diagnosis, not as evidence that the control
math is wrong. The prepared handoff passed Python 3.8, PyTorch 1.10/CUDA 11.3 on an
A100 allocation, package imports, `rsl_rl`, and `mpc_osqp`; Isaac Gym was unavailable,
so RL/simulation remains an explicit required-backend block. Do not run interactive
native demos or simulator tests as part of a CPU smoke check; they are deferred until
the required Isaac Gym backend is installed and verified. Keep review reports and test
fixtures outside this runtime subtree. Preserve this separation when handing the
controller to another application: API success is not a claim of gait stability, robot
safety, or sim-to-real readiness.

Files in this skill

  • SKILL.md5 KB
  • references/api-reference.md8.7 KB
  • references/troubleshooting.md6.6 KB
  • references/workflows.md5.6 KB
  • scripts/check_mpc_api.py4.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.