From d825a549d1f4489d60f2b26bd10f472e1757e8e0 Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Tue, 1 Oct 2024 12:33:12 -0700 Subject: [PATCH] Use client's reader guid for service introspection event gid. Signed-off-by: Tomoya Fujita --- rmw_fastrtps_shared_cpp/src/rmw_get_gid_for_client.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rmw_fastrtps_shared_cpp/src/rmw_get_gid_for_client.cpp b/rmw_fastrtps_shared_cpp/src/rmw_get_gid_for_client.cpp index e6ed28a58..18b7773a9 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_get_gid_for_client.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_get_gid_for_client.cpp @@ -38,7 +38,10 @@ __rmw_get_gid_for_client( RMW_CHECK_ARGUMENT_FOR_NULL(gid, RMW_RET_INVALID_ARGUMENT); const auto * info = static_cast(client->data); - copy_from_fastrtps_guid_to_byte_array(info->writer_guid_, gid->data); + // Use client's reader guid instead of writer guid for service event, + // because service server uses client's reader guid for the event. + // Service event message requires gid must be unique during transaction. + copy_from_fastrtps_guid_to_byte_array(info->reader_guid_, gid->data); gid->implementation_identifier = identifier; return RMW_RET_OK; }