ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
0

Using rosbag c++ code API

asked 2013-02-13 03:48:36 -0500

Josch gravatar image

updated 2014-01-28 17:15:13 -0500

ngrennan gravatar image

Hello everyone,

I am trying to use the rosbag C++ code API in my own node. For that I need to refer to the rosbag sources (rosbag::Bag etc.). By default only the binaries from rosbag were installed. So I cloned the ros_comm git into my local ros stack ros_comm. Now the stack contains the src files, but I still can't refer to them in my eclipse project for the node.

Where do I have to put the source files from rosbag to let Eclipse and the maker recognize them?

One solution would be to include them via their absolute path, but don't feel like this would be a good solution.

Best regards, Josch

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-02-13 08:32:35 -0500

Lorenz gravatar image

The rosbag package installs not only the binaries but also the header files and the libraries. Just add a dependency on rosbag in your CMakeLists.txt and link against the rosbag library. You should not download the sourcecode and add it manually.

edit flag offensive delete link more

Comments

I didn't think it would be that easy. The solution was even more simple: I just had to add the rosbag dependency to my manifest.xml file. Everything working fine now, thanks!

Josch gravatar imageJosch ( 2013-02-13 20:57:21 -0500 )edit

Can I get an ELI5? I do "locate CMakeLists.txt" and there are literally hundreds of them. Which one do I add the dependency too?

acollins gravatar imageacollins ( 2017-06-07 11:33:38 -0500 )edit

Your Answer

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

Add Answer

The deadline to submit a proposal to present at ROSCon 2017 is June 25, 2017. Submit yours now!

Question Tools

Stats

Asked: 2013-02-13 03:48:36 -0500

Seen: 456 times

Last updated: Feb 13 '13