Ask Your Question
0

What is the COMM_TYPE in the simple message protocol?

asked 2015-04-13 04:15:41 -0600

Gengoz gravatar image

updated 2015-05-18 07:45:00 -0600

gvdhoorn gravatar image

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 flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-05-18 07:43:57 -0600

gvdhoorn gravatar image

updated 2015-05-19 01:56:07 -0600

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,
  SERVICE_REPLY = 3
};

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.

edit flag offensive delete link more

Comments

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?

Gengoz gravatar imageGengoz ( 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.

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

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

Gengoz gravatar imageGengoz ( 2015-05-18 09:34:16 -0600 )edit
0

answered 2015-05-18 04:49:05 -0600

Gengoz gravatar image

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!*

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

2 followers

Stats

Asked: 2015-04-13 04:15:41 -0600

Seen: 279 times

Last updated: May 19 '15