Closed stonier closed 10 years ago
uint8[] is designated for binary data in ROS. So I don't think ros would serialise it twice. PointCloud2 is good usecase which uses uint8[] to compress as binary format.
http://wiki.ros.org/msg http://docs.ros.org/api/sensor_msgs/html/msg/PointCloud2.html
There will still be some serialization done even for a uint8[]
data field as it will have to (at the very least) accompany those uint8 bytes with a number indicating how large the array is. But at least there will be no float -> uint8 or string -> uint8 conversions going on.
The issue here is that we would be manually converting some arbitrary 'msg' into a uint8[]
byte array, setting that as the field of a message that interacts with the warehouse.
rostopic echo
) yaml strings.Well... as by now I'm just playing with very lightweight messages, using any approach don't make a difference. Serializing/deserializing with Python is just trivial, and fast (underlying C implementation). For introspection, both server and client can publish the messages, so is not a good advantage to allow doing so with the serialized messages. What we can do is, once we have heavy annotations (i.e. with images, or meshes) prepare a testbench to measure both serializing/deserializing and bandwith.
Seems the uint8 data type is quite widely used. The data_link_toolkit also uses this when setting up their aggregating relays.
Conclusion - we're using uint8. We can close this question @corot?
yes, we can :v:
Which is faster, better?
Isn't serialising into bytearrays redundant? You serialise into bytearray, then ros serialises it again.