Ask Your Question

How to echo to multiple topics at once

asked 2016-10-13 09:42:24 -0500

Cerin gravatar image

Is it possible to use rostopic to echo multiple topics at once?

I have a node that's consuming a lot of CPU, and I'm not sure why. It publishes a dozen topics, so to help debug, I tried to do:

rostopic echo /mynode/*

but of course, rostopic told me the topic "/mynode/*" doesn't exist.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-10-13 11:45:57 -0500

Mark Rose gravatar image

You can open multiple terminal windows/tabs and use rostopic echo in each one, or you spawn multiple copies of rostopic, all echoing to the console.

rostopic echo /nodename/topic1 & rostopic echo /nodename/topic2 & rostopic echo /nodename/topic3 & ...

But you might find it more useful to use rostopic hz or rostopic bw to see the publish rate or bandwidth for some of these topics. It may be more likely that your main loop is publishing faster than you need. Are you using a rospy.Rate to publish at regular intervals, as in this rospy tutorial? (For the C++ code counterpart see this tutorial.)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-10-13 09:42:24 -0500

Seen: 2,179 times

Last updated: Oct 13 '16