[ros-users] [Discourse.ros.org] [Next Generation ROS] Discussion about uint8[] type transport in ROS2 python

Zongpei Jiang ros.discourse at gmail.com
Sat Apr 28 05:56:28 UTC 2018



Hi , I'm trying to start a discussion about what type should uint8[] be converted to

Background:

    In ROS1 , `uint8[]` is transported into `string` while other `uint` is transported to `list` .
    In Ros 2 , all the `uint` types are transported into list.
    But in our tests , we find that when we transport the images using uint8 , the `list` type shows high latency , cause the transport to `list` takes a lot of time
    So we changed some codes and transport the `uint8` type to `bytes` and test again , the result is much better

Test comparison result:

     copy data in  cpp to `list` : 10ms
     transport 2M image in ROS2 in type `list` in python : 270ms
     copy data in cpp tp 'byte' : 0-1ms
     transport 2M image in ROS2 using cv_bridge in type 'bytes' in python : 10ms

issue description :

     In our program , low time latency is very important , and bytes is more suitable in python too . 
     So whether it's better to let the `uint8`` type convert to `bytes` instead of `list` in ROS2.
      (Just like in ROS)

Our attempts

     1. change the code in rosidl to make `uint8` convert to `bytes`` directly
     2. trying to add a new Primitive type like `imguint8` to convert to `bytes` and `uint8` is still  `list` , but i have some problems in codes
          
link to the [attempt 2](https://discourse.ros.org/t/discussion-about-how-to-add-a-new-primitive-types-to-rosidl-msg/4607/6)

Opinion Invitation:
     @dirk-thomas 
     @marguedas 


 Appreciating your opinion !





---
[Visit Topic](https://discourse.ros.org/t/discussion-about-uint8-type-transport-in-ros2-python/4633/1) or reply to this email to respond.




More information about the ros-users mailing list