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

can rosbag API be use on Ros Fuerte?

asked 2012-10-14 19:08:00 -0600

Brioche gravatar image

Hi all,

I would like to save some points cloud from my kinect using the rosbag, but when I'm just trying to do basic write and read rosbags (not even point cloud) like in this tutorial, I've got this error undefined reference to rosbag::Bag::Bag() and it's for the declaration of my rosbag rosbag::Bag bag.

Maybe it's the way I'm using it (in the main of my node), I really don't know. I did the include of rosbag/bag.h (and rosbag/view.h but not really useful yet) and I don't see what the problem, I'm pretty sure it's obvious so forgive me.

When I'm reading the CookBook or Code API I don't understand how I should use the rosbag in my code.

Thank you for your help,

Brioche

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2012-10-14 22:29:16 -0600

Lorenz gravatar image

It seems like your linker flags do not include rosbag. Just add

<depend package="rosbag" />

in your manifest.xml file.

edit flag offensive delete link more

Comments

Thanks a lot, this line was missing.

Brioche gravatar image Brioche  ( 2012-10-15 18:10:23 -0600 )edit
0

answered 2012-10-15 18:45:10 -0600

Brioche gravatar image

updated 2012-10-15 18:46:53 -0600

I don't want to create a new question just for this question: Is the method open create the bag file?

because when I do (just before my while loop)

rosbag::Bag bag;

    bag.open("test.bag", rosbag::bagmode::Write);

    std_msgs::String str;
    str.data = std::string("foo");

    std_msgs::Int32 i;
    i.data = 42;

    bag.write("chatter", ros::Time::now(), str);
    bag.write("numbers", ros::Time::now(), i);

    bag.close();

I don't have any test.bag file in my rosbag folder (I've just created)...

Thanks for your help

edit flag offensive delete link more

Comments

I think you should have created a new question for this. Answers should really be used for answering things, not for subsequent questions, not for discussion and not for comments. This is not a forum. bag.open should create a new bag. Try specifying an absolute path.

Lorenz gravatar image Lorenz  ( 2012-10-15 20:55:55 -0600 )edit

Ok, sorry and thanks for your answer

Brioche gravatar image Brioche  ( 2012-10-16 13:25:42 -0600 )edit

Question Tools

Stats

Asked: 2012-10-14 19:08:00 -0600

Seen: 543 times

Last updated: Oct 15 '12