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

Search for topics with specific message

asked 2015-05-12 09:29:25 -0600

panos gravatar image


My question is the following:

Suppose I have a list of topics and each topic publishes a message of type messageType.

Is there a command that allows me output the all messageTypes that are currently being published?

I know "rostopic info -topicname" will give me information as well as the message a specific topic outputs. Is there a wildcard like rostopic info * that lets me see all the messages that are currently being published?

Thank you in advance,


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-05-12 13:52:53 -0600

I don't know of a built-in command that does exactly what you want, but you could always combine rostopic outputs using standard command line tools (piping, xargs, etc.).

For example, to get the detailed information about every topic, you could run:

rostopic list |xargs -n 1 rostopic info

Or you could combine with grep:

rostopic list |grep robot |xargs -n 1 rostopic info
edit flag offensive delete link more

answered 2015-05-13 05:13:47 -0600

gvdhoorn gravatar image

If you want to avoid calling command line binaries (which can become tricky depending on the state of your shell / system), you should probably take a look at the ROS Master API. I think especially getTopicTypes(..) and getSystemState(..) should be helpful.

edit flag offensive delete link more

Question Tools



Asked: 2015-05-12 09:29:25 -0600

Seen: 2,249 times

Last updated: May 13 '15