-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Negotiated publisher holds a callback to trigger additional negotiation when it detects a change in graph in terms of the list of negotiated subscriber connected to the same topic. The list is based on ROS pub/sub internal GIDs.
A GID is recorded here when a negotiated subscriber is connected:
negotiated/negotiated/src/negotiated_publisher.cpp
Lines 498 to 501 in eac198b
| std::copy( | |
| std::begin(msg_info.get_rmw_message_info().publisher_gid.data), | |
| std::end(msg_info.get_rmw_message_info().publisher_gid.data), | |
| std::begin(gid_key)); |
It gets a GID in a different way to check if a connected negotiated subscriber (more precisely, its negotiation publisher) is already existed here:
negotiated/negotiated/src/negotiated_publisher.cpp
Lines 389 to 393 in eac198b
| if (negotiated_subscription_type_gids_->count(endpoint.endpoint_gid()) > 0) { | |
| std::vector<std::string> old_type = | |
| negotiated_subscription_type_gids_->at(endpoint.endpoint_gid()); | |
| new_negotiated_subscription_gids->emplace(endpoint.endpoint_gid(), old_type); | |
| } |
In rmw_fastrtps_cpp GIDs obtained from these two methods are identical, but they are different when using rmw_cyclonedds_cpp, which causes the algorithm to think that a negotiated has been removed and hence removing all negotiated results. As a result, negotiation can fail in rmw_cyclonedds_cpp when it should be successful.