Link Eigen Library with ROS - eigen

I am a newbie working on ROS Hydro. Most of my codes are based on the Eigen library. I have already installed the library by below codes:
sudo apt-get install libeigen3-dev
Now I can find a eigen folder in /opt/ros/hydro/include/Eigen and another folder under /usr/include/eigen3. From what I saw online, this should suggest my installation success.
However, when I build ros package by catkin_make, it reports error that no Eigen/Dense file or directory. I did what this post suggests and it works:
Using Eigen Library in ROS Indigo
However, this needs me to edit the CmakeLists.txt for every package, to include eigen library and link targets. Is there a more convenient way to set the libraries so that it can work for all my future codes without me touching every CmakeLists for all my packages? Thanks for any answers in advance!

Related

gtsam is not able to find Eigen

I use version 4.1.1 of GTSAM. I have version 3.3.4 of Eigen installed.
The error is:
/usr/local/include/gtsam/base/OptionalJacobian.h:22:10: fatal error: Eigen/Dense: No such file or directory
#include <Eigen/Dense>
I tried building GTSAM with the flag -DGTSAM_USE_SYSTEM_EIGEN set to both on and off.
The same error message appears in both cases.
For reference this is a ROS project built with catkin.
Have you seen this PR: https://github.com/borglab/gtsam/pull/1304
If you can upgrade GTSAM to 4.2a8, it uses Eigen's find script's rather than custom ones and should properly find Eigen3, if you have it installed if you require to build from source.
Since you are using ROS, why not go the standard route... Have you declared a dependency on it in your package.xml and installed it with rosdep?
https://github.com/ros/rosdistro/pull/23198/files
Add to your package.xml:
<depend>gtsam</depend>
And, your CMakeLists, you just call
find_package(gtsam REQUIRED)
It is unclear to me, if gtsam is available through binaries, why you would be building it from source.
I was able to get it working by cloning version 4.0.3 of GTSAM into the src folder of my workspace, then building it with the following arguments:
-DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_POSE3_EXPMAP=ON -DGTSAM_ROT3_EXPMAP=ON

Errors while installing/using dlib for use with Eclipse CDT, MinGW and OpenCV

I use Eclipse Neon CDT with MinGW. I have CMake at my disposal.
I want to work with dlib and OpenCV in Eclipse CDT, and be able to compile my project just by clicking on the 'Build' button, without having to leave Eclipse, if possible.
I am working on a project that requires both OpenCV and dlib. I've successfully installed OpenCV and tested it with some programs to make sure it works. However, I'm having problems using dlib.
I used CMake gui to Configure/Generate,mingw32-make and mingw32-make install commands to set up my dlib library. This library was at C:/Program Files/Project and contained three folders include, lib and share
I started a new Project in Eclipse CDT and set my include paths to C:/Program Files/Project/include and added the following libraries (all .dll files)-
gdi32, comctl32, user32, winmm, ws2_32, imm32
When I went ahead and copy/pasted the code from the example file, face-landmark-detection-ex.cpp and tried to build it, the Build Console displayed these errors.
These are the statements that caused the errors -
image_window win, win_faces; (line 34),
win.clear(); (line 52) and
win.add_overlay(render_face_detections(shapes)); (line 54)
I don't know if it's relevant, but when I tried the method mentioned, in the answer of this question, the build was successful and the executable worked, but I couldn't include OpenCV headers and libs this way, so I had to look for other solutions.
Did you look at the instructions on dlib's how to compile page?
Compiling C++ Examples Without CMake
In most cases, to use this library all you have to do is extract it
somewhere, make sure the folder containing the dlib folder is in your
include path, and finally add dlib/all/source.cpp to your project.
It doesn't sound like you added dlib/all/source.cpp to your project.

How to install Boost on Windows 7 with VS

So I am trying for whole day to integrate Boost with Visual Studio (2008) on Windows 7.
I firstly I went twice trough this How to use Boost in Visual Studio 2010.
I searched over all (there are at least 3 of them) simiral topics and none of them worked.
Some people proposed using this one : www.boostpro.com/download/ but link is not active.
Someone proposed to change runtime library to Multi-threaded DLL but is also didnt work.
I just try to include #include <boost/thread.hpp> and got this error
fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-s-1_53.lib'.
Before installing Boost the error was that it cannot find the thread.hpp so it seems like the Boost is installed somewhat correctly.
The problem is that the libraries were not build while I was using the tutorial. How can I build them manually?
There's no such thing like one-click boost install, you still need to do something manually. In your case it seems you need to compile Boost.Thread library and then add directory where resulting .lib file is to your library path. The link you provided looks pretty good. If you followed it probably you already built Boost.Thread. Make sure you did #6 from the second part.
There are prebuild binaries - installation packages:
http://sourceforge.net/projects/boost/files/boost-binaries/1.53.0/
Use this command:
bjam --build-dir=build-directory toolset=toolset-name --build-type=complete stage
this build the libraries manually. Then add the new directory to additional libraries path
as it is indicated in this link:
http://www.boost.org/doc/libs/1_43_0/more/getting_started/windows.html#or-build-binaries-from-source
I found this article quite helpful:
http://www.codeproject.com/Articles/11597/Building-Boost-libraries-for-Visual-Studio
The article explains how to build the build tool BJam (mainly by locating the boostrapper.bat)
How to build the libraries, e.g. bjam toolset=msvc-11.0 variant=debug threading=multi link=static (in this case the VS2012 multi-threaded, statically linked debug version).
It also features build batches, but I haven't tried them.
It has some additional information on how to specifiy the used C-Runtime

libRInside.a an empty file

I'm trying to compile the qtdensity example from the RInside examples folder, using Qt, Windows 7, R 32bit.
I have followed all the instructions posted online on how to set up these tools since my ultimate goal is to develop a C++/R application in Qt.
When I try to build the project I get the following error:
E:\dev\R-2.15.2\library\RInside\lib\i386\libRInside.a:-1: error: file not recognized: File truncated
Indeed, the libRInside.a file is empty as well as the libRInside.dll file in the same folder.
I have installed, uninstalled, installed again the RInside package using the install.packages("RInside", type="source") command.
The same problem does not occur with the Rcpp package, installed the same way.
I would greatly appreciate any insights on this. I've recently started with C++ and as a result it has taken me a lot of effort to set up everything so far.
Thank you!
Laura
Not sure what I did wrong but I solved it by copy-paste the same files from the archive available at the CRAN page of RInside

Help on installing a library like libical into Xcode

I would like to use the libical library in my project, but I have never used an external library before. I have downloaded the libical files, but I am pretty much stuck there. I do not how how, or even if, I need to build/extract them and then how to get them into Xcode. Any help would be greatly appreciated. Thank you.
If this a pre-built library then you can just drag it into your Xcode project (or use Project => Add to Project…) in the same way that you would for source/header files.
If it's not pre-built then you'll need to build it for whatever environments and architecture you want to target. If it comes with an Xcode project then this is easy. If it's just the usual open source type of distribution then you usually do something like this:
$ ./configure
$ ./make
$ sudo ./make install
That will typically put the built library(ies) and header(s) into somewhere like /usr/local/lib and /usr/local/include. In your main Xcode project you can then just add these header(s) and library(ies) to your project.
Note that if you're cross-compiling, e.g. for iPhone, then you'll need to add some flags to the ./configure command so that you target the correct architecture, e.g. ./configure -build=arm-apple-darwin9.0.0d1.
Note also that it's usually a good idea to check MacPorts to see if they have already fixed up a given open source project for Mac OS X - this can save you a lot of work.
See also this blog about building and using libical on iPhone.
Getting libical to configure and build for arm is more tricky then ./configure -build=arm-apple-darwin.
See this question and answer for more details: Compiling libical

Resources