simROS2 icon indicating copy to clipboard operation
simROS2 copied to clipboard

Interface for sensor_msgs/msg/CameraInfo needs also sensor_msgs/msg/RegionOfInterest

Open fspindle opened this issue 2 years ago • 1 comments

This is more a feature request than an issue.

I'm running Ubuntu 22.04 LTS with ROS2 humble.

When adding sensor_msgs/msg/CameraInfo message to meta/interface.txt build fails:

$ colcon build --symlink-install --packages-select sim_ros2_interface
Starting >>> sim_ros2_interface
[Processing: sim_ros2_interface]                             
[Processing: sim_ros2_interface]                                     
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
[Processing: sim_ros2_interface]                                       
--- stderr: sim_ros2_interface                                         
/home/fspindle/colcon_ws/build/sim_ros2_interface/generated/callbacks.cpp: In function ‘void write__sensor_msgs__msg__CameraInfo(const CameraInfo&, int, const ROS2WriteOptions*)’:
/home/fspindle/colcon_ws/build/sim_ros2_interface/generated/callbacks.cpp:1457:13: error: ‘write__sensor_msgs__msg__RegionOfInterest’ was not declared in this scope; did you mean ‘DEPRECATED__sensor_msgs__msg__RegionOfInterest’?
 1457 |             write__sensor_msgs__msg__RegionOfInterest(msg.roi, stack, opt);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |             DEPRECATED__sensor_msgs__msg__RegionOfInterest
/home/fspindle/colcon_ws/build/sim_ros2_interface/generated/callbacks.cpp: In function ‘void read__sensor_msgs__msg__CameraInfo(int, sensor_msgs::msg::CameraInfo*, const ROS2ReadOptions*)’:
/home/fspindle/colcon_ws/build/sim_ros2_interface/generated/callbacks.cpp:1673:25: error: ‘read__sensor_msgs__msg__RegionOfInterest’ was not declared in this scope; did you mean ‘DEPRECATED__sensor_msgs__msg__RegionOfInterest’?
 1673 |                         read__sensor_msgs__msg__RegionOfInterest(stack, &(msg->roi), opt);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                         DEPRECATED__sensor_msgs__msg__RegionOfInterest
gmake[2]: *** [CMakeFiles/simExtROS2.dir/build.make:227: CMakeFiles/simExtROS2.dir/generated/callbacks.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:164: CMakeFiles/simExtROS2.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< sim_ros2_interface [6min 27s, exited with code 2]

Summary: 0 packages finished [6min 27s]
  1 package failed: sim_ros2_interface
  1 package had stderr output: sim_ros2_interface

The trick is to add also sensor_msgs/msg/RegionOfInterest to meta/interface.txt the make the build succeed.

I didn't investigate so far, but as an end user, it could be interesting that in your mechanism you find a way to add automatically the dependencies of a given message.

fspindle avatar Oct 20 '22 12:10 fspindle