From 57d7241b5e294035a28c502aff74e13f748e1b3e Mon Sep 17 00:00:00 2001 From: Mauro Date: Fri, 2 Oct 2020 13:50:11 +0100 Subject: [PATCH 01/24] Add apis: set entities callback --- rcl/include/rcl/wait.h | 39 ++++++++++++++++++++++++++++++++++ rcl/src/rcl/wait.c | 48 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/rcl/include/rcl/wait.h b/rcl/include/rcl/wait.h index f900d1107..a95d1b6b9 100644 --- a/rcl/include/rcl/wait.h +++ b/rcl/include/rcl/wait.h @@ -493,6 +493,45 @@ RCL_PUBLIC bool rcl_wait_set_is_valid(const rcl_wait_set_t * wait_set); +/// Set subscription callback +/** + * Add documentation + */ +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_set_subscription_callback( + void * executor_context, + Event_callback executor_callback, + void * subscription_handle, + const rcl_subscription_t * subscription); + +/// Set service callback +/** + * Add documentation + */ +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_set_service_callback( + void * executor_context, + Event_callback executor_callback, + void * service_handle, + const rcl_service_t * service); + +/// Set client callback +/** + * Add documentation + */ +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_set_client_callback( + void * executor_context, + Event_callback executor_callback, + void * client_handle, + const rcl_client_t * client); + #ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/wait.c b/rcl/src/rcl/wait.c index a23c77f7b..5b17f7ddd 100644 --- a/rcl/src/rcl/wait.c +++ b/rcl/src/rcl/wait.c @@ -687,6 +687,54 @@ rcl_wait(rcl_wait_set_t * wait_set, int64_t timeout) return RCL_RET_OK; } +rcl_ret_t +rcl_set_subscription_callback( + void * executor_context, + Event_callback executor_callback, + void * subscription_handle, + const rcl_subscription_t * subscription) +{ + rmw_subscription_t * rmw_handle = rcl_subscription_get_rmw_handle(subscription); + void * rmw_subscription = rmw_handle->data; + return rmw_set_subscription_callback( + executor_context, + executor_callback, + subscription_handle, + rmw_subscription); +} + +rcl_ret_t +rcl_set_service_callback( + void * executor_context, + Event_callback executor_callback, + void * service_handle, + const rcl_service_t * service) +{ + rmw_service_t * rmw_handle = rcl_service_get_rmw_handle(service); + void * rmw_service = rmw_handle->data; + return rmw_set_service_callback( + executor_context, + executor_callback, + service_handle, + rmw_service); +} + +rcl_ret_t +rcl_set_client_callback( + void * executor_context, + Event_callback executor_callback, + void * client_handle, + const rcl_client_t * client) +{ + rmw_client_t * rmw_handle = rcl_client_get_rmw_handle(client); + void * rmw_client = rmw_handle->data; + return rmw_set_client_callback( + executor_context, + executor_callback, + client_handle, + rmw_client); +} + #ifdef __cplusplus } #endif From 5a2fa8c6df642fed6a1bbbcc9b111be15963d1b0 Mon Sep 17 00:00:00 2001 From: Mauro Date: Fri, 2 Oct 2020 16:31:08 +0100 Subject: [PATCH 02/24] Add set_guard_condition_callback api --- rcl/include/rcl/wait.h | 13 +++++++++++++ rcl/src/rcl/wait.c | 44 ++++++++++++++++++++++++++++++------------ 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/rcl/include/rcl/wait.h b/rcl/include/rcl/wait.h index a95d1b6b9..d2888b957 100644 --- a/rcl/include/rcl/wait.h +++ b/rcl/include/rcl/wait.h @@ -532,6 +532,19 @@ rcl_set_client_callback( void * client_handle, const rcl_client_t * client); +/// Set guard_condition callback +/** + * Add documentation + */ +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_set_guard_condition_callback( + void * executor_context, + Event_callback executor_callback, + void * guard_condition_handle, + const rcl_guard_condition_t * guard_condition); + #ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/wait.c b/rcl/src/rcl/wait.c index 5b17f7ddd..5bb21a5dd 100644 --- a/rcl/src/rcl/wait.c +++ b/rcl/src/rcl/wait.c @@ -696,11 +696,12 @@ rcl_set_subscription_callback( { rmw_subscription_t * rmw_handle = rcl_subscription_get_rmw_handle(subscription); void * rmw_subscription = rmw_handle->data; + return rmw_set_subscription_callback( - executor_context, - executor_callback, - subscription_handle, - rmw_subscription); + executor_context, + executor_callback, + subscription_handle, + rmw_subscription); } rcl_ret_t @@ -712,11 +713,12 @@ rcl_set_service_callback( { rmw_service_t * rmw_handle = rcl_service_get_rmw_handle(service); void * rmw_service = rmw_handle->data; + return rmw_set_service_callback( - executor_context, - executor_callback, - service_handle, - rmw_service); + executor_context, + executor_callback, + service_handle, + rmw_service); } rcl_ret_t @@ -728,11 +730,29 @@ rcl_set_client_callback( { rmw_client_t * rmw_handle = rcl_client_get_rmw_handle(client); void * rmw_client = rmw_handle->data; + return rmw_set_client_callback( - executor_context, - executor_callback, - client_handle, - rmw_client); + executor_context, + executor_callback, + client_handle, + rmw_client); +} + +rcl_ret_t +rcl_set_guard_condition_callback( + void * executor_context, + Event_callback executor_callback, + void * waitable_handle, + const rcl_guard_condition_t * guard_condition) +{ + rmw_guard_condition_t * rmw_handle = rcl_guard_condition_get_rmw_handle(guard_condition); + void * rmw_guard_condition = rmw_handle->data; + + return rmw_set_guard_condition_callback( + executor_context, + executor_callback, + waitable_handle, + rmw_guard_condition); } #ifdef __cplusplus From 694d4a7c14ddfbe8cf7227e46ab6985db0b7b5d6 Mon Sep 17 00:00:00 2001 From: Mauro Date: Fri, 2 Oct 2020 18:38:02 +0100 Subject: [PATCH 03/24] Move apis - Add constness --- rcl/include/rcl/client.h | 10 +++++ rcl/include/rcl/guard_condition.h | 10 +++++ rcl/include/rcl/service.h | 10 +++++ rcl/include/rcl/subscription.h | 10 +++++ rcl/include/rcl/wait.h | 52 ----------------------- rcl/src/rcl/client.c | 15 +++++++ rcl/src/rcl/guard_condition.c | 14 +++++++ rcl/src/rcl/service.c | 15 +++++++ rcl/src/rcl/subscription.c | 14 +++++++ rcl/src/rcl/wait.c | 68 ------------------------------- 10 files changed, 98 insertions(+), 120 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 97dade4f2..08ae7cdfa 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -25,6 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" +#include "rcutils/event_types.h" /// Internal rcl client implementation struct. struct rcl_client_impl_t; @@ -407,6 +408,15 @@ RCL_PUBLIC bool rcl_client_is_valid(const rcl_client_t * client); +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_client_set_callback( + const void * executor_context, + Event_callback executor_callback, + const void * client_handle, + const rcl_client_t * client); + #ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 9f40ccd6c..a3a0938c8 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -25,6 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/types.h" #include "rcl/visibility_control.h" +#include "rcutils/event_types.h" /// Internal rcl guard condition implementation struct. struct rcl_guard_condition_impl_t; @@ -258,6 +259,15 @@ RCL_WARN_UNUSED rmw_guard_condition_t * rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition); +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_guard_condition_set_callback( + const void * executor_context, + Event_callback executor_callback, + const void * guard_condition_handle, + const rcl_guard_condition_t * guard_condition); + #ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index a73cb3802..0c3bb42c8 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -25,6 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" +#include "rcutils/event_types.h" /// Internal rcl implementation struct. struct rcl_service_impl_t; @@ -421,6 +422,15 @@ RCL_PUBLIC bool rcl_service_is_valid(const rcl_service_t * service); +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_service_set_callback( + const void * executor_context, + Event_callback executor_callback, + const void * service_handle, + const rcl_service_t * service); + #ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index e0d2dce5f..0d26354db 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -25,6 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" +#include "rcutils/event_types.h" #include "rmw/message_sequence.h" @@ -604,6 +605,15 @@ RCL_PUBLIC bool rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription); +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_subscription_set_callback( + const void * executor_context, + Event_callback executor_callback, + const void * subscription_handle, + const rcl_subscription_t * subscription); + #ifdef __cplusplus } #endif diff --git a/rcl/include/rcl/wait.h b/rcl/include/rcl/wait.h index d2888b957..f900d1107 100644 --- a/rcl/include/rcl/wait.h +++ b/rcl/include/rcl/wait.h @@ -493,58 +493,6 @@ RCL_PUBLIC bool rcl_wait_set_is_valid(const rcl_wait_set_t * wait_set); -/// Set subscription callback -/** - * Add documentation - */ -RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t -rcl_set_subscription_callback( - void * executor_context, - Event_callback executor_callback, - void * subscription_handle, - const rcl_subscription_t * subscription); - -/// Set service callback -/** - * Add documentation - */ -RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t -rcl_set_service_callback( - void * executor_context, - Event_callback executor_callback, - void * service_handle, - const rcl_service_t * service); - -/// Set client callback -/** - * Add documentation - */ -RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t -rcl_set_client_callback( - void * executor_context, - Event_callback executor_callback, - void * client_handle, - const rcl_client_t * client); - -/// Set guard_condition callback -/** - * Add documentation - */ -RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t -rcl_set_guard_condition_callback( - void * executor_context, - Event_callback executor_callback, - void * guard_condition_handle, - const rcl_guard_condition_t * guard_condition); - #ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 875236390..25d604887 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -349,6 +349,21 @@ rcl_client_is_valid(const rcl_client_t * client) client->impl->rmw_handle, "client's rmw handle is invalid", return false); return true; } + +rcl_ret_t +rcl_client_set_callback( + const void * executor_context, + Event_callback executor_callback, + const void * client_handle, + const rcl_client_t * client) +{ + return rmw_set_client_callback( + executor_context, + executor_callback, + client_handle, + client->impl->rmw_handle->data); +} + #ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index d7e17afda..501dde585 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -186,6 +186,20 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition return guard_condition->impl->rmw_handle; } +rcl_ret_t +rcl_guard_condition_set_callback( + const void * executor_context, + Event_callback executor_callback, + const void * guard_condition_handle, + const rcl_guard_condition_t * guard_condition) +{ + return rmw_set_guard_condition_callback( + executor_context, + executor_callback, + guard_condition_handle, + guard_condition->impl->rmw_handle->data); +} + #ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 196e4aab3..66d821e58 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -370,6 +370,21 @@ rcl_service_is_valid(const rcl_service_t * service) return true; } +rcl_ret_t +rcl_service_set_callback( + const void * executor_context, + Event_callback executor_callback, + const void * service_handle, + const rcl_service_t * service) +{ + return rmw_set_service_callback( + executor_context, + executor_callback, + service_handle, + service->impl->rmw_handle->data); +} + + #ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index d6c4150bf..55252b81b 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -497,6 +497,20 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) return subscription->impl->rmw_handle->can_loan_messages; } +rcl_ret_t +rcl_subscription_set_callback( + const void * executor_context, + Event_callback executor_callback, + const void * subscription_handle, + const rcl_subscription_t * subscription) +{ + return rmw_set_subscription_callback( + executor_context, + executor_callback, + subscription_handle, + subscription->impl->rmw_handle->data); +} + #ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/wait.c b/rcl/src/rcl/wait.c index 5bb21a5dd..a23c77f7b 100644 --- a/rcl/src/rcl/wait.c +++ b/rcl/src/rcl/wait.c @@ -687,74 +687,6 @@ rcl_wait(rcl_wait_set_t * wait_set, int64_t timeout) return RCL_RET_OK; } -rcl_ret_t -rcl_set_subscription_callback( - void * executor_context, - Event_callback executor_callback, - void * subscription_handle, - const rcl_subscription_t * subscription) -{ - rmw_subscription_t * rmw_handle = rcl_subscription_get_rmw_handle(subscription); - void * rmw_subscription = rmw_handle->data; - - return rmw_set_subscription_callback( - executor_context, - executor_callback, - subscription_handle, - rmw_subscription); -} - -rcl_ret_t -rcl_set_service_callback( - void * executor_context, - Event_callback executor_callback, - void * service_handle, - const rcl_service_t * service) -{ - rmw_service_t * rmw_handle = rcl_service_get_rmw_handle(service); - void * rmw_service = rmw_handle->data; - - return rmw_set_service_callback( - executor_context, - executor_callback, - service_handle, - rmw_service); -} - -rcl_ret_t -rcl_set_client_callback( - void * executor_context, - Event_callback executor_callback, - void * client_handle, - const rcl_client_t * client) -{ - rmw_client_t * rmw_handle = rcl_client_get_rmw_handle(client); - void * rmw_client = rmw_handle->data; - - return rmw_set_client_callback( - executor_context, - executor_callback, - client_handle, - rmw_client); -} - -rcl_ret_t -rcl_set_guard_condition_callback( - void * executor_context, - Event_callback executor_callback, - void * waitable_handle, - const rcl_guard_condition_t * guard_condition) -{ - rmw_guard_condition_t * rmw_handle = rcl_guard_condition_get_rmw_handle(guard_condition); - void * rmw_guard_condition = rmw_handle->data; - - return rmw_set_guard_condition_callback( - executor_context, - executor_callback, - waitable_handle, - rmw_guard_condition); -} - #ifdef __cplusplus } #endif From bcc26b1cebada0e6ae3edf3aaa7b62a10946635b Mon Sep 17 00:00:00 2001 From: Mauro Date: Tue, 6 Oct 2020 10:36:07 +0100 Subject: [PATCH 04/24] Use or discard previous events: Guard conditions --- rcl/include/rcl/guard_condition.h | 3 ++- rcl/src/rcl/guard_condition.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index a3a0938c8..123405d3b 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -266,7 +266,8 @@ rcl_guard_condition_set_callback( const void * executor_context, Event_callback executor_callback, const void * guard_condition_handle, - const rcl_guard_condition_t * guard_condition); + const rcl_guard_condition_t * guard_condition, + bool use_previous_events); #ifdef __cplusplus } diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 501dde585..7a4b7a223 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -191,13 +191,15 @@ rcl_guard_condition_set_callback( const void * executor_context, Event_callback executor_callback, const void * guard_condition_handle, - const rcl_guard_condition_t * guard_condition) + const rcl_guard_condition_t * guard_condition, + bool use_previous_events) { return rmw_set_guard_condition_callback( executor_context, executor_callback, guard_condition_handle, - guard_condition->impl->rmw_handle->data); + guard_condition->impl->rmw_handle->data, + use_previous_events); } #ifdef __cplusplus From 092885f159076238a0d831cef810fc32a4e122e1 Mon Sep 17 00:00:00 2001 From: Mauro Date: Mon, 12 Oct 2020 15:28:38 +0100 Subject: [PATCH 05/24] Rename to set_events_executor_callback --- rcl/include/rcl/client.h | 2 +- rcl/include/rcl/guard_condition.h | 2 +- rcl/include/rcl/service.h | 2 +- rcl/include/rcl/subscription.h | 2 +- rcl/src/rcl/client.c | 4 ++-- rcl/src/rcl/guard_condition.c | 2 +- rcl/src/rcl/service.c | 4 ++-- rcl/src/rcl/subscription.c | 4 ++-- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 08ae7cdfa..57920e1d1 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -411,7 +411,7 @@ rcl_client_is_valid(const rcl_client_t * client); RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_client_set_callback( +rcl_client_set_events_executor_callback( const void * executor_context, Event_callback executor_callback, const void * client_handle, diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 123405d3b..03e4488ae 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -262,7 +262,7 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_guard_condition_set_callback( +rcl_guard_condition_set_events_executor_callback( const void * executor_context, Event_callback executor_callback, const void * guard_condition_handle, diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 0c3bb42c8..1c1611400 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -425,7 +425,7 @@ rcl_service_is_valid(const rcl_service_t * service); RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_service_set_callback( +rcl_service_set_events_executor_callback( const void * executor_context, Event_callback executor_callback, const void * service_handle, diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 0d26354db..bff18d189 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -608,7 +608,7 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription); RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_subscription_set_callback( +rcl_subscription_set_events_executor_callback( const void * executor_context, Event_callback executor_callback, const void * subscription_handle, diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 25d604887..899510614 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -351,13 +351,13 @@ rcl_client_is_valid(const rcl_client_t * client) } rcl_ret_t -rcl_client_set_callback( +rcl_client_set_events_executor_callback( const void * executor_context, Event_callback executor_callback, const void * client_handle, const rcl_client_t * client) { - return rmw_set_client_callback( + return rmw_client_set_events_executor_callback( executor_context, executor_callback, client_handle, diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 7a4b7a223..815a1b61f 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -187,7 +187,7 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition } rcl_ret_t -rcl_guard_condition_set_callback( +rcl_guard_condition_set_events_executor_callback( const void * executor_context, Event_callback executor_callback, const void * guard_condition_handle, diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 66d821e58..2588a73c3 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -371,13 +371,13 @@ rcl_service_is_valid(const rcl_service_t * service) } rcl_ret_t -rcl_service_set_callback( +rcl_service_set_events_executor_callback( const void * executor_context, Event_callback executor_callback, const void * service_handle, const rcl_service_t * service) { - return rmw_set_service_callback( + return rmw_service_set_events_executor_callback( executor_context, executor_callback, service_handle, diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index 55252b81b..e72f8624d 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -498,13 +498,13 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) } rcl_ret_t -rcl_subscription_set_callback( +rcl_subscription_set_events_executor_callback( const void * executor_context, Event_callback executor_callback, const void * subscription_handle, const rcl_subscription_t * subscription) { - return rmw_set_subscription_callback( + return rmw_subscription_set_events_executor_callback( executor_context, executor_callback, subscription_handle, From de9b4b65143c5db1452865fd2a3a32f9865bbe41 Mon Sep 17 00:00:00 2001 From: Mauro Date: Mon, 12 Oct 2020 16:19:45 +0100 Subject: [PATCH 06/24] Rename Event_callback -> ExecutorEventCallback --- rcl/include/rcl/client.h | 4 ++-- rcl/include/rcl/guard_condition.h | 4 ++-- rcl/include/rcl/service.h | 4 ++-- rcl/include/rcl/subscription.h | 4 ++-- rcl/src/rcl/client.c | 2 +- rcl/src/rcl/guard_condition.c | 2 +- rcl/src/rcl/service.c | 2 +- rcl/src/rcl/subscription.c | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 57920e1d1..9abb32367 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -25,7 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rcutils/event_types.h" +#include "rcutils/executor_event_types.h" /// Internal rcl client implementation struct. struct rcl_client_impl_t; @@ -413,7 +413,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_client_set_events_executor_callback( const void * executor_context, - Event_callback executor_callback, + ExecutorEventCallback executor_callback, const void * client_handle, const rcl_client_t * client); diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 03e4488ae..3fe927859 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -25,7 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/types.h" #include "rcl/visibility_control.h" -#include "rcutils/event_types.h" +#include "rcutils/executor_event_types.h" /// Internal rcl guard condition implementation struct. struct rcl_guard_condition_impl_t; @@ -264,7 +264,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_guard_condition_set_events_executor_callback( const void * executor_context, - Event_callback executor_callback, + ExecutorEventCallback executor_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, bool use_previous_events); diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 1c1611400..6829e5a91 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -25,7 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rcutils/event_types.h" +#include "rcutils/executor_event_types.h" /// Internal rcl implementation struct. struct rcl_service_impl_t; @@ -427,7 +427,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_service_set_events_executor_callback( const void * executor_context, - Event_callback executor_callback, + ExecutorEventCallback executor_callback, const void * service_handle, const rcl_service_t * service); diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index bff18d189..aaf86af6a 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -25,7 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rcutils/event_types.h" +#include "rcutils/executor_event_types.h" #include "rmw/message_sequence.h" @@ -610,7 +610,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_subscription_set_events_executor_callback( const void * executor_context, - Event_callback executor_callback, + ExecutorEventCallback executor_callback, const void * subscription_handle, const rcl_subscription_t * subscription); diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 899510614..9d5e5d240 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -353,7 +353,7 @@ rcl_client_is_valid(const rcl_client_t * client) rcl_ret_t rcl_client_set_events_executor_callback( const void * executor_context, - Event_callback executor_callback, + ExecutorEventCallback executor_callback, const void * client_handle, const rcl_client_t * client) { diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 815a1b61f..3766f512a 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -189,7 +189,7 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition rcl_ret_t rcl_guard_condition_set_events_executor_callback( const void * executor_context, - Event_callback executor_callback, + ExecutorEventCallback executor_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, bool use_previous_events) diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 2588a73c3..9c60fada3 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -373,7 +373,7 @@ rcl_service_is_valid(const rcl_service_t * service) rcl_ret_t rcl_service_set_events_executor_callback( const void * executor_context, - Event_callback executor_callback, + ExecutorEventCallback executor_callback, const void * service_handle, const rcl_service_t * service) { diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index e72f8624d..33a641e2b 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -500,7 +500,7 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) rcl_ret_t rcl_subscription_set_events_executor_callback( const void * executor_context, - Event_callback executor_callback, + ExecutorEventCallback executor_callback, const void * subscription_handle, const rcl_subscription_t * subscription) { From 059675f814c8fc6e3858a80fbeadf105beffacdd Mon Sep 17 00:00:00 2001 From: Mauro Date: Mon, 12 Oct 2020 16:42:59 +0100 Subject: [PATCH 07/24] update name --- rcl/src/rcl/guard_condition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 3766f512a..f0dab0b28 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -194,7 +194,7 @@ rcl_guard_condition_set_events_executor_callback( const rcl_guard_condition_t * guard_condition, bool use_previous_events) { - return rmw_set_guard_condition_callback( + return rmw_guard_condition_set_events_executor_callback( executor_context, executor_callback, guard_condition_handle, From f36f0ac8a39b9b1242ad01dc20f6e141b91d5c04 Mon Sep 17 00:00:00 2001 From: Mauro Date: Tue, 13 Oct 2020 12:29:08 +0100 Subject: [PATCH 08/24] Add events support --- rcl/include/rcl/event.h | 10 ++++++++++ rcl/src/rcl/event.c | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index 6798a9d5e..41507d907 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -193,6 +193,16 @@ RCL_PUBLIC bool rcl_event_is_valid(const rcl_event_t * event); +RCL_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_event_set_events_executor_callback( + const void * executor_context, + ExecutorEventCallback executor_callback, + const void * event_handle, + const rcl_event_t * event, + bool use_previous_events); + #ifdef __cplusplus } #endif diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index c79c60ce6..1223a83df 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -218,6 +218,22 @@ rcl_event_is_valid(const rcl_event_t * event) return true; } +rcl_ret_t +rcl_event_set_events_executor_callback( + const void * executor_context, + ExecutorEventCallback executor_callback, + const void * event_handle, + const rcl_event_t * event, + bool use_previous_events) +{ + return rmw_event_set_events_executor_callback( + executor_context, + executor_callback, + event_handle, + &event->impl->rmw_handle, + use_previous_events); +} + #ifdef __cplusplus } #endif From 2d638867ce0abc768d259b6a670b1ea882f0b229 Mon Sep 17 00:00:00 2001 From: Mauro Date: Wed, 14 Oct 2020 11:58:54 +0100 Subject: [PATCH 09/24] void return on set_events_executor_callback --- rcl/include/rcl/client.h | 3 +-- rcl/include/rcl/event.h | 3 +-- rcl/include/rcl/guard_condition.h | 3 +-- rcl/include/rcl/service.h | 3 +-- rcl/include/rcl/subscription.h | 3 +-- rcl/src/rcl/client.c | 4 ++-- rcl/src/rcl/event.c | 4 ++-- rcl/src/rcl/guard_condition.c | 4 ++-- rcl/src/rcl/service.c | 4 ++-- rcl/src/rcl/subscription.c | 4 ++-- 10 files changed, 15 insertions(+), 20 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 9abb32367..671623c62 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -409,8 +409,7 @@ bool rcl_client_is_valid(const rcl_client_t * client); RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t +void rcl_client_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index 41507d907..a286d9fe4 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -194,8 +194,7 @@ bool rcl_event_is_valid(const rcl_event_t * event); RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t +void rcl_event_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 3fe927859..5965f16d4 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -260,8 +260,7 @@ rmw_guard_condition_t * rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition); RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t +void rcl_guard_condition_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 6829e5a91..b3375a135 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -423,8 +423,7 @@ bool rcl_service_is_valid(const rcl_service_t * service); RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t +void rcl_service_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index aaf86af6a..e57a0ab61 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -606,8 +606,7 @@ bool rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription); RCL_PUBLIC -RCL_WARN_UNUSED -rcl_ret_t +void rcl_subscription_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 9d5e5d240..46db13813 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -350,14 +350,14 @@ rcl_client_is_valid(const rcl_client_t * client) return true; } -rcl_ret_t +void rcl_client_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, const void * client_handle, const rcl_client_t * client) { - return rmw_client_set_events_executor_callback( + rmw_client_set_events_executor_callback( executor_context, executor_callback, client_handle, diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 1223a83df..567d67843 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -218,7 +218,7 @@ rcl_event_is_valid(const rcl_event_t * event) return true; } -rcl_ret_t +void rcl_event_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, @@ -226,7 +226,7 @@ rcl_event_set_events_executor_callback( const rcl_event_t * event, bool use_previous_events) { - return rmw_event_set_events_executor_callback( + rmw_event_set_events_executor_callback( executor_context, executor_callback, event_handle, diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index f0dab0b28..fde0b9de8 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -186,7 +186,7 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition return guard_condition->impl->rmw_handle; } -rcl_ret_t +void rcl_guard_condition_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, @@ -194,7 +194,7 @@ rcl_guard_condition_set_events_executor_callback( const rcl_guard_condition_t * guard_condition, bool use_previous_events) { - return rmw_guard_condition_set_events_executor_callback( + rmw_guard_condition_set_events_executor_callback( executor_context, executor_callback, guard_condition_handle, diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 9c60fada3..8900267a5 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -370,14 +370,14 @@ rcl_service_is_valid(const rcl_service_t * service) return true; } -rcl_ret_t +void rcl_service_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, const void * service_handle, const rcl_service_t * service) { - return rmw_service_set_events_executor_callback( + rmw_service_set_events_executor_callback( executor_context, executor_callback, service_handle, diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index 33a641e2b..8f68a2233 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -497,14 +497,14 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) return subscription->impl->rmw_handle->can_loan_messages; } -rcl_ret_t +void rcl_subscription_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, const void * subscription_handle, const rcl_subscription_t * subscription) { - return rmw_subscription_set_events_executor_callback( + rmw_subscription_set_events_executor_callback( executor_context, executor_callback, subscription_handle, From e0957fc6ac855691dfbdd06ad1fbf35cdacdf56f Mon Sep 17 00:00:00 2001 From: iRobot ROS <49500531+irobot-ros@users.noreply.github.com> Date: Wed, 14 Oct 2020 15:50:05 +0100 Subject: [PATCH 10/24] Revert "void return on set_events_executor_callback" --- rcl/include/rcl/client.h | 3 ++- rcl/include/rcl/event.h | 3 ++- rcl/include/rcl/guard_condition.h | 3 ++- rcl/include/rcl/service.h | 3 ++- rcl/include/rcl/subscription.h | 3 ++- rcl/src/rcl/client.c | 4 ++-- rcl/src/rcl/event.c | 4 ++-- rcl/src/rcl/guard_condition.c | 4 ++-- rcl/src/rcl/service.c | 4 ++-- rcl/src/rcl/subscription.c | 4 ++-- 10 files changed, 20 insertions(+), 15 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 671623c62..9abb32367 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -409,7 +409,8 @@ bool rcl_client_is_valid(const rcl_client_t * client); RCL_PUBLIC -void +RCL_WARN_UNUSED +rcl_ret_t rcl_client_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index a286d9fe4..41507d907 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -194,7 +194,8 @@ bool rcl_event_is_valid(const rcl_event_t * event); RCL_PUBLIC -void +RCL_WARN_UNUSED +rcl_ret_t rcl_event_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 5965f16d4..3fe927859 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -260,7 +260,8 @@ rmw_guard_condition_t * rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition); RCL_PUBLIC -void +RCL_WARN_UNUSED +rcl_ret_t rcl_guard_condition_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index b3375a135..6829e5a91 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -423,7 +423,8 @@ bool rcl_service_is_valid(const rcl_service_t * service); RCL_PUBLIC -void +RCL_WARN_UNUSED +rcl_ret_t rcl_service_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index e57a0ab61..aaf86af6a 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -606,7 +606,8 @@ bool rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription); RCL_PUBLIC -void +RCL_WARN_UNUSED +rcl_ret_t rcl_subscription_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 46db13813..9d5e5d240 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -350,14 +350,14 @@ rcl_client_is_valid(const rcl_client_t * client) return true; } -void +rcl_ret_t rcl_client_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, const void * client_handle, const rcl_client_t * client) { - rmw_client_set_events_executor_callback( + return rmw_client_set_events_executor_callback( executor_context, executor_callback, client_handle, diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 567d67843..1223a83df 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -218,7 +218,7 @@ rcl_event_is_valid(const rcl_event_t * event) return true; } -void +rcl_ret_t rcl_event_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, @@ -226,7 +226,7 @@ rcl_event_set_events_executor_callback( const rcl_event_t * event, bool use_previous_events) { - rmw_event_set_events_executor_callback( + return rmw_event_set_events_executor_callback( executor_context, executor_callback, event_handle, diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index fde0b9de8..f0dab0b28 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -186,7 +186,7 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition return guard_condition->impl->rmw_handle; } -void +rcl_ret_t rcl_guard_condition_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, @@ -194,7 +194,7 @@ rcl_guard_condition_set_events_executor_callback( const rcl_guard_condition_t * guard_condition, bool use_previous_events) { - rmw_guard_condition_set_events_executor_callback( + return rmw_guard_condition_set_events_executor_callback( executor_context, executor_callback, guard_condition_handle, diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 8900267a5..9c60fada3 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -370,14 +370,14 @@ rcl_service_is_valid(const rcl_service_t * service) return true; } -void +rcl_ret_t rcl_service_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, const void * service_handle, const rcl_service_t * service) { - rmw_service_set_events_executor_callback( + return rmw_service_set_events_executor_callback( executor_context, executor_callback, service_handle, diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index 8f68a2233..33a641e2b 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -497,14 +497,14 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) return subscription->impl->rmw_handle->can_loan_messages; } -void +rcl_ret_t rcl_subscription_set_events_executor_callback( const void * executor_context, ExecutorEventCallback executor_callback, const void * subscription_handle, const rcl_subscription_t * subscription) { - rmw_subscription_set_events_executor_callback( + return rmw_subscription_set_events_executor_callback( executor_context, executor_callback, subscription_handle, From 476fd637ca7767ba4cda3927e4327856eeb3b38c Mon Sep 17 00:00:00 2001 From: Mauro Date: Tue, 20 Oct 2020 15:42:50 +0100 Subject: [PATCH 11/24] Rename ExecutorEventCallback -> EventsExecutorCallback --- rcl/include/rcl/client.h | 2 +- rcl/include/rcl/event.h | 2 +- rcl/include/rcl/guard_condition.h | 2 +- rcl/include/rcl/service.h | 2 +- rcl/include/rcl/subscription.h | 2 +- rcl/src/rcl/client.c | 2 +- rcl/src/rcl/event.c | 2 +- rcl/src/rcl/guard_condition.c | 2 +- rcl/src/rcl/service.c | 2 +- rcl/src/rcl/subscription.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 9abb32367..781b81c67 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -413,7 +413,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_client_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * client_handle, const rcl_client_t * client); diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index 41507d907..c7e1945cc 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -198,7 +198,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_event_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * event_handle, const rcl_event_t * event, bool use_previous_events); diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 3fe927859..63dc60111 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -264,7 +264,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_guard_condition_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, bool use_previous_events); diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 6829e5a91..28c09a2dd 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -427,7 +427,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_service_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * service_handle, const rcl_service_t * service); diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index aaf86af6a..49d911898 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -610,7 +610,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_subscription_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * subscription_handle, const rcl_subscription_t * subscription); diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 9d5e5d240..c5bcbc1e2 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -353,7 +353,7 @@ rcl_client_is_valid(const rcl_client_t * client) rcl_ret_t rcl_client_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * client_handle, const rcl_client_t * client) { diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 1223a83df..13b777145 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -221,7 +221,7 @@ rcl_event_is_valid(const rcl_event_t * event) rcl_ret_t rcl_event_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * event_handle, const rcl_event_t * event, bool use_previous_events) diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index f0dab0b28..e0d6f776d 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -189,7 +189,7 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition rcl_ret_t rcl_guard_condition_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, bool use_previous_events) diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 9c60fada3..d9bad73e9 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -373,7 +373,7 @@ rcl_service_is_valid(const rcl_service_t * service) rcl_ret_t rcl_service_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * service_handle, const rcl_service_t * service) { diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index 33a641e2b..aa9c9d1f3 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -500,7 +500,7 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) rcl_ret_t rcl_subscription_set_events_executor_callback( const void * executor_context, - ExecutorEventCallback executor_callback, + EventsExecutorCallback executor_callback, const void * subscription_handle, const rcl_subscription_t * subscription) { From 08114c3eec18a3d979863416f441695debef81d6 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Thu, 19 Nov 2020 16:41:38 +0000 Subject: [PATCH 12/24] Rename set_events_executor_callback->set_listener_callback --- rcl/src/rcl/client.c | 2 +- rcl/src/rcl/event.c | 2 +- rcl/src/rcl/guard_condition.c | 2 +- rcl/src/rcl/service.c | 2 +- rcl/src/rcl/subscription.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index c5bcbc1e2..b45ab2480 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -357,7 +357,7 @@ rcl_client_set_events_executor_callback( const void * client_handle, const rcl_client_t * client) { - return rmw_client_set_events_executor_callback( + return rmw_client_set_listener_callback( executor_context, executor_callback, client_handle, diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 13b777145..862e142f2 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -226,7 +226,7 @@ rcl_event_set_events_executor_callback( const rcl_event_t * event, bool use_previous_events) { - return rmw_event_set_events_executor_callback( + return rmw_event_set_listener_callback( executor_context, executor_callback, event_handle, diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index e0d6f776d..cccc8f2d4 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -194,7 +194,7 @@ rcl_guard_condition_set_events_executor_callback( const rcl_guard_condition_t * guard_condition, bool use_previous_events) { - return rmw_guard_condition_set_events_executor_callback( + return rmw_guard_condition_set_listener_callback( executor_context, executor_callback, guard_condition_handle, diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index d9bad73e9..cc6836d4e 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -377,7 +377,7 @@ rcl_service_set_events_executor_callback( const void * service_handle, const rcl_service_t * service) { - return rmw_service_set_events_executor_callback( + return rmw_service_set_listener_callback( executor_context, executor_callback, service_handle, diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index aa9c9d1f3..8accc79cd 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -504,7 +504,7 @@ rcl_subscription_set_events_executor_callback( const void * subscription_handle, const rcl_subscription_t * subscription) { - return rmw_subscription_set_events_executor_callback( + return rmw_subscription_set_listener_callback( executor_context, executor_callback, subscription_handle, From b5cbca03cde29813adfbcbc92edc4affad4e136a Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Fri, 20 Nov 2020 11:09:44 +0000 Subject: [PATCH 13/24] Use data types when setting callbacks --- rcl/src/rcl/client.c | 2 +- rcl/src/rcl/guard_condition.c | 2 +- rcl/src/rcl/service.c | 2 +- rcl/src/rcl/subscription.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index c5bcbc1e2..11e1207f0 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -361,7 +361,7 @@ rcl_client_set_events_executor_callback( executor_context, executor_callback, client_handle, - client->impl->rmw_handle->data); + client->impl->rmw_handle); } #ifdef __cplusplus diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index e0d6f776d..7ae73721a 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -198,7 +198,7 @@ rcl_guard_condition_set_events_executor_callback( executor_context, executor_callback, guard_condition_handle, - guard_condition->impl->rmw_handle->data, + guard_condition->impl->rmw_handle, use_previous_events); } diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index d9bad73e9..096a1ca4b 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -381,7 +381,7 @@ rcl_service_set_events_executor_callback( executor_context, executor_callback, service_handle, - service->impl->rmw_handle->data); + service->impl->rmw_handle); } diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index aa9c9d1f3..8e32e1d42 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -508,7 +508,7 @@ rcl_subscription_set_events_executor_callback( executor_context, executor_callback, subscription_handle, - subscription->impl->rmw_handle->data); + subscription->impl->rmw_handle); } #ifdef __cplusplus From 1e4469ece9583b9b094f6e2a1d9d569bfd97df45 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Fri, 20 Nov 2020 12:27:30 +0000 Subject: [PATCH 14/24] Move rcutils/executor_event_types.h to rmw/ --- rcl/include/rcl/client.h | 3 ++- rcl/include/rcl/guard_condition.h | 3 ++- rcl/include/rcl/service.h | 3 ++- rcl/include/rcl/subscription.h | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 781b81c67..460d07a56 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -25,7 +25,8 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rcutils/executor_event_types.h" + +#include "rmw/executor_event_types.h" /// Internal rcl client implementation struct. struct rcl_client_impl_t; diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 63dc60111..b01078363 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -25,7 +25,8 @@ extern "C" #include "rcl/macros.h" #include "rcl/types.h" #include "rcl/visibility_control.h" -#include "rcutils/executor_event_types.h" + +#include "rmw/executor_event_types.h" /// Internal rcl guard condition implementation struct. struct rcl_guard_condition_impl_t; diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 28c09a2dd..de7e6fa4d 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -25,7 +25,8 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rcutils/executor_event_types.h" + +#include "rmw/executor_event_types.h" /// Internal rcl implementation struct. struct rcl_service_impl_t; diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 49d911898..174bc03a0 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -25,8 +25,8 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rcutils/executor_event_types.h" +#include "rmw/executor_event_types.h" #include "rmw/message_sequence.h" /// Internal rcl implementation struct. From 77ab41700605d7d8920538d49be76b49971cae02 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Fri, 20 Nov 2020 15:47:38 +0000 Subject: [PATCH 15/24] rename event types --- rcl/include/rcl/client.h | 6 +++--- rcl/include/rcl/event.h | 4 ++-- rcl/include/rcl/guard_condition.h | 6 +++--- rcl/include/rcl/service.h | 6 +++--- rcl/include/rcl/subscription.h | 6 +++--- rcl/src/rcl/client.c | 6 +++--- rcl/src/rcl/event.c | 6 +++--- rcl/src/rcl/guard_condition.c | 6 +++--- rcl/src/rcl/service.c | 6 +++--- rcl/src/rcl/subscription.c | 6 +++--- 10 files changed, 29 insertions(+), 29 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 460d07a56..05157034f 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -26,7 +26,7 @@ extern "C" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rmw/executor_event_types.h" +#include "rmw/listener_event_types.h" /// Internal rcl client implementation struct. struct rcl_client_impl_t; @@ -412,9 +412,9 @@ rcl_client_is_valid(const rcl_client_t * client); RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_client_set_events_executor_callback( +rcl_client_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * client_handle, const rcl_client_t * client); diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index c7e1945cc..f1be71297 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -196,9 +196,9 @@ rcl_event_is_valid(const rcl_event_t * event); RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_event_set_events_executor_callback( +rcl_event_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * event_handle, const rcl_event_t * event, bool use_previous_events); diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index b01078363..2d0219b82 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -26,7 +26,7 @@ extern "C" #include "rcl/types.h" #include "rcl/visibility_control.h" -#include "rmw/executor_event_types.h" +#include "rmw/listener_event_types.h" /// Internal rcl guard condition implementation struct. struct rcl_guard_condition_impl_t; @@ -263,9 +263,9 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_guard_condition_set_events_executor_callback( +rcl_guard_condition_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, bool use_previous_events); diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index de7e6fa4d..603a5b4f5 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -26,7 +26,7 @@ extern "C" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rmw/executor_event_types.h" +#include "rmw/listener_event_types.h" /// Internal rcl implementation struct. struct rcl_service_impl_t; @@ -426,9 +426,9 @@ rcl_service_is_valid(const rcl_service_t * service); RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_service_set_events_executor_callback( +rcl_service_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * service_handle, const rcl_service_t * service); diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 174bc03a0..b38d8e066 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -26,7 +26,7 @@ extern "C" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rmw/executor_event_types.h" +#include "rmw/listener_event_types.h" #include "rmw/message_sequence.h" /// Internal rcl implementation struct. @@ -608,9 +608,9 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription); RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_subscription_set_events_executor_callback( +rcl_subscription_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * subscription_handle, const rcl_subscription_t * subscription); diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 45c7f29c6..13dc026b4 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -351,15 +351,15 @@ rcl_client_is_valid(const rcl_client_t * client) } rcl_ret_t -rcl_client_set_events_executor_callback( +rcl_client_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * client_handle, const rcl_client_t * client) { return rmw_client_set_listener_callback( executor_context, - executor_callback, + listener_callback, client_handle, client->impl->rmw_handle); } diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 862e142f2..3c7c98037 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -219,16 +219,16 @@ rcl_event_is_valid(const rcl_event_t * event) } rcl_ret_t -rcl_event_set_events_executor_callback( +rcl_event_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * event_handle, const rcl_event_t * event, bool use_previous_events) { return rmw_event_set_listener_callback( executor_context, - executor_callback, + listener_callback, event_handle, &event->impl->rmw_handle, use_previous_events); diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index e4da4cec0..2bf4566d2 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -187,16 +187,16 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition } rcl_ret_t -rcl_guard_condition_set_events_executor_callback( +rcl_guard_condition_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, bool use_previous_events) { return rmw_guard_condition_set_listener_callback( executor_context, - executor_callback, + listener_callback, guard_condition_handle, guard_condition->impl->rmw_handle, use_previous_events); diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 6de7ceea8..46d8433ac 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -371,15 +371,15 @@ rcl_service_is_valid(const rcl_service_t * service) } rcl_ret_t -rcl_service_set_events_executor_callback( +rcl_service_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * service_handle, const rcl_service_t * service) { return rmw_service_set_listener_callback( executor_context, - executor_callback, + listener_callback, service_handle, service->impl->rmw_handle); } diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index d30c33706..e079ac885 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -498,15 +498,15 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) } rcl_ret_t -rcl_subscription_set_events_executor_callback( +rcl_subscription_set_listener_callback( const void * executor_context, - EventsExecutorCallback executor_callback, + rmw_listener_cb_t listener_callback, const void * subscription_handle, const rcl_subscription_t * subscription) { return rmw_subscription_set_listener_callback( executor_context, - executor_callback, + listener_callback, subscription_handle, subscription->impl->rmw_handle); } From 18500301f21a7534822ceacba15e243c45c2c283 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Fri, 20 Nov 2020 16:13:47 +0000 Subject: [PATCH 16/24] Rename executor_context->callback_context --- rcl/include/rcl/client.h | 2 +- rcl/include/rcl/event.h | 2 +- rcl/include/rcl/guard_condition.h | 2 +- rcl/include/rcl/service.h | 2 +- rcl/include/rcl/subscription.h | 2 +- rcl/src/rcl/client.c | 4 ++-- rcl/src/rcl/event.c | 4 ++-- rcl/src/rcl/guard_condition.c | 4 ++-- rcl/src/rcl/service.c | 4 ++-- rcl/src/rcl/subscription.c | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 05157034f..7894c1bce 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -413,7 +413,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_client_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * client_handle, const rcl_client_t * client); diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index f1be71297..2d89e0b70 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -197,7 +197,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_event_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * event_handle, const rcl_event_t * event, diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 2d0219b82..969978e24 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -264,7 +264,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_guard_condition_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 603a5b4f5..7bec61e7f 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -427,7 +427,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_service_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * service_handle, const rcl_service_t * service); diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index b38d8e066..2f3e1a2a8 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -609,7 +609,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_subscription_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * subscription_handle, const rcl_subscription_t * subscription); diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 13dc026b4..055828713 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -352,13 +352,13 @@ rcl_client_is_valid(const rcl_client_t * client) rcl_ret_t rcl_client_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * client_handle, const rcl_client_t * client) { return rmw_client_set_listener_callback( - executor_context, + callback_context, listener_callback, client_handle, client->impl->rmw_handle); diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 3c7c98037..2096dcfab 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -220,14 +220,14 @@ rcl_event_is_valid(const rcl_event_t * event) rcl_ret_t rcl_event_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * event_handle, const rcl_event_t * event, bool use_previous_events) { return rmw_event_set_listener_callback( - executor_context, + callback_context, listener_callback, event_handle, &event->impl->rmw_handle, diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 2bf4566d2..5e4891045 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -188,14 +188,14 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition rcl_ret_t rcl_guard_condition_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, bool use_previous_events) { return rmw_guard_condition_set_listener_callback( - executor_context, + callback_context, listener_callback, guard_condition_handle, guard_condition->impl->rmw_handle, diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 46d8433ac..d44961e06 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -372,13 +372,13 @@ rcl_service_is_valid(const rcl_service_t * service) rcl_ret_t rcl_service_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * service_handle, const rcl_service_t * service) { return rmw_service_set_listener_callback( - executor_context, + callback_context, listener_callback, service_handle, service->impl->rmw_handle); diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index e079ac885..ad0650eed 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -499,13 +499,13 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) rcl_ret_t rcl_subscription_set_listener_callback( - const void * executor_context, + const void * callback_context, rmw_listener_cb_t listener_callback, const void * subscription_handle, const rcl_subscription_t * subscription) { return rmw_subscription_set_listener_callback( - executor_context, + callback_context, listener_callback, subscription_handle, subscription->impl->rmw_handle); From 527e32cea5d4ec7f82301e3a0478098051db7a04 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Tue, 1 Dec 2020 15:39:59 +0000 Subject: [PATCH 17/24] Rename callback_context->user_data --- rcl/include/rcl/client.h | 2 +- rcl/include/rcl/event.h | 2 +- rcl/include/rcl/guard_condition.h | 2 +- rcl/include/rcl/service.h | 2 +- rcl/include/rcl/subscription.h | 2 +- rcl/src/rcl/client.c | 4 ++-- rcl/src/rcl/event.c | 4 ++-- rcl/src/rcl/guard_condition.c | 4 ++-- rcl/src/rcl/service.c | 4 ++-- rcl/src/rcl/subscription.c | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 7894c1bce..9d464991e 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -413,7 +413,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_client_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * client_handle, const rcl_client_t * client); diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index 2d89e0b70..d3484f6b3 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -197,7 +197,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_event_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * event_handle, const rcl_event_t * event, diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 969978e24..8ac132774 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -264,7 +264,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_guard_condition_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 7bec61e7f..c928e3a35 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -427,7 +427,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_service_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * service_handle, const rcl_service_t * service); diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 2f3e1a2a8..86c8b3b88 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -609,7 +609,7 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_subscription_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * subscription_handle, const rcl_subscription_t * subscription); diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 055828713..7b6b14002 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -352,13 +352,13 @@ rcl_client_is_valid(const rcl_client_t * client) rcl_ret_t rcl_client_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * client_handle, const rcl_client_t * client) { return rmw_client_set_listener_callback( - callback_context, + user_data, listener_callback, client_handle, client->impl->rmw_handle); diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 2096dcfab..832d29585 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -220,14 +220,14 @@ rcl_event_is_valid(const rcl_event_t * event) rcl_ret_t rcl_event_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * event_handle, const rcl_event_t * event, bool use_previous_events) { return rmw_event_set_listener_callback( - callback_context, + user_data, listener_callback, event_handle, &event->impl->rmw_handle, diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 5e4891045..4fea4f4f8 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -188,14 +188,14 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition rcl_ret_t rcl_guard_condition_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * guard_condition_handle, const rcl_guard_condition_t * guard_condition, bool use_previous_events) { return rmw_guard_condition_set_listener_callback( - callback_context, + user_data, listener_callback, guard_condition_handle, guard_condition->impl->rmw_handle, diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index d44961e06..90ae3e026 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -372,13 +372,13 @@ rcl_service_is_valid(const rcl_service_t * service) rcl_ret_t rcl_service_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * service_handle, const rcl_service_t * service) { return rmw_service_set_listener_callback( - callback_context, + user_data, listener_callback, service_handle, service->impl->rmw_handle); diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index ad0650eed..c267e9349 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -499,13 +499,13 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) rcl_ret_t rcl_subscription_set_listener_callback( - const void * callback_context, + const void * user_data, rmw_listener_cb_t listener_callback, const void * subscription_handle, const rcl_subscription_t * subscription) { return rmw_subscription_set_listener_callback( - callback_context, + user_data, listener_callback, subscription_handle, subscription->impl->rmw_handle); From fd9c5de9210fc6d61a7af377ba4b4e9b8eee1b0c Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Thu, 21 Jan 2021 15:59:28 -0300 Subject: [PATCH 18/24] Reorder APIs arguments --- rcl/include/rcl/client.h | 6 +++--- rcl/include/rcl/event.h | 4 ++-- rcl/include/rcl/guard_condition.h | 4 ++-- rcl/include/rcl/service.h | 6 +++--- rcl/include/rcl/subscription.h | 6 +++--- rcl/src/rcl/client.c | 12 ++++++------ rcl/src/rcl/event.c | 8 ++++---- rcl/src/rcl/guard_condition.c | 8 ++++---- rcl/src/rcl/service.c | 12 ++++++------ rcl/src/rcl/subscription.c | 12 ++++++------ 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 9d464991e..f0ca6370a 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -413,10 +413,10 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_client_set_listener_callback( - const void * user_data, + const rcl_client_t * client, rmw_listener_cb_t listener_callback, - const void * client_handle, - const rcl_client_t * client); + const void * user_data, + const void * client_handle); #ifdef __cplusplus } diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index d3484f6b3..9b684a50c 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -197,10 +197,10 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_event_set_listener_callback( - const void * user_data, + const rcl_event_t * event, rmw_listener_cb_t listener_callback, + const void * user_data, const void * event_handle, - const rcl_event_t * event, bool use_previous_events); #ifdef __cplusplus diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 8ac132774..8de5f9367 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -264,10 +264,10 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_guard_condition_set_listener_callback( - const void * user_data, + const rcl_guard_condition_t * guard_condition, rmw_listener_cb_t listener_callback, + const void * user_data, const void * guard_condition_handle, - const rcl_guard_condition_t * guard_condition, bool use_previous_events); #ifdef __cplusplus diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index c928e3a35..0f4213dd7 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -427,10 +427,10 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_service_set_listener_callback( - const void * user_data, + const rcl_service_t * service, rmw_listener_cb_t listener_callback, - const void * service_handle, - const rcl_service_t * service); + const void * user_data, + const void * service_handle); #ifdef __cplusplus } diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 86c8b3b88..f7c869f16 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -609,10 +609,10 @@ RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_subscription_set_listener_callback( - const void * user_data, + const rcl_subscription_t * subscription, rmw_listener_cb_t listener_callback, - const void * subscription_handle, - const rcl_subscription_t * subscription); + const void * user_data, + const void * subscription_handle); #ifdef __cplusplus } diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 2d0a6153e..6c2b614ba 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -283,16 +283,16 @@ rcl_client_is_valid(const rcl_client_t * client) rcl_ret_t rcl_client_set_listener_callback( - const void * user_data, + const rcl_client_t * client, rmw_listener_cb_t listener_callback, - const void * client_handle, - const rcl_client_t * client) + const void * user_data, + const void * client_handle) { return rmw_client_set_listener_callback( - user_data, + client->impl->rmw_handle, listener_callback, - client_handle, - client->impl->rmw_handle); + user_data, + client_handle); } #ifdef __cplusplus diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 832d29585..75224aec2 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -220,17 +220,17 @@ rcl_event_is_valid(const rcl_event_t * event) rcl_ret_t rcl_event_set_listener_callback( - const void * user_data, + const rcl_event_t * event, rmw_listener_cb_t listener_callback, + const void * user_data, const void * event_handle, - const rcl_event_t * event, bool use_previous_events) { return rmw_event_set_listener_callback( - user_data, + &event->impl->rmw_handle, listener_callback, + user_data, event_handle, - &event->impl->rmw_handle, use_previous_events); } diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 4fea4f4f8..f611a8af2 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -188,17 +188,17 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition rcl_ret_t rcl_guard_condition_set_listener_callback( - const void * user_data, + const rcl_guard_condition_t * guard_condition, rmw_listener_cb_t listener_callback, + const void * user_data, const void * guard_condition_handle, - const rcl_guard_condition_t * guard_condition, bool use_previous_events) { return rmw_guard_condition_set_listener_callback( - user_data, + guard_condition->impl->rmw_handle, listener_callback, + user_data, guard_condition_handle, - guard_condition->impl->rmw_handle, use_previous_events); } diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 224b9b786..52708cd6f 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -303,16 +303,16 @@ rcl_service_is_valid(const rcl_service_t * service) rcl_ret_t rcl_service_set_listener_callback( - const void * user_data, + const rcl_service_t * service, rmw_listener_cb_t listener_callback, - const void * service_handle, - const rcl_service_t * service) + const void * user_data, + const void * service_handle) { return rmw_service_set_listener_callback( - user_data, + service->impl->rmw_handle, listener_callback, - service_handle, - service->impl->rmw_handle); + user_data, + service_handle); } diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index a508edfc9..af9c1b3d1 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -439,16 +439,16 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) rcl_ret_t rcl_subscription_set_listener_callback( - const void * user_data, + const rcl_subscription_t * subscription, rmw_listener_cb_t listener_callback, - const void * subscription_handle, - const rcl_subscription_t * subscription) + const void * user_data, + const void * subscription_handle) { return rmw_subscription_set_listener_callback( - user_data, + subscription->impl->rmw_handle, listener_callback, - subscription_handle, - subscription->impl->rmw_handle); + user_data, + subscription_handle); } #ifdef __cplusplus From 82d4119ae2961d19d577aca5dbb2e1e19012ee33 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Mon, 8 Feb 2021 14:22:03 -0300 Subject: [PATCH 19/24] rename rmw_listener_cb_t->rmw_listener_callback_t --- rcl/include/rcl/client.h | 2 +- rcl/include/rcl/event.h | 2 +- rcl/include/rcl/guard_condition.h | 2 +- rcl/include/rcl/service.h | 2 +- rcl/include/rcl/subscription.h | 2 +- rcl/src/rcl/client.c | 2 +- rcl/src/rcl/event.c | 2 +- rcl/src/rcl/guard_condition.c | 2 +- rcl/src/rcl/service.c | 2 +- rcl/src/rcl/subscription.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index f0ca6370a..c26fe3c8b 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -414,7 +414,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_client_set_listener_callback( const rcl_client_t * client, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * client_handle); diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index 9b684a50c..4b52eff4e 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -198,7 +198,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_event_set_listener_callback( const rcl_event_t * event, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * event_handle, bool use_previous_events); diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 8de5f9367..a2f51d217 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -265,7 +265,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_guard_condition_set_listener_callback( const rcl_guard_condition_t * guard_condition, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * guard_condition_handle, bool use_previous_events); diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 0f4213dd7..95ac98c3a 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -428,7 +428,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_service_set_listener_callback( const rcl_service_t * service, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * service_handle); diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index f7c869f16..075a70a8c 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -610,7 +610,7 @@ RCL_WARN_UNUSED rcl_ret_t rcl_subscription_set_listener_callback( const rcl_subscription_t * subscription, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * subscription_handle); diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index 6c2b614ba..a2edcee79 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -284,7 +284,7 @@ rcl_client_is_valid(const rcl_client_t * client) rcl_ret_t rcl_client_set_listener_callback( const rcl_client_t * client, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * client_handle) { diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index 75224aec2..c449ed709 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -221,7 +221,7 @@ rcl_event_is_valid(const rcl_event_t * event) rcl_ret_t rcl_event_set_listener_callback( const rcl_event_t * event, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * event_handle, bool use_previous_events) diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index f611a8af2..5a4b0a69f 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -189,7 +189,7 @@ rcl_guard_condition_get_rmw_handle(const rcl_guard_condition_t * guard_condition rcl_ret_t rcl_guard_condition_set_listener_callback( const rcl_guard_condition_t * guard_condition, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * guard_condition_handle, bool use_previous_events) diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 52708cd6f..79a15f35c 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -304,7 +304,7 @@ rcl_service_is_valid(const rcl_service_t * service) rcl_ret_t rcl_service_set_listener_callback( const rcl_service_t * service, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * service_handle) { diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index af9c1b3d1..a8628ee0f 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -440,7 +440,7 @@ rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription) rcl_ret_t rcl_subscription_set_listener_callback( const rcl_subscription_t * subscription, - rmw_listener_cb_t listener_callback, + rmw_listener_callback_t listener_callback, const void * user_data, const void * subscription_handle) { From 7d7e59a657230d381cf1da272f6e47a6ef5680bd Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Mon, 15 Feb 2021 15:15:00 -0300 Subject: [PATCH 20/24] use void * to pass executor ptr --- rcl/include/rcl/client.h | 2 +- rcl/include/rcl/event.h | 2 +- rcl/include/rcl/guard_condition.h | 2 +- rcl/include/rcl/service.h | 2 +- rcl/include/rcl/subscription.h | 2 +- rcl/src/rcl/client.c | 2 +- rcl/src/rcl/event.c | 2 +- rcl/src/rcl/guard_condition.c | 2 +- rcl/src/rcl/service.c | 2 +- rcl/src/rcl/subscription.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index c26fe3c8b..803cc072d 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -415,7 +415,7 @@ rcl_ret_t rcl_client_set_listener_callback( const rcl_client_t * client, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * client_handle); #ifdef __cplusplus diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index 4b52eff4e..a999a460d 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -199,7 +199,7 @@ rcl_ret_t rcl_event_set_listener_callback( const rcl_event_t * event, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * event_handle, bool use_previous_events); diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index a2f51d217..7913eeff8 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -266,7 +266,7 @@ rcl_ret_t rcl_guard_condition_set_listener_callback( const rcl_guard_condition_t * guard_condition, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * guard_condition_handle, bool use_previous_events); diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 95ac98c3a..ad56cee0a 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -429,7 +429,7 @@ rcl_ret_t rcl_service_set_listener_callback( const rcl_service_t * service, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * service_handle); #ifdef __cplusplus diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 075a70a8c..ec6099f28 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -611,7 +611,7 @@ rcl_ret_t rcl_subscription_set_listener_callback( const rcl_subscription_t * subscription, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * subscription_handle); #ifdef __cplusplus diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index a2edcee79..a630a2313 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -285,7 +285,7 @@ rcl_ret_t rcl_client_set_listener_callback( const rcl_client_t * client, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * client_handle) { return rmw_client_set_listener_callback( diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index c449ed709..c55c94c10 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -222,7 +222,7 @@ rcl_ret_t rcl_event_set_listener_callback( const rcl_event_t * event, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * event_handle, bool use_previous_events) { diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 5a4b0a69f..1d5e0a060 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -190,7 +190,7 @@ rcl_ret_t rcl_guard_condition_set_listener_callback( const rcl_guard_condition_t * guard_condition, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * guard_condition_handle, bool use_previous_events) { diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 79a15f35c..992019cc5 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -305,7 +305,7 @@ rcl_ret_t rcl_service_set_listener_callback( const rcl_service_t * service, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * service_handle) { return rmw_service_set_listener_callback( diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index a8628ee0f..dda9cede0 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -441,7 +441,7 @@ rcl_ret_t rcl_subscription_set_listener_callback( const rcl_subscription_t * subscription, rmw_listener_callback_t listener_callback, - const void * user_data, + void * user_data, const void * subscription_handle) { return rmw_subscription_set_listener_callback( From d97b2492839341ddab4bbb0bf426aabf611f01db Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Fri, 26 Feb 2021 15:51:12 -0300 Subject: [PATCH 21/24] Rework executor callback data --- rcl/include/rcl/client.h | 3 +-- rcl/include/rcl/event.h | 3 +-- rcl/include/rcl/guard_condition.h | 3 +-- rcl/include/rcl/service.h | 3 +-- rcl/include/rcl/subscription.h | 3 +-- rcl/src/rcl/client.c | 10 ++++------ rcl/src/rcl/event.c | 12 +++++------- rcl/src/rcl/guard_condition.c | 12 +++++------- rcl/src/rcl/service.c | 10 ++++------ rcl/src/rcl/subscription.c | 10 ++++------ 10 files changed, 27 insertions(+), 42 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 803cc072d..6e3bc478a 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -415,8 +415,7 @@ rcl_ret_t rcl_client_set_listener_callback( const rcl_client_t * client, rmw_listener_callback_t listener_callback, - void * user_data, - const void * client_handle); + const void * user_data); #ifdef __cplusplus } diff --git a/rcl/include/rcl/event.h b/rcl/include/rcl/event.h index a999a460d..d5974483a 100644 --- a/rcl/include/rcl/event.h +++ b/rcl/include/rcl/event.h @@ -199,8 +199,7 @@ rcl_ret_t rcl_event_set_listener_callback( const rcl_event_t * event, rmw_listener_callback_t listener_callback, - void * user_data, - const void * event_handle, + const void * user_data, bool use_previous_events); #ifdef __cplusplus diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index 7913eeff8..e69beb331 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -266,8 +266,7 @@ rcl_ret_t rcl_guard_condition_set_listener_callback( const rcl_guard_condition_t * guard_condition, rmw_listener_callback_t listener_callback, - void * user_data, - const void * guard_condition_handle, + const void * user_data, bool use_previous_events); #ifdef __cplusplus diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index ad56cee0a..2ba693e32 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -429,8 +429,7 @@ rcl_ret_t rcl_service_set_listener_callback( const rcl_service_t * service, rmw_listener_callback_t listener_callback, - void * user_data, - const void * service_handle); + const void * user_data); #ifdef __cplusplus } diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index ec6099f28..60664aec2 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -611,8 +611,7 @@ rcl_ret_t rcl_subscription_set_listener_callback( const rcl_subscription_t * subscription, rmw_listener_callback_t listener_callback, - void * user_data, - const void * subscription_handle); + const void * user_data); #ifdef __cplusplus } diff --git a/rcl/src/rcl/client.c b/rcl/src/rcl/client.c index a630a2313..1c35e9456 100644 --- a/rcl/src/rcl/client.c +++ b/rcl/src/rcl/client.c @@ -285,14 +285,12 @@ rcl_ret_t rcl_client_set_listener_callback( const rcl_client_t * client, rmw_listener_callback_t listener_callback, - void * user_data, - const void * client_handle) + const void * user_data) { return rmw_client_set_listener_callback( - client->impl->rmw_handle, - listener_callback, - user_data, - client_handle); + client->impl->rmw_handle, + listener_callback, + user_data); } #ifdef __cplusplus diff --git a/rcl/src/rcl/event.c b/rcl/src/rcl/event.c index c55c94c10..b4cf09b69 100644 --- a/rcl/src/rcl/event.c +++ b/rcl/src/rcl/event.c @@ -222,16 +222,14 @@ rcl_ret_t rcl_event_set_listener_callback( const rcl_event_t * event, rmw_listener_callback_t listener_callback, - void * user_data, - const void * event_handle, + const void * user_data, bool use_previous_events) { return rmw_event_set_listener_callback( - &event->impl->rmw_handle, - listener_callback, - user_data, - event_handle, - use_previous_events); + &event->impl->rmw_handle, + listener_callback, + user_data, + use_previous_events); } #ifdef __cplusplus diff --git a/rcl/src/rcl/guard_condition.c b/rcl/src/rcl/guard_condition.c index 1d5e0a060..cac4bfc42 100644 --- a/rcl/src/rcl/guard_condition.c +++ b/rcl/src/rcl/guard_condition.c @@ -190,16 +190,14 @@ rcl_ret_t rcl_guard_condition_set_listener_callback( const rcl_guard_condition_t * guard_condition, rmw_listener_callback_t listener_callback, - void * user_data, - const void * guard_condition_handle, + const void * user_data, bool use_previous_events) { return rmw_guard_condition_set_listener_callback( - guard_condition->impl->rmw_handle, - listener_callback, - user_data, - guard_condition_handle, - use_previous_events); + guard_condition->impl->rmw_handle, + listener_callback, + user_data, + use_previous_events); } #ifdef __cplusplus diff --git a/rcl/src/rcl/service.c b/rcl/src/rcl/service.c index 992019cc5..dd39176a8 100644 --- a/rcl/src/rcl/service.c +++ b/rcl/src/rcl/service.c @@ -305,14 +305,12 @@ rcl_ret_t rcl_service_set_listener_callback( const rcl_service_t * service, rmw_listener_callback_t listener_callback, - void * user_data, - const void * service_handle) + const void * user_data) { return rmw_service_set_listener_callback( - service->impl->rmw_handle, - listener_callback, - user_data, - service_handle); + service->impl->rmw_handle, + listener_callback, + user_data); } diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index dda9cede0..57fc2dc46 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -441,14 +441,12 @@ rcl_ret_t rcl_subscription_set_listener_callback( const rcl_subscription_t * subscription, rmw_listener_callback_t listener_callback, - void * user_data, - const void * subscription_handle) + const void * user_data) { return rmw_subscription_set_listener_callback( - subscription->impl->rmw_handle, - listener_callback, - user_data, - subscription_handle); + subscription->impl->rmw_handle, + listener_callback, + user_data); } #ifdef __cplusplus From 205bee50a0e1febf8dc51c98f48762668681dbb6 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Fri, 26 Feb 2021 18:25:25 -0300 Subject: [PATCH 22/24] Use RMW renamed file --- rcl/include/rcl/client.h | 2 +- rcl/include/rcl/guard_condition.h | 2 +- rcl/include/rcl/service.h | 2 +- rcl/include/rcl/subscription.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rcl/include/rcl/client.h b/rcl/include/rcl/client.h index 6e3bc478a..7ca81d2a8 100644 --- a/rcl/include/rcl/client.h +++ b/rcl/include/rcl/client.h @@ -26,7 +26,7 @@ extern "C" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rmw/listener_event_types.h" +#include "rmw/listener_callback_type.h" /// Internal rcl client implementation struct. struct rcl_client_impl_t; diff --git a/rcl/include/rcl/guard_condition.h b/rcl/include/rcl/guard_condition.h index e69beb331..007874516 100644 --- a/rcl/include/rcl/guard_condition.h +++ b/rcl/include/rcl/guard_condition.h @@ -26,7 +26,7 @@ extern "C" #include "rcl/types.h" #include "rcl/visibility_control.h" -#include "rmw/listener_event_types.h" +#include "rmw/listener_callback_type.h" /// Internal rcl guard condition implementation struct. struct rcl_guard_condition_impl_t; diff --git a/rcl/include/rcl/service.h b/rcl/include/rcl/service.h index 2ba693e32..787d29a71 100644 --- a/rcl/include/rcl/service.h +++ b/rcl/include/rcl/service.h @@ -26,7 +26,7 @@ extern "C" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rmw/listener_event_types.h" +#include "rmw/listener_callback_type.h" /// Internal rcl implementation struct. struct rcl_service_impl_t; diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 60664aec2..18a950f6d 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -26,7 +26,7 @@ extern "C" #include "rcl/node.h" #include "rcl/visibility_control.h" -#include "rmw/listener_event_types.h" +#include "rmw/listener_callback_type.h" #include "rmw/message_sequence.h" /// Internal rcl implementation struct. From 1fce4a0c3d86d715c203fa6ad1cc2c595c246125 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Thu, 25 Feb 2021 12:03:35 -0300 Subject: [PATCH 23/24] Add support to actions --- rcl_action/include/rcl_action/action_client.h | 33 ++++++++ rcl_action/include/rcl_action/action_server.h | 33 ++++++++ rcl_action/include/rcl_action/types.h | 20 +++++ rcl_action/src/rcl_action/action_client.c | 80 +++++++++++++++++++ rcl_action/src/rcl_action/action_server.c | 58 ++++++++++++++ 5 files changed, 224 insertions(+) diff --git a/rcl_action/include/rcl_action/action_client.h b/rcl_action/include/rcl_action/action_client.h index 430d05e66..a8eb66941 100644 --- a/rcl_action/include/rcl_action/action_client.h +++ b/rcl_action/include/rcl_action/action_client.h @@ -25,6 +25,8 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" +#include "rmw/listener_event_types.h" + /// Internal action client implementation struct. struct rcl_action_client_impl_t; @@ -741,6 +743,37 @@ bool rcl_action_client_is_valid( const rcl_action_client_t * action_client); +/// Get the action client events ID. +/** + * This function fills the array passed as argument + * with the action client events ID. + * The IDs are pointers to the action client entities + * which respond to action client events. + * \param[in] action_client pointer to the action client + * \param[in] events_id the array to store the IDs + */ +RCL_ACTION_PUBLIC +void +rcl_action_client_get_events_id( + const rcl_action_client_t * action_client, + const void * events_id[]); + +/// Set the action client listeners callback +/** + * This function set the listener callbacks to the + * entities conforming the action client. + * \param[in] action_client pointer to the action client + * \param[in] listener_callback the listener callback + * \param[in] user_data array of data used by the callbacks + */ +RCL_ACTION_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_action_client_set_listeners_callback( + const rcl_action_client_t * action_client, + rmw_listener_callback_t listener_callback, + const void * user_data[]); + #ifdef __cplusplus } #endif diff --git a/rcl_action/include/rcl_action/action_server.h b/rcl_action/include/rcl_action/action_server.h index 79abff41f..1036429a3 100644 --- a/rcl_action/include/rcl_action/action_server.h +++ b/rcl_action/include/rcl_action/action_server.h @@ -27,6 +27,8 @@ extern "C" #include "rcl/node.h" #include "rcl/time.h" +#include "rmw/listener_event_types.h" + #include "rosidl_runtime_c/action_type_support_struct.h" /// Internal rcl_action implementation struct. @@ -930,6 +932,37 @@ RCL_WARN_UNUSED bool rcl_action_server_is_valid_except_context(const rcl_action_server_t * action_server); +/// Get the action server events ID. +/** + * This function fills the array passed as argument + * with the action server events ID. + * The IDs are pointers to the action server entities + * which respond to action server events. + * \param[in] action_server pointer to the action server + * \param[in] events_id the array to store the IDs + */ +RCL_ACTION_PUBLIC +void +rcl_action_server_get_events_id( + const rcl_action_server_t * action_server, + const void * events_id[]); + +/// Set the action server listeners callback +/** + * This function set the listener callbacks to the + * entities conforming the action server. + * \param[in] action_server pointer to the action server + * \param[in] listener_callback the listener callback + * \param[in] user_data array of data used by the callbacks + */ +RCL_ACTION_PUBLIC +RCL_WARN_UNUSED +rcl_ret_t +rcl_action_server_set_listeners_callback( + const rcl_action_server_t * action_server, + rmw_listener_callback_t listener_callback, + const void * user_data[]); + #ifdef __cplusplus } #endif diff --git a/rcl_action/include/rcl_action/types.h b/rcl_action/include/rcl_action/types.h index d5f60e446..bd4b14091 100644 --- a/rcl_action/include/rcl_action/types.h +++ b/rcl_action/include/rcl_action/types.h @@ -113,6 +113,26 @@ typedef enum rcl_action_goal_event_t GOAL_EVENT_NUM_EVENTS } rcl_action_goal_event_t; +/// Action client entities +typedef enum rcl_action_client_entity_type_t +{ + GOAL_CLIENT = 0, + RESULT_CLIENT, + CANCEL_CLIENT, + FEEDBACK_SUBSCRIPTION, + STATUS_SUBSCRIPTION, + ACTION_CLIENT_NUM_ENTITIES +} rcl_action_client_entity_type_t; + +/// Action server entities +typedef enum rcl_action_server_entity_type_t +{ + GOAL_SERVICE = 0, + CANCEL_SERVICE, + RESULT_SERVICE, + ACTION_SERVER_NUM_ENTITIES +} rcl_action_server_entity_type_t; + /// Return a rcl_action_goal_info_t with members set to zero values. RCL_ACTION_PUBLIC RCL_WARN_UNUSED diff --git a/rcl_action/src/rcl_action/action_client.c b/rcl_action/src/rcl_action/action_client.c index 58ab0a9a0..5d68ea2df 100644 --- a/rcl_action/src/rcl_action/action_client.c +++ b/rcl_action/src/rcl_action/action_client.c @@ -647,6 +647,86 @@ rcl_action_client_wait_set_get_entities_ready( return RCL_RET_OK; } +void rcl_action_client_get_events_id( + const rcl_action_client_t * action_client, + const void * events_id[]) +{ + events_id[GOAL_CLIENT] = &action_client->impl->goal_client; + events_id[RESULT_CLIENT] = &action_client->impl->result_client; + events_id[CANCEL_CLIENT] = &action_client->impl->cancel_client; + events_id[FEEDBACK_SUBSCRIPTION] = &action_client->impl->feedback_subscription; + events_id[STATUS_SUBSCRIPTION] = &action_client->impl->status_subscription; +} + +rcl_ret_t +rcl_action_client_set_listeners_callback( + const rcl_action_client_t * action_client, + rmw_listener_callback_t listener_callback, + const void * user_data[]) +{ + if (!rcl_action_client_is_valid(action_client)) { + return RCL_RET_ACTION_CLIENT_INVALID; + } + + const void * goal_client_data = NULL; + const void * cancel_client_data = NULL; + const void * result_client_data = NULL; + const void * feedback_subscription_data = NULL; + const void * status_subscription_data = NULL; + + if (user_data) { + goal_client_data = user_data[GOAL_CLIENT]; + cancel_client_data = user_data[CANCEL_CLIENT]; + result_client_data = user_data[RESULT_CLIENT]; + feedback_subscription_data = user_data[FEEDBACK_SUBSCRIPTION]; + status_subscription_data = user_data[STATUS_SUBSCRIPTION]; + } + + rcl_ret_t ret; + + ret = rcl_client_set_listener_callback( + &action_client->impl->goal_client, + listener_callback, + goal_client_data); + if (ret != RCL_RET_OK) { + return ret; + } + + ret = rcl_client_set_listener_callback( + &action_client->impl->cancel_client, + listener_callback, + cancel_client_data); + if (ret != RCL_RET_OK) { + return ret; + } + + ret = rcl_client_set_listener_callback( + &action_client->impl->result_client, + listener_callback, + result_client_data); + if (ret != RCL_RET_OK) { + return ret; + } + + ret = rcl_subscription_set_listener_callback( + &action_client->impl->feedback_subscription, + listener_callback, + feedback_subscription_data); + if (ret != RCL_RET_OK) { + return ret; + } + + ret = rcl_subscription_set_listener_callback( + &action_client->impl->status_subscription, + listener_callback, + status_subscription_data); + if (ret != RCL_RET_OK) { + return ret; + } + + return RCL_RET_OK; +} + #ifdef __cplusplus } #endif diff --git a/rcl_action/src/rcl_action/action_server.c b/rcl_action/src/rcl_action/action_server.c index cbed688eb..51553d73c 100644 --- a/rcl_action/src/rcl_action/action_server.c +++ b/rcl_action/src/rcl_action/action_server.c @@ -1054,6 +1054,64 @@ rcl_action_server_wait_set_get_entities_ready( return RCL_RET_OK; } +void rcl_action_server_get_events_id( + const rcl_action_server_t * action_server, + const void * events_id[]) +{ + events_id[GOAL_SERVICE] = &action_server->impl->goal_service; + events_id[RESULT_SERVICE] = &action_server->impl->result_service; + events_id[CANCEL_SERVICE] = &action_server->impl->cancel_service; +} + +rcl_ret_t +rcl_action_server_set_listeners_callback( + const rcl_action_server_t * action_server, + rmw_listener_callback_t listener_callback, + const void * user_data[]) +{ + if (!rcl_action_server_is_valid_except_context(action_server)) { + return RCL_RET_ACTION_SERVER_INVALID; + } + + const void * goal_service_data = NULL; + const void * cancel_service_data = NULL; + const void * result_service_data = NULL; + + if (user_data) { + goal_service_data = user_data[GOAL_SERVICE]; + cancel_service_data = user_data[CANCEL_SERVICE]; + result_service_data = user_data[RESULT_SERVICE]; + } + + rcl_ret_t ret; + + ret = rcl_service_set_listener_callback( + &action_server->impl->goal_service, + listener_callback, + goal_service_data); + if (ret != RCL_RET_OK) { + return ret; + } + + ret = rcl_service_set_listener_callback( + &action_server->impl->cancel_service, + listener_callback, + cancel_service_data); + if (ret != RCL_RET_OK) { + return ret; + } + + ret = rcl_service_set_listener_callback( + &action_server->impl->result_service, + listener_callback, + result_service_data); + if (ret != RCL_RET_OK) { + return ret; + } + + return RCL_RET_OK; +} + #ifdef __cplusplus } #endif From 8b906a1c9c8004bee0db0903f2bbf9643ad4f946 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Thu, 11 Mar 2021 16:37:13 -0300 Subject: [PATCH 24/24] Update file name --- rcl_action/include/rcl_action/action_client.h | 2 +- rcl_action/include/rcl_action/action_server.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rcl_action/include/rcl_action/action_client.h b/rcl_action/include/rcl_action/action_client.h index a8eb66941..8050d1dd7 100644 --- a/rcl_action/include/rcl_action/action_client.h +++ b/rcl_action/include/rcl_action/action_client.h @@ -25,7 +25,7 @@ extern "C" #include "rcl/macros.h" #include "rcl/node.h" -#include "rmw/listener_event_types.h" +#include "rmw/listener_callback_type.h" /// Internal action client implementation struct. diff --git a/rcl_action/include/rcl_action/action_server.h b/rcl_action/include/rcl_action/action_server.h index 1036429a3..bd07bf848 100644 --- a/rcl_action/include/rcl_action/action_server.h +++ b/rcl_action/include/rcl_action/action_server.h @@ -27,7 +27,7 @@ extern "C" #include "rcl/node.h" #include "rcl/time.h" -#include "rmw/listener_event_types.h" +#include "rmw/listener_callback_type.h" #include "rosidl_runtime_c/action_type_support_struct.h"