You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have a large numpy array that represents an std_msgs/Image.data
Today if I try to publish such a message it will fail in this part of the serialize function:
if type(_x) in [list, tuple]:
buff.write(struct.pack('<I%sB'%length, length, *_x))
else:
buff.write(struct.pack('<I%ss'%length, length, _x))
So I would have to to .tostring() or something which will do a copy (and then another copy in struct.pack).
I think that a check should be added if it's a memoryview (py3) or buffer (py2), and then only struct.pack the length, and then simply buff.write the object itself directly.
The text was updated successfully, but these errors were encountered:
Let's say I have a large numpy array that represents an std_msgs/Image.data
Today if I try to publish such a message it will fail in this part of the serialize function:
So I would have to to .tostring() or something which will do a copy (and then another copy in struct.pack).
I think that a check should be added if it's a memoryview (py3) or buffer (py2), and then only struct.pack the length, and then simply buff.write the object itself directly.
The text was updated successfully, but these errors were encountered: