Robotics StackExchange | Archived questions

msg wire format rules unclear

I've read through http://wiki.ros.org/msg. I have the following questions:

Example - assume:

int8 small
float64[] values
string text

An in-memory POD representation would have:

<int8: 1 byte>
<padding: 3 bytes for minimum uint32 alignment>
<uint32 count of values>
<values[0]>
<values[1]>
....
<uint32 text strlen>
<uint8*  "content of text">

under the above assumptions we'd have on the wire:

<1 byte int8>
<4 bytes little-endian, count>
<8 bytes IEEE754 double, repeated <count> times>
<4 bytes little-endian, strlen(text)>
<uint8 *  "content of text">

is this correct?

[thanks Gijs! that helps with the padding/alignment/byte-order questions

If I may add to my question:]

There seems to be a handshaking mechanism involving a checksum of the message descriptor - looks like it is part of the setup phase. Is it possible to derive the message type from the checksum offered by a peer at runtime? (background: runtime introspection)

example - use case would be a generic client which could "do the right thing" subject to what it learns in the connection establishment phase:

Is the message type fixed at connection establishment time (my guess), or is there any provision to convey different message formats over a given stream?

thanks in advance, Michael

Asked by haberlerm on 2016-01-15 12:52:52 UTC

Comments

Not an answer, but you may be interested in the TCPROS Wireshark dissector that was added in v2 recently.

Asked by gvdhoorn on 2016-01-16 02:57:16 UTC

Answers