Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It's true, the documentation contradicts itself for most data types. If data_offset is in bytes, then the indexing scheme described in B only applies to byte arrays.

If data_offset truly were in bytes, then it would take more complicated bitwise arithmetic to index into the array, particularly if offset were unaligned. The comment on line A should probably be changed to something like "Number of padding entries at front of data".

Of course, before changing the documentation, it might be good to understand how downstream packages are using MultiArrayLayout and if they consider data_offset to count bytes or words, but again I suspect that few users of std_msgs are doing the proper bitshifting necessary to accomodate byte padding for 32 or 64-bit int types.

Can you ticket this issue on https://github.com/ros/std_msgs? Thanks.