0
$\begingroup$

Rosanswers logo

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.


Originally posted by Pablo Iñigo Blasco on ROS Answers with karma: 2982 on 2012-12-31

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

Originally posted by joq with karma: 25443 on 2013-01-03

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Pablo Iñigo Blasco on 2013-01-05:
wonderful.

Comment by CroCo on 2023-05-25:
Is it possible to do from the code (i.e. C++)?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.