[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
Wed Apr 25 08:00:20 UTC 2018



Hi , I'm working on adding a new type (e.g. `new_uint8`) to `PRIMITIVE_TYPES` in `rosidl` , cause i want to do some extra operations on the `uint8[]` data but i don't want to effect the original `uint8` type

For example , in rosidl/rosidl_generator_py/resource/_msg_support.c.em , i can change the `new_uint8` type to `bytes` instead of `list` when i received  the msgs

I have looked some relative codes , and i find this in ` rosidl/rosidl_parser/rosidl_parser/__init__.py`


> PRIMITIVE_TYPES = [
    'bool',
    'byte',
    'char',
    # TODO reconsider wchar
    'float32',
    'float64',
    'int8',
    'uint8',
    'int16',
    'uint16',
    'int32',
    'uint32',
    'int64',
    'uint64',
    'string',
    # TODO reconsider wstring / u16string / u32string
    # TODO duration and time
    'duration',  # for compatibility only
    'time',  # for compatibility only
]

So i guess it's possible to add a new type

But i don't know whether there are other codes i need to consider , besides the `rosidl_parser` and  `/rosidl_generator_py/resource/_msg_support.c.em`

Looking forward to some suggestions !
Thanks !





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




More information about the ros-users mailing list