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

Message MD5 generation

asked 2015-01-21 05:10:42 -0600

updated 2015-01-21 08:22:45 -0600

Hi all,

for my ROS project I need to get MD5 checksum of messages from their .msg files. Following documentation this should be quite simple. I just get the .msg file with:

  • comments and whitespace removed;
  • package names of dependencies removed;
  • constants reordered ahead of other declarations;
  • MD5 text of dependency concatenated,

and calculate MD5 on it.

So, for std_msgs/String, the MD5 should be calculated on:


and the MD5 be:


Instead the generated message in my Hydro installation has MD5 (rosmsg md5 std_msgs/String):


Can one help me to understand what is wrong?

Thanks a lot Alessandro


See and

Thanks to gvdhorn!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-21 06:05:33 -0600

gvdhoorn gravatar image

updated 2015-02-02 09:06:55 -0600

Not a real answer, but have you perhaps considered using genmsg for this? See genmsg/test/ for some examples.

Edit: just to be complete:

msg_context = genmsg.msg_loader.MsgContext.create_default()
full_type_name = genmsg.gentools.compute_full_type_name(package_name, os.path.basename(input_file))
spec = genmsg.msg_loader.load_msg_from_file(msg_context, input_file, full_type_name)
search_path = genmsg.command_line.includepath_to_dict(include_path)
genmsg.msg_loader.load_depends(msg_context, spec, search_path)

md5sum = genmsg.gentools.compute_md5(msg_context, spec)

Mostly creative copy/paste from the genmsg package.

edit flag offensive delete link more


Update: rosmg md5 $pkg/$msg should also work.

gvdhoorn gravatar image gvdhoorn  ( 2018-06-09 05:49:34 -0600 )edit

Question Tools

1 follower


Asked: 2015-01-21 05:10:42 -0600

Seen: 2,053 times

Last updated: Feb 02 '15