humanoid-control  by pocketxjl

Humanoid bipedal walking control repo using NMPC and WBC

created 1 year ago
350 stars

Top 80.6% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a framework for humanoid bipedal walking control, leveraging Nonlinear Model Predictive Control (NMPC) and Whole Body Control (WBC) with simulation capabilities in MuJoCo. It is targeted at researchers and engineers working on advanced legged robot locomotion.

How It Works

The system employs a hierarchical control structure. A foot planner, implemented as an OCS2 switch model, manages foot contact states and plans swing foot trajectories using cubic splines. A linear Kalman filter estimates the robot's state, prioritizing measurements from the supporting foot. The core control loop utilizes NMPC, formulated as an optimization problem solved via multiple shooting and Sequential Quadratic Programming (SQP), to generate optimal centroidal momentum, joint positions, and contact forces. This is complemented by WBC, which optimizes accelerations and torques at each time step to satisfy various tasks and constraints, including friction cones and torque limits. A PD controller then executes the computed torques.

Quick Start & Requirements

  • Installation: Requires cloning OCS2, pinocchio, hpp-fcl, and ocs2_robotic_assets. Dependencies include liburdfdom-dev, liboctomap-dev, libassimp-dev. Compilation is done via catkin build ocs2_legged_robot_ros with CMAKE_BUILD_TYPE=RelWithDebInfo. MuJoCo is installed via pip3 install mujoco. pynput and scipy are also required.
  • Running: Simulation with a cheat state estimator: roslaunch humanoid_controllers load_cheat_controller.launch. With a normal state estimator: roslaunch humanoid_controllers load_normal_controller.launch. NMPC module only: roslaunch humanoid_dummy legged_robot_sqp.launch.
  • Resources: Compilation can take approximately ten minutes.

Highlighted Details

  • NMPC operates at 100Hz, with Model Reference Tracking (MRT) and WBC at 500Hz.
  • The state estimator uses a linear Kalman filter, distrusting swinging foot measurements.
  • NMPC formulation uses centroidal dynamics, with state including centroidal momentum and generalized coordinates.
  • WBC defines tasks as cost or constraint functions, solved using qpOASES.

Maintenance & Community

  • The project acknowledges contributions from legged-control and hunter-bipedal-control for their NMPC/WBC frameworks and pai-sim for MuJoCo simulation.

Licensing & Compatibility

  • The repository's license is not explicitly stated in the README. OCS2 and pinocchio are typically under BSD-style licenses, which are permissive for commercial use.

Limitations & Caveats

  • The README notes that the provided video demonstration uses an older version of the code, and actual results may vary. Code optimization to RelWithDebInfo is crucial for performance.
Health Check
Last commit

7 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
31 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.