[ros-users] rosbag record a subset of tf

Brian Gerkey gerkey at willowgarage.com
Mon Aug 9 20:31:39 UTC 2010


On Mon, Aug 9, 2010 at 1:16 PM, Travis Deyle <beambot at gmail.com> wrote:
> I was just wondering: Is there a way to record a subset of the tf tree when
> doing 'rosbag record tf'?
>
> To provide a bit of context, I'm recording ~400 seconds of data.  The
> desired sensor readings occupy all of 500 kB, but the tf occupies upwards of
> 140 MB.  I only need a very small subset of the tf tree (not the whole PR2
> tf tree): /map, /base_link, etc.

One option is to filter the bag after recording it.  E.g., to get all
the non-tf messages, plus the tf messages for one particular transform
(in this case, odom_combined->base_footprint):

rosbag filter in.bag out.bag 'topic != "tf" or
m.transforms[0].header.frame_id == "odom_combined" and
m.transforms[0].child_frame_id == "base_footprint"'

If the transform of interest arrives in an array of length > 1 (e.g.,
from robot_state_publisher), then you'll have to do a little more
work.

	brian.



More information about the ros-users mailing list