This is an extension package for the NASA Astrobee project which allows MPC with Acados.
This assumes you have the astrobee software already installed and built.
- Clone this repo in a suitable directory, e.g.
cd $ASTROBEE_WS/src/gnc
git clone https://github.com/DISCOWER/ctl_acados_mpc.git
cd ctl_acados_mpc
-
Now wee need to install acados. First run
git submodule update --recursive --init -
Make a build directory and install acados. You can choose which solvers you would like to use with optional flags
cd acados
mkdir -p build
cd build
cmake .. # with optional arguments e.g. -DACADOS_WITH_DAQP=OFF/ON -DACADOS_INSTALL_DIR=<path_to_acados_installation_folder>
make install
-
In case you want to rebuild the c-code for the MPC (e.g. with a different QP solver, different horizon): Install the python interface with pip:
pip install -e ./interfaces/acados_templateNote that some parameters can be changed online (costs, state tolerances, inertia and mass) -
Add the compiled shared library paths to the following variables:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"<acados_root>/lib"
export ACADOS_SOURCE_DIR="<acados_root>"
- Build this package by running
catkin build --this --no-deps
-
Open 2 terminals, go to your
$ASTROBEE_WSand runsource devel/setup.bashon each -
In the first terminal, launch the astrobee. E.g. for a simulation, do
roslaunch astrobee astrobee_sim.launch. Check out the launch files for available settings -
In the second terminal, you can send the astrobee on a mission! E.g. run:
rosrun executive teleop_tool -move -relative -pos "0 -1 0"
-
Open
/solver/generate_solver.pyand tune the settings to your liking. Then runpython generate_solver.py -
Re-build the package. You can do this by making sure you are in the package root folder (e.g.
$ASTROBEE_WS/gnc/ctl_acados_mpc) and runningcatkin build --this --no-deps
A special thanks to Pedro Roque for instights, bug-fixing help and code contribution in the CMakeLists.txt.