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

record the topic of a special node between topics with same name

asked 2012-06-20 05:44:35 -0500

Antares gravatar image

I did not find the answer of this question anywhere. I rosrun openni_camera and openni_tracker simultaneously. I would like to use rosbag record /tf but only for openni_tracker topic but the problem is that openni_camera is also publishing another topic with the same name /tf. How can I tell rosbag to record only /tf topics published from my desired node?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-07-24 10:05:36 -0500

pgrice gravatar image

updated 2012-07-24 10:08:04 -0500

Here are two possible solutions to your problem:

1) Launch both the camera and tracker normally, and rosbag record /tf (as you've done), which will have all of the messages published to tf. You can then filter out unwanted messages using rosbag filter.

rosrun openni_tracker openni_tracker
rosbag record tf
rosbag filter [recorded_bag] [filtered_bag] "m.transforms[0].header.frame_id == '/openni_depth_frame'"

This will filter only messages with the '/openni_depth_frame' as the frame id (leaving only the skeleton frames, which are children of /openni_depth_frame).

2) Remap the tf output of the openni_tracker to a different topic, and then rosbag record that topic, which will contain only the transforms from the tracker node.

rosrun openni_tracker openni_tracker tf:=tracker_tf
rosbag record tracker_tf

In this case, the skeleton frames will not be published to /tf, and so will not be visualized in rviz as part of tf, if that is a concern.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-06-20 05:44:35 -0500

Seen: 592 times

Last updated: Jul 24 '12