Robotics StackExchange | Archived questions

Is it mandatory to include the 'stamp' variable in the 'header' variable in custom IDL?

Hi~

Using a variable called 'header' in msg IDL without a sub-variable called `stamp' and creating a subscription with rclcpp seems to cause a build break. Is this part of the intention? (tested with galactic)

It seems that there is a template in libstatisticscollector/topicstatisticscollector/receivedmessage_age.hpp that accesses header.stamp, causing a build break.

/opt/ros/galactic/include/libstatistics_collector/topic_statistics_collector/received_message_age.hpp:108:59:   required from ‘void libstatistics_collector::topic_statistics_collector::ReceivedMessageAgeCollector<T>::OnMessageReceived(const T&, rcl_time_point_value_t) [with T = foros_msgs::msg::Inspector_<std::allocator<void> >; rcl_time_point_value_t = long int]’
/opt/ros/galactic/include/libstatistics_collector/topic_statistics_collector/received_message_age.hpp:104:8:   required from here
/opt/ros/galactic/include/libstatistics_collector/topic_statistics_collector/received_message_age.hpp:79:33: error: request for member ‘stamp’ in ‘m.foros_msgs::msg::Inspector_<std::allocator<void> >::header’, which is of non-class type ‘const _header_type’ {aka ‘const unsigned char’}
   79 |     const auto stamp = m.header.stamp;
      |                        ~~~~~~~~~^~~~~
make[2]: *** [CMakeFiles/foros_inspector.dir/build.make:76: CMakeFiles/foros_inspector.dir/src/inspector.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/foros_inspector.dir/all] Error 2

Asked by huchijwk on 2022-11-04 01:54:22 UTC

Comments

Answers