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

How to filter rosbag of LaserScan and tf based on travelled distance?

asked 2013-10-28 17:13:47 -0600

cognitiveRobot gravatar image

Hi there,

I need ur help. I recorded a rosbag which contains LaserScan and tf for gmapping. How can i filter out some LaserScan and tf based on robot's travelled distance(or distance between two consecutive scanning point)?

Regards Hossain

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-11-10 19:46:18 -0600

Artem gravatar image

The other option is to create a filtered bag file that only contains those topics that you are interested. See http://wiki.ros.org/rosbag/Tutorials/Producing%20filtered%20bag%20files

So basically, you have to list all topics and messages that you want to keep.

A quick example

rosbag filter <your bagfile> filtered_bag.bag 'topic == "/robot/topic1" and  topic == "/robot/topic2"''
edit flag offensive delete link more

Comments

hi Art and Tfoote, thanks. I don't want to filter topics instead i want to filter data from same topic. e.g. i want to save laserScan only when robot moves 50 cm from previous scanning point. any thoughts?

cognitiveRobot gravatar image cognitiveRobot  ( 2013-11-11 14:50:34 -0600 )edit
0

answered 2013-11-10 19:29:27 -0600

tfoote gravatar image

You can write a script to iterate over the messages in the bag and do whatever filtering you want. See the rosbag Code API

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-10-28 17:13:47 -0600

Seen: 446 times

Last updated: Nov 10 '13