How to - gsilano/crazyflie_nmpc GitHub Wiki
Install on Ubuntu 16.04 LTS with ROS Kinetic
-
Install ROS Kinetic (recommended: “Desktop-Full Install”) following these instructions.
-
We work with Catkin Command Line Tools to build packages in the workspace. They can be installed with apt-get following these instructions.
-
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
- Clone the
crazyflie_nmpcproject into your catkin workspace:
$ cd ~/catkin_ws/src/
$ git clone https://github.com/bcbarbara/crazyflie_nmpc
- Initialize all submodules:
$ cd acados/
$ git submodule update --init --recursive
- Build and install
acados:
$ make -j4
Note Set the appropriate
BLASFEO_TARGETandHPIPM_TARGETvia<acados_root>/Makefile.localfile. For a list of supported targets, we refer to the BLASFEO documentation. It is also recommended to add the flagACADOS_WITH_QPOASES=1to theMakefile.local.
- Install
acadosPython interface with Python 3.6
$ cd ~/catkin_ws/src/crazyflie_nmpc/acados/interfaces/acados_template/
$ pip3 install .
- In order to be able to successfully render C code templates, you need to download the
t_rendererbinaries for your platform from here and place them in<acados_root>/bin.
Note Please strip the version and platform from the binaries (e.g.
t_renderer-v0.0.20 -> t_renderer).
Note Notice that you might need to make
t_rendererexecutable.
-
Run
export ACADOS_SOURCE_DIR=<acados_root>such that the location of acados will be known to the Python package at run time. -
Additionally, you will have to make sure that the environment variable
LD_LIBRARY_PATHcontains the path tolibacados.so(default path is<acados_root/lib>). -
Now you are able to generate the RTI instance tailored for the crazyflie NMPC in the
scriptsfolder:
$ cd ~/catkin_ws/src/crazyflie_nmpc/crazyflie_controller/scripts/crazyflie_full_model/
$ python3 generate_c_code.py
- Then use the
catkin buildcommand to compile your workspace.