[ros-users] MD5 digest issue

Anthony Mallet anthony.mallet at laas.fr
Mon Aug 6 09:39:33 UTC 2012


To make a long story short, I have an issue with MD5 digest of messages (and
services, and actions from actionlib).

Consider the following to messages:
% cat a.msg
string a
% cat b.msg
string b

They end up having a different MD5 digest because the MD5 computation considers
the field name (here `a' or `b'), so they are not interchangeable.

I am trying to figure out a way to make them still appear compatible in every
possible context. Is it possible to do this in C++, for :
 - topics?
 - services?
 - actionlib?

Why I want to this is because I am trying to make a client able to dynamically
talk to different, unrelated servers. The client does not know at compile time
which of the message a or b it will use. Also, the two messages (or services,
or actions) are generated at compile time from another definition, so they
cannot be 'shared' by the different servers (of course, the messages `a' and
`b' are guaranteed to be compatible by other means).

What I am trying to achieve could be compared to function pointers. Consider
the two C functions.
  int a(int a);
  int b(int b);
You can define a generic function pointer int (*x)(int x) than can dynamically
be bound to `a' or `b', while still having the compiler check for
compatibility and reject non matching prototypes.

I am wondering if the MD5 computation isn't too constraining here, since the
two messages `a' and `b' are clearly compatible. The parameter names is, in
general, not relevant for the interface compatibility checks, as you can see
from the C function pointer example. Since there is a serialization between
clients and servers, the parameter names don't have to match on both sides.

So, would the MD5 digest not consider parameters names but just parameter
types, then I my issues would go away :)

Any thoughts on how to solve this issue?

More information about the ros-users mailing list