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

How to filter tfs in a bag file

asked 2012-12-09 14:13:30 -0500

Poseidonius gravatar image

Hi,

I got a bag file that includes a huge number of a certain tf message. I want to filter out this special message, but all other tf should not be considered? How can I filter out just all tf messages with a certain frame_id and child_frame_id?

Something like

rosbag filter source.bag filtered.bag 'topic!="\tf" or m.transforms[0].header.child_frame_id != "odom"'

does not work and generates an error message (as expected)

AttributeError: '_std_msgs__Header' object has no attribute 'child_frame_id'

Thanks for your help

Poseidonius

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-12-09 17:11:39 -0500

mmedvede gravatar image

Try

rosbag filter source.bag filtered.bag 'topic!="\tf" or m.transforms[0].child_frame_id != "odom"

child_frame_id is not in a header. This should fix the error you get.

edit flag offensive delete link more

Comments

I should not work at night! Stupid error! Thanks to Mikail!

Poseidonius gravatar image Poseidonius  ( 2012-12-09 20:01:54 -0500 )edit

shouldn't it be :

rosbag filter source.bag filtered.bag 'topic!="/tf" or m.transforms[0].child_frame_id != "odom"
Hafez Farazi gravatar image Hafez Farazi  ( 2016-08-29 10:34:24 -0500 )edit

Question Tools

Stats

Asked: 2012-12-09 14:13:30 -0500

Seen: 1,743 times

Last updated: Dec 09 '12