ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to import rosbag API into an C++ Project

asked 2018-12-05 04:40:32 -0600

gmongar gravatar image

updated 2018-12-05 06:43:31 -0600

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

edit retag flag offensive close merge delete


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

why not?

gvdhoorn gravatar image gvdhoorn  ( 2018-12-05 06:21:22 -0600 )edit

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

gvdhoorn gravatar image gvdhoorn  ( 2018-12-05 06:22:38 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-05 06:43:02 -0600

gmongar gravatar image

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

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-12-05 04:40:32 -0600

Seen: 582 times

Last updated: Dec 05 '18