ros-perception / image_common

Common code for working with images in ROS

Home Page:http://www.ros.org/wiki/image_common

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ROS2] error output when advertising publisher

wodtko opened this issue · comments

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...

Relates to #249

Fixed by #249.