Robotics StackExchange | Archived questions

How to import rosbag API into an C++ Project

Hello to all,

Currently I am working on a project and we need to extract data from a bagfile and process it.

After my research i found that the rosbag API could be used for my purpose.

I have a general idea of how to code what I want by using the API but my problem comes on how can import it into my project.

QUESTION: What should I do to be able to use the rosbag API in my project?

Basically i cannot #include <rosbag/bag.h> in my project so I cannot use any functionality of the API.

I tried to write this in the CMakeList.txt of my C++ project in CLion but it gives an error on the compilation because it cannot find the packages.

find_package(catkin REQUIRED COMPONENTS
  rosbag   rosconsole roscpp   roslib   sensor_msgs  std_msgs )

Is there a guide or some information about how to do it?m

Asked by gmongar on 2018-12-05 05:40:32 UTC

Comments

i cannot #include <rosbag/bag.h> in my project

why not?

Asked by gvdhoorn on 2018-12-05 07:21:22 UTC

If this is about CLion configuration, then you may be interested in ROS Setup Tutorial.

Asked by gvdhoorn on 2018-12-05 07:22:38 UTC

Answers

Okay, After some investigation I discovered why. CLion has to be opened directly from the shell instead of open it in the desktop.

Asked by gmongar on 2018-12-05 07:43:02 UTC

Comments