Is it possible to parse the fields and values of a custom ros msg binary file in python without knowing the message definition?
I have stored several files which contain the serialized binary data from custom ros messages. Now I'm attempting to parse the data in those files from a python script that knows nothing about the message definition or ros's messaging system at all, is this possible?
Do you have just the binary stream (ie: exchanged by two nodes after negotiation), or also the topic/service negotiation data?
I have is the binary stream which was generated with ros::serialization::serialize from the message object, as well as .msg file definition.
You mean you want to do the de-serialization yourself, without having to import custom_msg.msg? If yes you would be re-doing what genpy does. look at https://github.com/ros/genpy/blob/kin...
afakih yes that's what I meant, thanks for the link. It isn't obvious to me from looking at that genpy code how I would de-serialize binary data from a custom message.
You would need to do something similar to what's is in 'msg_generator` function which generates python code from the .msg. To load the .msg into a MsgSpec you would need something similar to https://github.com/ros/genmsg/blob/in...
I do have the definition message file (an MyMsg.msg file) and several other files with serialized data generated from instances of my custom message. The libraries you pointed to allow you to create a MsgSpec instance but it doesn't look like there's a way of filling it with the serialized data.