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

How can i save data into bag file so that i can perform gmapping?

asked 2016-07-15 13:20:04 -0500

krishna43 gravatar image

I am trying to save data into bag file to run gmapping later. I don't want to do it through command line using rosbag, rather i want to write a python script to save the data into bag file.

I tried saving just Laserscan messages into bag file by following this tutorial and it worked like charm. :)

But in order to simulate gmapping i have to save data from multiple topics i.e /tf and /scan ,so i tried using message filters to scan data from both tf and scan, but it always throwing me errors.

I think most people saved the data into bag file before, to simulate gmapping. Can someone tell me how they did it?

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-07-15 16:06:15 -0500

Chrissi gravatar image

It would help if you'd post the error and and give short code snippet. However, I think you are trying to reinvent the wheel and I am pretty sure that the vast majority of people used the commandline tool to save data for gemapping. rosbag does exactly what you want to do when you start it from the command line and is well tested even thought it might have its flaws. If you want to start recording bag files from a python script, have a look at the subprocess package in python. This allows you to run rosbag record from the python script instead of the command line and you do not have to reimplementing its functionality.

edit flag offensive delete link more

Comments

Thank you. I found how i can include rosbag record commands in launch file.

krishna43 gravatar image krishna43  ( 2016-07-15 16:29:35 -0500 )edit

If that also works for you, even better ;)

Chrissi gravatar image Chrissi  ( 2016-07-15 16:35:32 -0500 )edit

Question Tools

Stats

Asked: 2016-07-15 13:20:04 -0500

Seen: 616 times

Last updated: Jul 15 '16