This is an attempt to create a simple Whole Body Controller from scratch. The controller is highly inspired from the works:
- Bouyarmane, K., Caron, Stéphane, Escande, A., & Kheddar, A., Multi-contact motion planning and control, In A. Goswami, & P. Vadakkepat (Eds.), Humanoid Robotics: A Reference (pp. 1763–1804) (2019). Dordrecht: Springer Netherlands.
- Salini, J., Barthélemy, Sébastien, Bidaud, P., & Padois, V., Whole-body motion synthesis with lqp-based controller – application to icub, In K. Mombaur, & K. Berns (Eds.), Modeling, Simulation and Optimization of Bipedal Walking (pp. 199–210) (2013). Berlin, Heidelberg: Springer Berlin Heidelberg.
This controller makes use of the excellent osqp QP solver and the osqp-eigen C++ interface.
This repository ships with a Dockerfile
to create a fully functional
image ready to be used. To create it, run this command while being
inside this repo:
docker build -t ros_talos .
This will create an image with the name ros_talos
. To launch it, do
it with the script provided:
./run_container.sh
This script includes this repo inside the catkin workspace. That way
you can modify the controller from the host. You may need to run these
commands with sudo
, depending on how docker
is set up in your
machine.
To access the container, open your browser and go to
localhost:6080
. You should be able to view the container’s desktop
after a few seconds.
Read the Compiling and How to use sections to learn how to compile the workspace and run the controller inside a simulation.
The raw installation was tested on Debian Stretch (9), using ROS Melodic. Install the Talos simulation environment from the oficial ROS page. Also, you will need to install the Pinocchio library. To do so, follow these instructions. Also, do not forget to clone this repo inside your workspace!
Alternatively, you can have a look to the Dockerfile
and use it as a
reference, but that should not be necessary.
Make sure you have the package python-catkin-tools
installed. Then, in your catkin workspace, run:
catkin build --force-cmake -DCATKIN_ENABLE_TESTING=false
The first step is to launch the Gazebo physics simulator:
roslaunch talos_gazebo talos_gazebo.launch
We can now load our controller:
roslaunch talos_wbc_controller talos_trajectory_wbc_controller.launch
The robot will remain still, waiting for a trajectory to follow. You
can change the QP formulation parameters at any time using rqt
:
rosrun rqt_reconfigure rqt_reconfigure
The controller is waiting for trajectories to be sent to the
/talos_trajectory_wbc_controller/command
topic. The message type is
talos_wbc_controller::JointContactTrajectory
, and can send joint and
center of mass trajectories, as well as link contacts with the world.
Trajectories can be generated in advance using any planning
framework. Those trajectories then have to be formulated as a
JointContactTrajectory
.
Using this fork of towr and the package xpp_talos
, simple
walking gaits can be generated and sent to this controller. This
trajectory generator is already installed in the Docker image. If
using a raw installation, you’ll have to clone it in the workspace and
build it. To launch the trajectory generator environment, run:
roslaunch towr_ros towr_ros.launch
By default, the trajectory generated will have only two steps, one for each foot. So it is a good idea to have the goal moved near the initial position of the robot.
Every trajectory generated is automatically saved to
~/.ros/towr_trajectory.bag
. To send the trajectory to the
controller, use the node talos_contact_traj
as follows:
rosrun xpp_talos talos_contact_traj
You should be able to see the robot trying to follow the trajectory in Gazebo.