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

topic transmits messages of same type ?

asked 2017-02-03 08:27:41 -0500

sam26 gravatar image

updated 2017-02-03 08:28:12 -0500

It could be a very basic doubt but has been bugging me for quite sometime. When messages are being transmitted on a topic , is it necessary that all these messages are of same message type ? else md5 sum has to be checked for every message that the publisher sends

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-02-03 09:12:19 -0500

gvdhoorn gravatar image

updated 2017-02-03 09:49:21 -0500

When messages are being transmitted on a topic , is it necessary that all these messages are of same message type

Yes. In fact, it's enforced.


Edit:

will md5 sum remain same on a topic ?

yes.

or does it change with each message although they are of same type?

The MD5 of a message is calculated as follows (from wiki/ROS/Technical Overview - Message serialization and msg MD5 sums):

For reference, this MD5 sum is calculated from the MD5 text of the .msg file, where the MD5 text is the .msg text with:

  • comments removed
  • whitespace removed
  • package names of dependencies removed
  • constants reordered ahead of other declarations

In order to catch changes that occur in embedded message types, the MD5 text is concatenated with the MD5 text of each of the embedded types, in the order that they appear.

So, provided that the type never changes, and message contents or values are not considered: no, the MD5 sum never changes.

edit flag offensive delete link more

Comments

In such a case , will md5 sum remain same on a topic ? or does it change with each message although they are of same type?

sam26 gravatar image sam26  ( 2017-02-03 09:29:23 -0500 )edit

Btw: I'm more than happy to keep answering your questions, and I admire your inquisitive nature, but seeing as you happen to be asking questions about parts of ROS that are actually rather well documented (not something we can universally claim), you might want to search the wiki a bit yourself.

gvdhoorn gravatar image gvdhoorn  ( 2017-02-03 09:53:43 -0500 )edit

Pardon me.As the documentation is exhaustive,I keep getting lost in it looking for a particular answers. But I have checked with turtlesim simulator as an example and found that each .msg file could contain one or more msg types,however,md5 checksum remains unique for a msg type.Thank you very much!

sam26 gravatar image sam26  ( 2017-02-03 10:02:23 -0500 )edit

Pardon me.

No need. As I said, it's not a problem, but it might save you some time waiting for others to answer you.

As the documentation is exhaustive

I must say that this is not something I hear many (beginning) users say about ROS ;)

gvdhoorn gravatar image gvdhoorn  ( 2017-02-03 10:05:16 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2017-02-03 08:27:41 -0500

Seen: 183 times

Last updated: Feb 03 '17