Skip to content

Conversation

@leeminju531
Copy link

Add get_clients_info_by_service and get_servers_info_by_service; Introduce ServiceEntityInfo to handle service type hash in graph cache

Description

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 optional service_type_hash parameter with a default value of nullptr:

  bool
  add_entity(
    const rmw_gid_t & gid,
    const std::string & topic_name,
    const std::string & type_name,
    const rosidl_type_hash_t & type_hash,
    const rmw_gid_t & participant_gid,
    const rmw_qos_profile_t & qos,
    bool is_reader,
    const rosidl_type_hash_t * service_type_hash = 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 to EndpointTypeEnum and associated file changes. The rclcpp layer is unaffected, as it already uses EndpointType.

Did you use Generative AI?

Used for refining comments. (GPT-4o)

Additional Information

The following features were added.

  • Added get_clients_info_by_service and get_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.
  • A new structure, ServiceEntityInfo, was introduced to manage service-related information in the graph cache, including the service_type_hash. It is stored in a std::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.
  • Service Type Hash Handling: The add_entity, add_reader, and add_writer functions now accept a service_type_hash pointer. When an entity is part of a service, this parameter must be provided. The service_type_hash is discovered during the DDS discovery process using parse_sertype_hash_from_user_data and encoded for QoS settings via encode_sertype_hash_for_user_data_qos.

@fujitatomoya
Copy link
Collaborator

@Mergifyio rebase

…oduce ServiceEntityInfo to handle service type hash in graph cache

Signed-off-by: Minju, Lee <[email protected]>
@mergify
Copy link

mergify bot commented Nov 6, 2025

rebase

✅ Branch has been successfully rebased

@fujitatomoya
Copy link
Collaborator

Pulls: ros2/ros2cli#916, ros2/rmw#371, ros2/rmw_implementation#238, ros2/rmw_fastrtps#771, ros2/rmw_cyclonedds#499, ros2/rmw_connextdds#154, ros2/rcl#1161, ros2/rclcpp#2569, ros2/rclpy#1307, #82, ros2/rmw_zenoh#679
Gist: https://gist.githubusercontent.com/fujitatomoya/01385d70469b48f205a68e21219fd395/raw/b02c84fd17938124e2b045dbf016f260e6209ae0/ros2.repos
BUILD args: --packages-above-and-dependencies rmw_zenoh_cpp rmw_dds_common rclpy rclcpp_lifecycle rclcpp rcl rmw_connextdds rmw_connextdds_common rmw_connextddsmicro rmw_cyclonedds_cpp rmw_fastrtps_cpp rmw_fastrtps_dynamic_cpp rmw_fastrtps_sharedcpp ros2cli ros2service rmw rmw_implementation test_rmw_implementation
TEST args: --packages-above rmw_zenoh_cpp rmw_dds_common rclpy rclcpp_lifecycle rclcpp rcl rmw_connextdds rmw_connextdds_common rmw_connextddsmicro rmw_cyclonedds_cpp rmw_fastrtps_cpp rmw_fastrtps_dynamic_cpp rmw_fastrtps_sharedcpp ros2cli ros2service rmw rmw_implementation test_rmw_implementation
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17407

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@fujitatomoya
Copy link
Collaborator

Pulls: ros2/ros2cli#916, ros2/rmw#371, ros2/rmw_implementation#238, ros2/rmw_fastrtps#771, ros2/rmw_cyclonedds#499, ros2/rmw_connextdds#154, ros2/rcl#1161, ros2/rclcpp#2569, ros2/rclpy#1307, #82, ros2/rmw_zenoh#679
Gist: https://gist.githubusercontent.com/fujitatomoya/3c50929d3b3e884ba6796f6c9f26e92e/raw/b02c84fd17938124e2b045dbf016f260e6209ae0/ros2.repos
BUILD args: --packages-above-and-dependencies rmw_zenoh_cpp rmw_dds_common rclpy rclcpp_lifecycle rclcpp rcl rmw_connextdds rmw_connextdds_common rmw_connextddsmicro rmw_cyclonedds_cpp rmw_fastrtps_cpp rmw_fastrtps_dynamic_cpp rmw_fastrtps_shared_cpp ros2cli ros2service rmw rmw_implementation test_rmw_implementation
TEST args: --packages-above rmw_zenoh_cpp rmw_dds_common rclpy rclcpp_lifecycle rclcpp rcl rmw_connextdds rmw_connextdds_common rmw_connextddsmicro rmw_cyclonedds_cpp rmw_fastrtps_cpp rmw_fastrtps_dynamic_cpp rmw_fastrtps_shared_cpp ros2cli ros2service rmw rmw_implementation test_rmw_implementation
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17408

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants