ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# What is the COMM_TYPE in the simple message protocol?

When using the simple message protocol, messages that are sent contain a COMM_TYPE located in the header. According to the wiki page, this is an integer that identifies the communications type.

I can't really find any other information on this value. Between what types of communications does it choose? Does it choose between TCP and UDP? And what values can it have? Something like 0 for TCP and 1 for UDP?

Thx

edit retag close merge delete

Sort by » oldest newest most voted

Sorry I missed this one.

The values for comm_type are actually documented in the simple_message.h file in the simple_message package of the industrial_core stack (from here) :

enum CommType
{
INVALID = 0,
TOPIC = 1,
SERVICE_REQUEST = 2,
};


You can also find the defined values for the other parts of the header there.

Additionally, the simple_message package has been documented using Doxygen, which is automatically generated by the ROS buildfarm. You can access that documentation here, which is also accessible from the simple_message wiki page (top-right, Package Links, Code API). You'll want to open the page for the SimpleMessage class, which contains references to the StandardMsgTypes, CommTypes and the ReplyTypes used in the header.

Finally, defined values for the msg_type field are documented in REP-I0004.

Edit: you might also be interested in the simple_message Wireshark dissector.

more

Thank you for your awnser! Do I understand correctly that the COMM_TYPE not so much indicates what is expected as an awnser, but more so what is being send? For 1: info is being send over a 'topic', for 2: a request is given and somthing is expected back, for 3: a reply to something is being given?

( 2015-05-18 08:19:28 -0600 )edit

Well what is being sent sort-of directly determines what is expected and vice-versa. If you send a msg that is a topic, you won't get anything back. If it is a svc req, you'll get a reply. If you send a 'topic msg' with comm_type==svc req you'll get a reply back, as you set it to a svc req.

( 2015-05-18 08:30:21 -0600 )edit

I understand. Thank you. I'll mark this as best awnser.

( 2015-05-18 09:34:16 -0600 )edit

For people stumbling on this topic with the same question in the future, here is the awnser:

The COMM_TYPE indicates what the sender of the message expects as an awnser. Each value corresponds with a possible reply.

I have not been able to find what values exactly indicate what. But just for the sake of giving an example: 0 could indicate that the sender expects nothing back, 1 could indicate the sender expects a 'message received' message back, 2 could indicate the sender expects some kind of bigger reply with a value or other information. *Again: these values are not accurate, it's just an example!*

more