Skip to content

Install on Ubuntu 16.04 LTS with ROS Kinetic

Bárbara Barros Carlos edited this page Jul 6, 2024 · 3 revisions
  1. Install ROS Kinetic (recommended: “Desktop-Full Install”) following these instructions.

  2. We work with Catkin Command Line Tools to build packages in the workspace. They can be installed with apt-get following these instructions.

  3. Setup your catkin workspace:

$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src/
$ catkin_init_workspace
$ cd ~/catkin_ws/
$ catkin build
$ source devel/setup.bash
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
  1. Clone the crazyflie_nmpc project into your catkin workspace:
$ cd ~/catkin_ws/src/
$ git clone https://github.com/bcbarbara/crazyflie_nmpc
  1. Initialize all submodules:
$ cd ~/catkin_ws/src/crazyflie_nmpc/acados/
$ git submodule update --init --recursive
  1. Build and install acados:
$ mkdir -p build
$ cd build
$ cmake -DACADOS_WITH_QPOASES=ON .. # add more optional arguments e.g. -DACADOS_WITH_OSQP=OFF/ON -DACADOS_INSTALL_DIR=<path_to_acados_installation_folder> above
$ make install -j4
  1. Install acados Python interface. Recommended: Create a Python virtual environment using venv:
$ python3 -m venv env
$ source env/bin/activate # source the environment
$ cd ~/catkin_ws/src/crazyflie_nmpc/acados/interfaces/acados_template/
$ pip3 install -e
  1. Add the path to the compiled shared libraries libacados.so, libblasfeo.so, libhpipm.so to LD_LIBRARY_PATH (default path is <acados_root/lib>) by including these lines to your .bashrc/.zshrc:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"<acados_root>/lib"
export ACADOS_SOURCE_DIR="<acados_root>"
  1. Now you are able to generate the RTI instance tailored for the crazyflie NMPC in the scripts folder:
$ cd ~/catkin_ws/src/crazyflie_nmpc/crazyflie_controller/scripts/crazyflie_full_model/
$ python3 generate_c_code.py
  1. Then use the catkin build command to compile your workspace.