rosidl icon indicating copy to clipboard operation
rosidl copied to clipboard

Make message name available as a ``constexpr`` in type traits.

Open adityapande-1995 opened this issue 1 year ago • 0 comments

Feature request

Feature description

Currently, in rosidl message type traits, there is no way to access the name of the message as a constexpr. The :name() function provides a const char* access to the name, which is not the same as constexpr.

This feature is needed when writing pythind typecasters. The macro PYBIND11_TYPE_CASTER(cpp::msg::type, const_name(msg_name)) requires access to a constexpr msg_name which is not the same as const char*. That name is an optional argument and is used as a docstring internally, but it would be nice to have it populated.

Implementation considerations

We could add a new global member like : constexpr const char[] complete_name = "geometry_msgs/msg/Quaternion";

adityapande-1995 avatar Mar 30 '23 21:03 adityapande-1995