Ask Your Question
0

How to filter tfs in a bag file

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

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 -0600

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 imagePoseidonius ( 2012-12-09 20:01:54 -0600 )edit

shouldn't it be :

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 1,206 times

Last updated: Dec 09 '12