-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Image (and other) messages to use byte[]
rather than uint8[]
#55
Comments
Implementation consideration: evaluate how this plays with current ROS1 serialization of these messages and detail potential additional work to be able to keep bridging such messages over the |
Related to ros2/rosidl#190 |
Hello, i tried to make a ByteImage (by copying Image and changing uint8 to byte) to get faster python IO but i still get a List in python.. i think bytes --> byte[] is only for conversion from python, not conversion to python..; See also ros2/rosidl#276 Frank |
@kervel As I understand it, when you say "still creates a python list" this is presumably a python list of There are two options I might suggest:
This issue is only for the first. Personally I'd be in favour of both, but I thought I'd create the issue for the much easier and less controversial first option. It's more likely to get implemented, it's still a win (as far as I can tell), and it doesn't preclude also going for the second option at a later date. |
@johnmarkwayve indeed. i should check what exactly would be the gain, now i was under the assumption that most time would be spent in traversing linked lists (i'll try to find out). Frank |
In the scope of ros2/design#190 the mapping of |
Change request
In the
Image
,CompressedImage
, andPointCloud2
messages there aredata
fields that have typeuint8[]
. I suggest these are chaged tobyte[]
.Change description
According to the wiki,
uint8
is interpreted as a pythonint
, whereasbyte
is interpreted as a pythonbyte
. For the messages where arrays ofuint8
are used, it's normally because the data is some arbitrary binary format. Currently, it seems thatrclpy
takes this binary data, copies it out into alist[int]
, which client code then normally converts back to some collection ofbyte
types for use. This is much more processing and copying than is necessary.This should also somewhat mitigate this issue, as no range check will be necessary.
Implementation considerations
I can think of no cons of this change
connects to ros2/rosidl#190
The text was updated successfully, but these errors were encountered: