This implementation uses Eigen for linear algegra, Pinocchio for analytical derivatives, LCM for communications to low-level controllers, and boost for reading configuration files. A customized Hybrid-Systems DDP (HS-DDP) solver is employed to solve the nonlinear trajectory optimization problem.
-
Pinocchio 2.6.10: Folow the instructions here to install Pinocchio via robotpkg. As a reminder, do NOT forget configuring the environment variables, so that CMake can find Pinocchio while building.
-
./scripts/install_dependencies.sh
-
Note: By default, Pinocchio2 would install Eigen3.3.
Once Eigen and LCM are successfully installed, generate necessary lcm types
cd scripts
./make_types.sh
To build the MPC controller
mkdir build && cd build
cmake ..
make -j4
So far, you have built the CAFE-MPC controller. It has to function with a simulator and a whole-body controller.
We use Cheetah-Software for dynamics simulation. The Value-Based Whole-body controller is implemented in Cheetah-Software as well. To buld Cheetah-Software, you need to install dependencies with the following script
./install_dependencies_cheetah_software.sh
Clone the Cheetah-Software repo:
cd ..
git clone -b -b cafempc_low_level https://github.com/heli-sudoo/Cheetah-Software-He.git Cheetah-Software
Build Cheetah-Software:
cd Cheetah-Software/scripts
./make_types.sh
cd ..
mkdir build && cd build
cmake ..
make -j4
Open three terminals, one for simulation, one for low-level VWBC, and one for CAFE-MPC.
In the first terminal
cd Cheetah-Software/build
sim/sim
This opens two windows, one for simulation, the other one is a control panel.
In the second terminal,
user/MHPC_LLController/mhpc_llctrl m s
You will see the robot moves its legs to a zero configuration and stand up.
In the third terminal,
cd CAFE-MPC/build
MHPC/mhpc_run
In the control panel, switch the contrl_mode
to 2. You will see the robot starts performing locomotion.