Skip to content

isri-aist/BaselineWalkingController

Repository files navigation

Humanoid walking controller with various baseline methods

CI Documentation LICENSE Docker

HRP5P-BWC-WalkingStraightUnevenFloor-Cut-20221111.mp4
BaselineWalkingController-WalkingOnPlain-20220816.mp4
BaselineWalkingController-WalkingOnStairs-20220816.mp4

Features

  • Completely open source! (controller framework: mc_rtc, simulator: Choreonoid, sample robot model: JVRC1)
  • Full capabilities, including 3D walking, mass property error compensation of robot model, and integration with a footstep planner.
  • Easy to switch between various methods of centroidal trajectory generation for walking implemented in CentroidalControlCollection.
  • Easy to switch between the two frameworks for centroidal trajectory generation for walking: (1) closed-loop MPC and (2) open-loop MPC + stabilizer.
  • Support for a virtual robot whose model is publicly available so you can try out the controller right away.
  • Automated management with CI: Dynamics simulation is run on CI to verify robot walking, and a Docker image is released here with the latest version of the controller ready to run.

Quick trial on Docker

  1. (Skip if Docker is already installed.) Install Docker. See here for details.
$ sudo apt-get install ca-certificates curl gnupg lsb-release
$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

To enable GPUs in Docker (i.e., enable the --gpus option in the docker command), install nvidia-docker2. See here for details.

  1. By executing the following commands, the window of the dynamics simulator Choreonoid will open and the robot will walk. Close the Choreonoid window to exit.
$ docker pull ghcr.io/isri-aist/baseline_walking_controller:latest
$ xhost +local:
$ docker run --gpus all --rm -it \
  --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
  ghcr.io/isri-aist/baseline_walking_controller:latest ./walk_on_plane.bash
$ docker run --gpus all --rm -it \
  --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
  ghcr.io/isri-aist/baseline_walking_controller:latest ./walk_on_stairs.bash
  • Simulate walking with planning footstep sequence avoiding obstacles like in this video.
$ docker run --gpus all --rm -it \
  --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
  ghcr.io/isri-aist/baseline_walking_controller:latest ./walk_with_footstep_planner.bash

The Docker image is automatically updated on CI from this Dockerfile.

Technical details

This controller is a simple combination of the following existing typical elemental methods in the field of biped robotics:

  • CoM trajectory generation based on LIPM
  • ZMP feedback based on DCM
  • Wrench distribution
  • Foot damping control

For more information on the technical details, please see the following papers:

  • Papers listed in CentroidalControlCollection
  • Papers listed in ForceControlCollection
  • S Kajita, et al. Biped walking stabilization based on linear inverted pendulum tracking. IROS, 2010.
  • S Caron, et al. Stair climbing stabilization of the HRP-4 humanoid robot using whole-body admittance control. ICRA, 2019.

Install

Requirements

  • Compiler supporting C++17
  • Tested with Ubuntu 20.04 / ROS Noetic and Ubuntu 18.04 / ROS Melodic

Dependencies

This package depends on

This package also depends on the following packages. However, manual installation is unnecessary when this package is installed using wstool as described in Controller installation.

Preparation

  1. (Skip if ROS is already installed.) Install ROS. See here for details.
$ export ROS_DISTRO=melodic
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install ros-${ROS_DISTRO}-ros-base python-catkin-tools python-rosdep
  1. (Skip if mc_rtc is already installed.) Install mc_rtc. See here for details.
$ curl -1sLf 'https://dl.cloudsmith.io/public/mc-rtc/stable/setup.deb.sh' | sudo -E bash
$ sudo apt-get install libmc-rtc-dev mc-rtc-utils ros-${ROS_DISTRO}-mc-rtc-plugin ros-${ROS_DISTRO}-mc-rtc-rviz-panel libeigen-qld-dev

Controller installation

  1. Setup catkin workspace.
$ mkdir -p ~/ros/ws_bwc/src
$ cd ~/ros/ws_bwc
$ wstool init src
$ wstool set -t src isri-aist/BaselineWalkingController https://github.com/isri-aist/BaselineWalkingController --git -y
$ wstool update -t src isri-aist/BaselineWalkingController
$ wstool merge -t src src/isri-aist/BaselineWalkingController/depends.rosinstall
$ wstool update -t src
  1. Install dependent packages.
$ source /opt/ros/${ROS_DISTRO}/setup.bash
$ rosdep install -y -r --from-paths src --ignore-src
  1. Build a package.
$ catkin build baseline_walking_controller -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_QLD=ON --catkin-make-args all tests
  1. Setup controller
$ mkdir -p ~/.config/mc_rtc/controllers
$ cp ~/ros/ws_bwc/src/isri-aist/BaselineWalkingController/etc/mc_rtc.yaml ~/.config/mc_rtc/mc_rtc.yaml

Simulator installation

$ sudo apt-get install mc-state-observation jvrc-choreonoid

Simulation execution

# Terminal 1
$ source ~/ros/ws_bwc/devel/setup.bash
$ roscore
# Terminal 2
$ source ~/ros/ws_bwc/devel/setup.bash
$ cd /usr/share/hrpsys/samples/JVRC1
$ ./clear-omninames.sh
$ choreonoid sim_mc.cnoid --start-simulation
# Terminal 3
$ source ~/ros/ws_bwc/devel/setup.bash
$ roslaunch baseline_walking_controller display.launch

Controllers for motions beyond walking

The following controllers are based on or developed with the same philosophy as BaselineWalkingController.