[ros-users] [Discourse.ros.org] [Next Generation ROS] Discussion about how to add a new PRIMITIVE_TYPES to rosidl(msg)

Zongpei Jiang ros.discourse at gmail.com
Thu Apr 26 04:00:13 UTC 2018



> Maybe you can elaborate what exactly you are trying to achieve

when I use `cv_bridge` in ros2 , the img_msg is turned into `list` in python , but the `cv_bridge` needs a `byte` type when transform the `img_msg.data` into `cv2` img type .  
(the `img_msg.data` is `uint8 []` and is turned into `list` after transform)

So we rewrite the `genorator_py` in `rosidl` to make the uint8 turn into `byte` type , and it works well

but to avoid effecting other algorithm which using uint8 as well in pyhton , we want to create a `new_uint8[]` for a new msg type like `new_imagemsg` so that we don't need to transform all `uint8[]` to bytes , but only in some special situations (like using cv_bridge) , we can use the new message type and get the byte type instead of list . and other algorithm can still receive the `image_msg.data` as `list` type

So i just want to know whether this idea can work , and how to make it .

I'm trying to rewrite the python-end in rosidl and build a new primitive type maybe use dtype() ? and a new msg_type and try to analyze the type





---
[Visit Topic](https://discourse.ros.org/t/discussion-about-how-to-add-a-new-primitive-types-to-rosidl-msg/4607/3) or reply to this email to respond.




More information about the ros-users mailing list