Ask Your Question
1

filtering and republishing topic messages from console

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

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

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
2

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

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

Comments

wonderful.

Pablo Iñigo Blasco gravatar imagePablo Iñigo Blasco ( 2013-01-05 12:31:20 -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-31 03:07:20 -0600

Seen: 1,142 times

Last updated: Jan 03 '13