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

filtering and republishing topic messages from console

asked 2012-12-31 03:07:20 -0500

updated 2012-12-31 03:38:34 -0500

I'm looking for a fast and easy way to republish data of a topic filtered in another new topic. I see that implementing a filter could be an interesting alternative. However it needs too much developing infraestructure (pluginlib, a package, some c++ code, etc.). I wonder if there is something simpler like the rostopic echo tool:

rostopic echo  /topic_name --filter "{predicate}"

It should be something like this:

rostopic dup /input_topic /output_topic --filter "{predicate}" 

In my case I want it to use in combination with rxplot. For instance, reading the tf messages fields filtering by the field: child_frame_id.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2013-01-03 13:01:00 -0500

joq gravatar image

Looking at the rostopic documentation, it appears that you can pipe filtered echo data into a rostopic pub command to do what you want:

$ rostopic echo /topic_name --filter "{predicate}" | rostopic pub /output_topic tf/tfMessage
edit flag offensive delete link more



Pablo Iñigo Blasco gravatar image Pablo Iñigo Blasco  ( 2013-01-05 12:31:20 -0500 )edit

Is it possible to do from the code (i.e. C++)?

CroCo gravatar image CroCo  ( 2023-05-25 10:42:09 -0500 )edit

Question Tools


Asked: 2012-12-31 03:07:20 -0500

Seen: 1,695 times

Last updated: Jan 03 '13