Ask Your Question
1

How to import files to ROS package with catkin?

asked 2014-03-26 09:06:38 -0500

chet gravatar image

updated 2014-03-26 09:06:57 -0500

This is my first ROS package and I think this is a pretty easy question but I'm not sure how to most appropriately do this:

I am trying to build a ROS package with GTSAM: borg.cc.gatech.edu/download

which requires Boost C++ to be installed: sourceforge.net/projects/boost/files/boost/1.55.0/

Both libraries are installed in my /usr/local/ directory. I'd like to use these libraries in my ROS package but I'm not sure the proper way of doing so. Should I just #include as usual and have a readme saying to install these libraries before using this ROS package? Or should include the installation in my ROS package directory?

Sorry for the noob question and thanks for the help.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2014-03-26 10:14:24 -0500

ahendrix gravatar image

You'll want to declare dependencies on both packages in your package.xml, and then use the find_package() command in CMake to locate them and add the appropriate include directories and libraries to your project.

There's a fairly good catkin build on how to declare and use external dependencies: http://docs.ros.org/hydro/api/catkin/...

It looks like GTSAM is already a CMake package, so you should be able to use find_package with it without issues. I did a quick google search and found someone at Georgia Tech doing this from rosbuild: https://code.google.com/p/gt-ros-pkg/... ; you'll probably need to change the rosbuild macros to normal cmake macros, but otherwise you should be able to do something similar.

Since you're installed GTSAM from source, and most of the other people that use your package will probably do the same thing, you may not want to declare your dependency on gtsam in your package.xml ; this will prevent the ROS tools from trying to verify that it's installed, which is difficult to do for source packages.

If you do get to a point where you'd like to release your package to the ROS build farm, you'll probably want to get the GTSAM maintainers to release it as a plain CMake package into ROS. This is fairly easily done through Bloom.

Side notes on Boost:

  • ROS depends on Boost. You may hit issues if you try to compile against a different version of Boost than the rest of ROS.
  • If you're on a Mac and have Boost installed through homebrew, you should be fine with the usual procedure. You'll be using the same version of Boost that the rest of ROS.
  • If you're on a different system, you'll probably hit issues if you're trying to depend on a different version of Boost than the rest of ROS.
  • If you don't need any of the features in the latest version of Boost, I would strongly suggest trying to use the system version of Boost
  • If you REALLY need a newer version of Boost, you can try to build all of ROS from source against the newer version to avoid version conflicts.
edit flag offensive delete link more
0

answered 2014-03-26 09:57:32 -0500

Wolf gravatar image

You can embed external lib packages using standard cmake (find_package, include_directories and target_link_libraries). I think both mentioned packages provide a " config.cmake" file. If these files are in the CMAKE_PREFIX_PATH they can be found just like it is described for the OpenCV package in the answer of this question: http://answers.ros.org/question/12324...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-03-26 09:06:38 -0500

Seen: 1,333 times

Last updated: Mar 26 '14