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

Revision history [back]

click to hide/show revision 1
initial version

For command line usage you can run rostopic info <topic-name> and that will show the message type along with other information. Here's an example with just roscore running.

$ rostopic info /rosout
Type: rosgraph_msgs/Log

Publishers: None

Subscribers: 
 * /rosout (http://127.0.0.1:41588/)

Notice the section that says

Type: rosgraph_msgs/Log

this shows that this topic carries messages of the type rosgraph_msgs/Log. You can read more about this on the wiki.

For command line usage you can run rostopic info <topic-name> and that will show the message type along with other information. Here's an example with just roscore running.

$ rostopic info /rosout
Type: rosgraph_msgs/Log

Publishers: None

Subscribers: 
 * /rosout (http://127.0.0.1:41588/)

Notice the section that says

Type: rosgraph_msgs/Log

this shows that this topic carries messages of the type rosgraph_msgs/Log. You can read more about this on the wiki.


Edit:

As @gvdhoorn pointed out in the comments, a great shortcut is

rostopic type /my_topic | rosmsg show

which will then show (from my above example)

byte DEBUG=1
byte INFO=2
byte WARN=4
byte ERROR=8
byte FATAL=16
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
byte level
string name
string msg
string file
string function
uint32 line
string[] topics

which gives the definition of the message.

For command line usage you can run rostopic info <topic-name> and that will show the message type along with other information. Here's an example with just roscore running.

$ rostopic info /rosout
Type: rosgraph_msgs/Log

Publishers: None

Subscribers: 
 * /rosout (http://127.0.0.1:41588/)

Notice the section that says

Type: rosgraph_msgs/Log

this shows that this topic carries messages of the type rosgraph_msgs/Log. You can read more about this on the wiki.


Edit:

As @gvdhoorn pointed out in the comments, a great shortcut is

rostopic type /my_topic | rosmsg show

which will then show (from my above example)

$ rostopic type /rosout | rosmsg show

byte DEBUG=1
byte INFO=2
byte WARN=4
byte ERROR=8
byte FATAL=16
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
byte level
string name
string msg
string file
string function
uint32 line
string[] topics

which gives the definition of the message.