Closed jacobperron closed 3 years ago
So, the logic introduced in c62b3a1 uncovered an integer overflow bug in rclcpp::Duration
. This PR depends on https://github.com/ros2/rclcpp/pull/1584 for QoS matching to work properly. Specifically, setting a deadline (or lifespan) with a value larger than INT32_MAX (which is the default value) doesn't work.
I've updated the design doc to reflect the implementation.
Specifically, this change introduces a
WaitForQosHandler
class used for deferring topic bridge creation. It creates a thread for each topic bridge to wait for at least one publisher to be available. Once a publisher is available it signals to the domain bridge via a callback, and a topic bridge is created.In the special case of more than one publisher with different QoS settings, I've adopted a similar approach as rosbag2 for selecting a QoS that is compatible with most of the available publishers. Note, we could factor out this logic following https://github.com/ros2/rosbag2/issues/601 and/or https://github.com/ros2/rmw/issues/304.