Add get_clients_info_by_service and get_servers_info_by_service #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
get_clients_info_by_service
andget_servers_info_by_service
; IntroduceServiceEntityInfo
to handle service type hash in graph cacheDescription
This is the sub-process to support ros2/ros2cli#916 and originates from a comment in ros2/rmw#371 (comment).
Is this user-facing behavior change?
Yes, but the impact is limited. The
add_entity
function has been extended to include an optionalservice_type_hash
parameter with a default value of nullptr:At the rcl layer, this change is backward-compatible, so users do not need to modify their code. However, at the rclpy layer, refactoring is required due to the renaming of
TopicEndpointTypeEnum
toEndpointTypeEnum
and associated file changes. The rclcpp layer is unaffected, as it already usesEndpointType
.Did you use Generative AI?
Used for refining comments. (GPT-4o)
Additional Information
The following features were added.
get_clients_info_by_service
andget_servers_info_by_service
to the graph cache, which use reader and writer information from service request and reply topics to populate service endpoint information.ServiceEntityInfo
, was introduced to manage service-related information in the graph cache, including theservice_type_hash
. It is stored in astd::map<rmw_gid_t, ServiceEntityInfo, Compare_rmw_gid_t>
with the entity GID, representing the reader and writer endpoints of the service, as the key.add_entity
,add_reader
, andadd_writer
functions now accept aservice_type_hash
pointer. When an entity is part of a service, this parameter must be provided. Theservice_type_hash
is discovered during the DDS discovery process usingparse_sertype_hash_from_user_data
and encoded for QoS settings viaencode_sertype_hash_for_user_data_qos
.