ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A
Ask Your Question

Analyzing ROS messages

asked 2011-03-17 07:14:32 -0500

updated 2011-09-03 15:29:55 -0500

kwc gravatar image

Is there a command that will allow me to see what is stored in specific messages? I know rxgraph shows where everything is going but is there something similar to what is being sent?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2011-03-17 07:21:10 -0500

mkoval gravatar image

updated 2011-03-17 07:22:25 -0500

You can use rostopic to print the contents of a message to standard output. For example,

rostopic echo /camera/image_raw

will echo the full contents of the /camera/image_raw topic. If the message contains binary data, such as with Image, this will likely cause problems with your terminal emulator. In those cases it is useful to only echo the fields of interest:

rostopic echo /camera/image_raw/width /camera/image_raw/height

I don't believe that there is a graphical (rx...) analog rostopic.

edit flag offensive delete link more


Perhaps rviz would be the graphical analogy of rostopic?
Murph gravatar imageMurph ( 2011-03-17 08:06:42 -0500 )edit
Very good point. I never thought of RViz as a method of seeing the contents of a message, but that is its sole purpose.
mkoval gravatar imagemkoval ( 2011-03-17 09:47:12 -0500 )edit
The graphical version of "rostopic echo" is "rxplot".
joq gravatar imagejoq ( 2011-03-17 15:17:56 -0500 )edit

answered 2011-03-17 07:33:21 -0500

Eric Perko gravatar image

updated 2011-03-17 07:34:37 -0500

The rosmsg tool will show you all of the fields available for a given message type. For example, to see all of the fields available in the nav_msgs/Odometry message type, you would use the following:

rosmsg show nav_msgs/Odometry

Note that that page shows how you can use this to easily get the fields available on a given topic using something like:

rostopic type <topic_name> | rosmsg show
edit flag offensive delete link more

answered 2011-03-17 17:32:14 -0500

Tim Field gravatar image

rxbag --record /topic will allow you to see what's stored in messages published on a topic. You can view the contents textually, plot numerical values, or view image messages.

edit flag offensive delete link more


Cool, I didn't know you could record with rxbag, nor plot the data being recorded as it comes in!
Patrick Bouffard gravatar imagePatrick Bouffard ( 2011-03-17 18:39:00 -0500 )edit
How would you go around viewing those recorded messages textually, plotted, or image messages.
GeniusGeeko gravatar imageGeniusGeeko ( 2011-03-18 05:56:32 -0500 )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


Asked: 2011-03-17 07:14:32 -0500

Seen: 592 times

Last updated: Mar 17 '11