Use numpy.array's "offset" param instead of slicing
Passing an offset into numpy.array instead of slicing should prevent an additional copy of the data being created by the slice operation. This is important for really big message types like OccupancyGrids.
Documentation of the offset parameter: http://docs.scipy.org/doc/numpy/reference/generated/numpy.frombuffer.html
@dirk-thomas, any thoughts on this?
It would be great to improve the performance of this by avoiding the extra copy.
The current patch breaks the public API (introducing the offset argument in the middle of other positional arguments). Can you please change that to something non-breaking, e.g. an optional keyword argument?
I haven't checked how well this code path is covered by a unit test. If not could you please also add a unit test to ensure the new feature doesn't break in the future?
If anyone is interested enough in this feature to update the PR with the above comments that would be highly appreciated?
I wasn't aware that genpy, and especially unpack_numpy was part of the public API of ROS. I'll update the PR.