AGENT SKILL

mpc-control

Operate the CPU-side quadruped convex MPC controller, its robot/state/command interfaces, gait and FSM runners, policy bridge, and compiled solver extension.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
mpc-control
license
MIT
metadata
{ "disco-role": "operating" }
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

02 资源文件 4

03 SKILL.md 正文

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 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 for install/build order, CPU smoke checks, gamepad-free operation, and the state-to-torque loop.
  • Use troubleshooting 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.
  • For simulator assets, DOF effort mode, rigid-body records, terrains, viewer loops, or Isaac Gym availability, route to isaac-gym-simulation. For policy training/configuration, route to rl-training.

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.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351