From 31302a7c9915c2b1030d510a5aab649f1fc9c4d8 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 22 Jun 2022 01:56:39 -0700 Subject: [PATCH 1/3] Add message definitions for service events Signed-off-by: Jacob Perron --- rcl_interfaces/CMakeLists.txt | 5 ++++- rcl_interfaces/msg/ServiceEvent.msg | 20 ++++++++++++++++++++ rcl_interfaces/msg/ServiceEventType.msg | 14 ++++++++++++++ rcl_interfaces/package.xml | 1 + 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 rcl_interfaces/msg/ServiceEvent.msg create mode 100644 rcl_interfaces/msg/ServiceEventType.msg diff --git a/rcl_interfaces/CMakeLists.txt b/rcl_interfaces/CMakeLists.txt index 8ed4e198..c04ae4a3 100644 --- a/rcl_interfaces/CMakeLists.txt +++ b/rcl_interfaces/CMakeLists.txt @@ -13,6 +13,7 @@ endif() find_package(ament_cmake REQUIRED) find_package(rosidl_default_generators REQUIRED) find_package(builtin_interfaces REQUIRED) +find_package(unique_identifier_msgs REQUIRED) rosidl_generate_interfaces(${PROJECT_NAME} "msg/FloatingPointRange.msg" @@ -25,6 +26,8 @@ rosidl_generate_interfaces(${PROJECT_NAME} "msg/Parameter.msg" "msg/ParameterType.msg" "msg/ParameterValue.msg" + "msg/ServiceEvent.msg" + "msg/ServiceEventType.msg" "msg/SetParametersResult.msg" "srv/DescribeParameters.srv" "srv/GetParameters.srv" @@ -32,7 +35,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} "srv/ListParameters.srv" "srv/SetParametersAtomically.srv" "srv/SetParameters.srv" - DEPENDENCIES builtin_interfaces + DEPENDENCIES builtin_interfaces unique_identifier_msgs ) install(FILES mapping_rules.yaml DESTINATION share/${PROJECT_NAME}) diff --git a/rcl_interfaces/msg/ServiceEvent.msg b/rcl_interfaces/msg/ServiceEvent.msg new file mode 100644 index 00000000..f67a38f7 --- /dev/null +++ b/rcl_interfaces/msg/ServiceEvent.msg @@ -0,0 +1,20 @@ +# The type of event this message represents +# See ServiceEventType for possible values +uint8 event_type + +# Timestamp for when the event occurred (sent or received time) +builtin_interfaces/Time stamp + +# Unique identifier for the client that sent the service request +# Note, this is only unique for the current session +unique_identifier_msgs/UUID client_id + +# Sequence number for the request +# Combined with the client ID, this creates a unique ID for the service transaction +int64 sequence_number + +string service_name +string request_type_name +string response_type_name +byte[] serialized_request +byte[] serialized_response diff --git a/rcl_interfaces/msg/ServiceEventType.msg b/rcl_interfaces/msg/ServiceEventType.msg new file mode 100644 index 00000000..7f0176b7 --- /dev/null +++ b/rcl_interfaces/msg/ServiceEventType.msg @@ -0,0 +1,14 @@ +# An enumeration of service event types +# These are used to set the type value in ServiceEvent messages + +# A service request was sent by a client +uint8 REQUEST_SENT=0 + +# A service request was recieved by a service +uint8 REQUEST_RECEIVED=1 + +# A service response was sent by a service +uint8 RESPONSE_SENT=2 + +# A service response was received by a client +uint8 RESPONSE_RECEIVED=3 diff --git a/rcl_interfaces/package.xml b/rcl_interfaces/package.xml index 89edeaeb..91fb4461 100644 --- a/rcl_interfaces/package.xml +++ b/rcl_interfaces/package.xml @@ -19,6 +19,7 @@ rosidl_default_generators builtin_interfaces + unique_identifier_msgs rosidl_default_runtime From 4a46be7e47dac355384979927d62553674356f1a Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Thu, 23 Jun 2022 15:55:53 -0700 Subject: [PATCH 2/3] combine request/response into single event Signed-off-by: Brian Chen --- rcl_interfaces/msg/ServiceEvent.msg | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rcl_interfaces/msg/ServiceEvent.msg b/rcl_interfaces/msg/ServiceEvent.msg index f67a38f7..9965c428 100644 --- a/rcl_interfaces/msg/ServiceEvent.msg +++ b/rcl_interfaces/msg/ServiceEvent.msg @@ -14,7 +14,5 @@ unique_identifier_msgs/UUID client_id int64 sequence_number string service_name -string request_type_name -string response_type_name -byte[] serialized_request -byte[] serialized_response +string event_name +byte[] serialized_event From e37d06aed0358f4d2b877c16222cf73258d535f0 Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Wed, 29 Jun 2022 15:42:02 -0700 Subject: [PATCH 3/3] Move ServiceEvent metadata into new ServiceEventInfo message Signed-off-by: Brian Chen --- rcl_interfaces/CMakeLists.txt | 1 + rcl_interfaces/msg/ServiceEvent.msg | 19 +++---------------- rcl_interfaces/msg/ServiceEventInfo.msg | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 rcl_interfaces/msg/ServiceEventInfo.msg diff --git a/rcl_interfaces/CMakeLists.txt b/rcl_interfaces/CMakeLists.txt index c04ae4a3..4b982bd4 100644 --- a/rcl_interfaces/CMakeLists.txt +++ b/rcl_interfaces/CMakeLists.txt @@ -27,6 +27,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} "msg/ParameterType.msg" "msg/ParameterValue.msg" "msg/ServiceEvent.msg" + "msg/ServiceEventInfo.msg" "msg/ServiceEventType.msg" "msg/SetParametersResult.msg" "srv/DescribeParameters.srv" diff --git a/rcl_interfaces/msg/ServiceEvent.msg b/rcl_interfaces/msg/ServiceEvent.msg index 9965c428..4edbe061 100644 --- a/rcl_interfaces/msg/ServiceEvent.msg +++ b/rcl_interfaces/msg/ServiceEvent.msg @@ -1,18 +1,5 @@ -# The type of event this message represents -# See ServiceEventType for possible values -uint8 event_type +# See ServiceEventInfo +rcl_interfaces/ServiceEventInfo info -# Timestamp for when the event occurred (sent or received time) -builtin_interfaces/Time stamp - -# Unique identifier for the client that sent the service request -# Note, this is only unique for the current session -unique_identifier_msgs/UUID client_id - -# Sequence number for the request -# Combined with the client ID, this creates a unique ID for the service transaction -int64 sequence_number - -string service_name -string event_name +# Serialized Service_Request/Service_Response message byte[] serialized_event diff --git a/rcl_interfaces/msg/ServiceEventInfo.msg b/rcl_interfaces/msg/ServiceEventInfo.msg new file mode 100644 index 00000000..8ebb7be8 --- /dev/null +++ b/rcl_interfaces/msg/ServiceEventInfo.msg @@ -0,0 +1,20 @@ +# The type of event this message represents +# See ServiceEventType for possible values +uint8 event_type + +# Timestamp for when the event occurred (sent or received time) +builtin_interfaces/Time stamp + +# Unique identifier for the client that sent the service request +# Note, this is only unique for the current session +unique_identifier_msgs/UUID client_id + +# Sequence number for the request +# Combined with the client ID, this creates a unique ID for the service transaction +int64 sequence_number + +# Name of the service, i.e. add_two_ints_service +string service_name + +# Name of the service event, i.e. AddTwoInts_Request +string event_name