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

Command-line tool to convert raw laser scan data to bag file data

asked 2011-11-21 19:56:04 -0500

alfa_80 gravatar image

I would like to convert raw laser scan data to bag file data, preferably, command-line one. Is there as such? By the way, I have tried to simply change the extension of the file straightaway to ".bag" from ".txt", unfortunately, it does not work.

edit retag flag offensive close merge delete


Could you please explain your problem a bit more? Where did you get the .txt file containing laser data? If I'm interpreting this correctly, you want to read from a text file and play that data into a bag file?
DimitriProsser gravatar image DimitriProsser  ( 2011-11-22 00:47:52 -0500 )edit
I want to use polar_scan_matcher ( that takes an input from a rosbag file. I got the textfile from somebody.
alfa_80 gravatar image alfa_80  ( 2011-11-22 00:52:36 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2011-11-23 02:03:44 -0500

DimitriProsser gravatar image

At present, I don't believe there is any such utility. The best bet would be to look in the rosbag API. What is the format of the .txt file?

edit flag offensive delete link more


The first 9 fields are fileds like ID, timestamp, roll, pitch, yaw etc and starting 10th field is laser scan value
alfa_80 gravatar image alfa_80  ( 2011-11-23 02:54:56 -0500 )edit

answered 2013-01-31 05:48:15 -0500

Tony C gravatar image

Hi all,

I wanted to know if alfa_80 eventually came across something that worked for him? I am in the same position at the moment. I have coded an algorithm (in C) and have used a freely available laser range finder data set from the RADISH repository.

I would like to use ROS and its libraries (specifically hector SLAM) to test the validity of my algorithm and to give my algorithm a base line to test against. However, in order to do this I need to convert my current data set into the ROS bag file format. My initial search has led me here.

I am new to the ROS environment and any assistance would be appreciated. Thanks in advance for the help.

edit flag offensive delete link more



There can't be anything generic, because that depends on the data format. However, if it is from radish, it might be a CARMEN log file. Maybe you can look for ROS code that supports that. In any case writing something that just parses text data and publishes that should be easy.

dornhege gravatar image dornhege  ( 2013-01-31 06:40:22 -0500 )edit

I didn't find such a tool, however, I did manage to just read the data from a text file and publish which is done in a ROS node. I think it's exactly what @dornhege meant too.

alfa_80 gravatar image alfa_80  ( 2013-02-01 00:06:00 -0500 )edit

Hi guys,

Firstly I would like to apologise for only replying now, I have had problems getting onto my email. Thanks for your suggestions, I will take them into consideration when looking at implementing my algorithm.

Tony C gravatar image Tony C  ( 2013-02-07 01:14:49 -0500 )edit

Question Tools

1 follower


Asked: 2011-11-21 19:56:04 -0500

Seen: 1,124 times

Last updated: Jan 31 '13