ros2 msg field name reservations
I tried to use the followin self-defined msg
interface:
# MyInterface.msg
MyHeader header
and
# MyHeader.msg
uint8 id
Point3f origin
it looks like the field name header
in MyInterface.msg
is reserved,
the msg
package could be built successful, but when i use the msg
to initialize a subscription
by
sub_ = this->create_subscription<my_interface::msg::MyHeader>("stub_topic", 10, std::bind(&ClassNmae::sub_cb, this, _1));
and I got errors when build:
...
/opt/ros/galactic/include/libstatistics_collector/topic_statistics_collector/received_message_age.hpp:79:33: error: ‘const _header_type’ {aka ‘const struct my_interface::msg::MyHeader_<std::allocator<void> >’} has no member named ‘stamp’
79 | const auto stamp = m.header.stamp;
| ~~~~~~~~~^~~~~
...
by changing header
to a more regular word like my_header
, the error disappeared.
my question is:
- is this a
field name reservation
related issues? - if it is, where can i find some official docs explain about this?
i have refered to http://design.ros2.org/articles/inter...
but only found limited informations and no direct clues about my question.
can i have some help? thx