# Using Armadillo C++ library with ROS [closed]

Hello all!

So I am trying to use the armadillo library for my project with ROS. I installed armadillo on my computer (Ubuntu 12.04) using the commands

I then downloaded the armadillo package, and navigated to the "examples" folder. There, I typed "make" in the commandline to build the executables from the example files. I then ran an example which required LAPACK and BLAS (which I have installed a long time ago) to complete. This example ran perfectly. (Actually, the example calculated the inverse and determinant of a sample matrix A, which require LAPACK and BLAS to be installed). So far, so good.

Now I have a ROS package, which requires armadillo. I copied the file called "armadillo" and the folder called "armadillo bits" into the "include" folder of my ROS package. I then went into /include/armadillo_bits/config.hpp and configured LAPACK and BLAS by doing

#define ARMA_USE_LAPACK

#define ARMA_USE_BLAS

I then went back into the main package folder, and did "rosmake". Everything compiled fine. I then did

rosrun mypackage mypackage

and I get the following error:

error: svd(): use of LAPACK needs to be enabled

terminate called after throwing an instance of 'std::logic_error'
what():
Aborted (core dumped)


Apparently, the svd() function (which also needs LAPACK and BLAS like the inverse and determinant functions) cannot detect LAPACK. This is weird, because it worked with the example file in the armadillo "examples" folder.

I have a feeling that I am not linking to the right libraries, and there is something fishy going on. How do I get Armadillo to work inside a ROS package, the same way I got it to work inside the "examples" folder in the armadillo folder?

All help is greatly appreciated.

Thanks!

Nishant

edit retag reopen merge delete

### Closed for the following reason question is not relevant or outdated by tfoote close date 2014-10-28 00:12:37.616604

Sort by » oldest newest most voted

Oh, I got it. There are 2(very similar) ways to do this:

#include <armadillo>


put

#include </usr/include/armadillo>


2) You can also use the library that you copied into the "include" folder of your package, by doing

#include <../include/armadillo>


Both seem to work. Can anyone else suggest any other method? It would be nice to know these things.

Thanks!

Nishant

more