Is the .msg in memory format the same for ROS1 and ROS2?
If I defined some some type FOO, with members X and Y, will the in memory structure generated from .msg "rosidl" be the same as the the in memory structure generated from the rosidl_dds generated .idl? That is, if I do pointer math like (void) myfoo.X - (void) myfoo.Y will I get the same answer in ROS1 and ROS2?
I understand that there are wire format differences, but does the DDS version basically wrap the ROS1 version, such that if I get a pointer to my FOO, I can pass it to the same function regardless of which transport we use?
Realize this is pretty basic, so appreciate the help and patience!
I don't understand what
(void) myfoo.X - (void) myfoo.Y
should do, are you calculating an offset into the message structure?It was just my lame way of saying that the byte layout of the structure was the same. It may not have been a helpful clarification. :)
Ok, that's fine. I don't think the byte layout will be the same, since some of the types have changed (
byte
is now unsigned, andtime
andduration
are now messages, not built-in types). You can compare the ROS 1 with the ROS 2: http://design.ros2.org/articles/inter...It looks like the primitive types like byte/char/uint8/uint16, etc are all the same, so maybe as long as the messages are expressed using the those primitives, the structures would be the same.
But if the "time" type has a different layout in ros2, then I would not expect those to be compatible.