ros-perception / image_common

Common code for working with images in ROS
http://www.ros.org/wiki/image_common
125 stars 220 forks source link

[ROS2] error output when advertising publisher #240

Closed wodtko closed 2 years ago

wodtko commented 2 years ago

The function PublisherPlugin::advertiseImpl was extended to support PublisherOptions with the last update. If a child class does not override this function, an error message is generated and the advertise function without PublisherOptions is called instead.

However, the "default" image_transport::advertise function always creates PublisherOptions leading to error messages, even if the PublisherOptions are not required. I would suggest using std::optional<rclcpp::PublisherOptions> in order to differentiate between options being required or not. By this, the fitting advertiseImpl function can be called respectively. Error messages are then only produced if the new option is explicitly required.

UPDATE: Sorry for updating this issue quite often... I couldn't see the reason for having the advertiseImplWithOptions functions, however, after multiple tests, I think I got it...

gbiggs commented 2 years ago

Relates to #249

gbiggs commented 2 years ago

Fixed by #249.