Ask Your Question
1

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:

stringdata

and the MD5 be:

cb6d1e784571bbf6f218efb801675fb6

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

992ce8a1687cec8c8bd883ec73ca41d1

Can one help me to understand what is wrong?

Thanks a lot Alessandro

EDITED

See https://github.com/ros/genmsg/blob/in... and https://github.com/ros/genmsg/blob/in...

Thanks to gvdhorn!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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/test_genmsg_gentools.py 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

Comments

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 1,701 times

Last updated: Feb 02 '15