From d2b174349496315b669734c9dbdd849b4892e0d2 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 27 Feb 2023 14:08:56 -0800 Subject: [PATCH] Migrate to rosidl_dynamic_typesupport and update field IDs Signed-off-by: methylDragon --- rclcpp/CMakeLists.txt | 2 +- ...scription.hpp => dynamic_subscription.hpp} | 50 ++++++++-------- .../include/rclcpp/generic_subscription.hpp | 12 ++-- rclcpp/include/rclcpp/rclcpp.hpp | 2 +- rclcpp/include/rclcpp/subscription.hpp | 16 ++--- rclcpp/include/rclcpp/subscription_base.hpp | 32 +++++----- ...scription.cpp => dynamic_subscription.cpp} | 58 +++++++++---------- rclcpp/src/rclcpp/executor.cpp | 18 +++--- rclcpp/src/rclcpp/generic_subscription.cpp | 16 ++--- rclcpp/src/rclcpp/subscription_base.cpp | 16 ++--- .../node_interfaces/test_node_topics.cpp | 10 ++-- rclcpp/test/rclcpp/test_generic_pubsub.cpp | 4 +- 12 files changed, 118 insertions(+), 118 deletions(-) rename rclcpp/include/rclcpp/{runtime_type_subscription.hpp => dynamic_subscription.hpp} (76%) rename rclcpp/src/rclcpp/{runtime_type_subscription.cpp => dynamic_subscription.cpp} (53%) diff --git a/rclcpp/CMakeLists.txt b/rclcpp/CMakeLists.txt index 4d454fe5c4..cf9b5c602d 100644 --- a/rclcpp/CMakeLists.txt +++ b/rclcpp/CMakeLists.txt @@ -94,7 +94,7 @@ set(${PROJECT_NAME}_SRCS src/rclcpp/qos.cpp src/rclcpp/qos_event.cpp src/rclcpp/qos_overriding_options.cpp - src/rclcpp/runtime_type_subscription.cpp + src/rclcpp/dynamic_subscription.cpp src/rclcpp/serialization.cpp src/rclcpp/serialized_message.cpp src/rclcpp/service.cpp diff --git a/rclcpp/include/rclcpp/runtime_type_subscription.hpp b/rclcpp/include/rclcpp/dynamic_subscription.hpp similarity index 76% rename from rclcpp/include/rclcpp/runtime_type_subscription.hpp rename to rclcpp/include/rclcpp/dynamic_subscription.hpp index a9ee646e88..018abc80bf 100644 --- a/rclcpp/include/rclcpp/runtime_type_subscription.hpp +++ b/rclcpp/include/rclcpp/dynamic_subscription.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef RCLCPP__RUNTIME_TYPE_SUBSCRIPTION_HPP_ -#define RCLCPP__RUNTIME_TYPE_SUBSCRIPTION_HPP_ +#ifndef RCLCPP__DYNAMIC_SUBSCRIPTION_HPP_ +#define RCLCPP__DYNAMIC_SUBSCRIPTION_HPP_ #include #include @@ -41,25 +41,25 @@ namespace rclcpp * * NOTE(methylDragon): No considerations for intra-process handling are made. */ -class RuntimeTypeSubscription : public rclcpp::SubscriptionBase +class DynamicSubscription : public rclcpp::SubscriptionBase { public: // cppcheck-suppress unknownMacro - RCLCPP_SMART_PTR_DEFINITIONS(RuntimeTypeSubscription) + RCLCPP_SMART_PTR_DEFINITIONS(DynamicSubscription) template> - RuntimeTypeSubscription( + DynamicSubscription( rclcpp::node_interfaces::NodeBaseInterface * node_base, rosidl_message_type_support_t & type_support_handle, const std::string & topic_name, const rclcpp::QoS & qos, - // TODO(methylDragons): Eventually roll out an rclcpp::DynamicData that encompasses the ser + // TODO(methylDragons): Eventually roll out an rclcpp::DynamicData that encompasses the serialization_support // support and DynamicData, and pass that to the callback std::function, std::shared_ptr + std::shared_ptr, std::shared_ptr )> callback, const rclcpp::SubscriptionOptionsWithAllocator & options, - bool use_take_runtime_type_message = false) + bool use_take_dynamic_message = false) : SubscriptionBase( node_base, type_support_handle, @@ -69,15 +69,15 @@ class RuntimeTypeSubscription : public rclcpp::SubscriptionBase options.use_default_callbacks, false, true, - use_take_runtime_type_message), + use_take_dynamic_message), ts_(type_support_handle), callback_(callback) { if(type_support_handle.typesupport_identifier - != rmw_typesupport_runtime_type_introspection_c__identifier) + != rmw_dynamic_typesupport_c__identifier) { throw std::runtime_error( - "RuntimeTypeSubscription must use runtime type introspection type support!"); + "DynamicSubscription must use runtime type introspection type support!"); } } @@ -85,14 +85,14 @@ class RuntimeTypeSubscription : public rclcpp::SubscriptionBase /// Deferred type description constructor, only usable if the middleware implementation supports /// type discovery // template> - // RuntimeTypeSubscription( + // DynamicSubscription( // rclcpp::node_interfaces::NodeBaseInterface * node_base, // const std::string & topic_name, // const rclcpp::QoS & qos, - // // TODO(methylDragons): Eventually roll out an rclcpp::DynamicData that encompasses the ser + // // TODO(methylDragons): Eventually roll out an rclcpp::DynamicData that encompasses the serialization_support // // support and DynamicData, and pass that to the callback // std::function, std::shared_ptr + // std::shared_ptr, std::shared_ptr // )> callback, // const rclcpp::SubscriptionOptionsWithAllocator & options, // const char * serialization_lib_name = nullptr) @@ -100,7 +100,7 @@ class RuntimeTypeSubscription : public rclcpp::SubscriptionBase // node_base, // // NOTE(methylDragon): Since the typesupport is deferred, it needs to be modified post-hoc // // which means it technically isn't const correct... - // *rmw_get_runtime_type_message_typesupport_handle(serialization_lib_name), + // *rmw_get_dynamic_message_typesupport_handle(serialization_lib_name), // topic_name, // options.to_rcl_subscription_options(qos), // options.event_callbacks, @@ -111,7 +111,7 @@ class RuntimeTypeSubscription : public rclcpp::SubscriptionBase // {} RCLCPP_PUBLIC - virtual ~RuntimeTypeSubscription() = default; + virtual ~DynamicSubscription() = default; // Same as create_serialized_message() as the subscription is to serialized_messages only RCLCPP_PUBLIC @@ -148,35 +148,35 @@ class RuntimeTypeSubscription : public rclcpp::SubscriptionBase // RUNTIME TYPE ================================================================================== // TODO(methylDragon): Reorder later RCLCPP_PUBLIC - std::shared_ptr + std::shared_ptr get_dynamic_type() override; RCLCPP_PUBLIC - std::shared_ptr + std::shared_ptr get_dynamic_data() override; RCLCPP_PUBLIC - std::shared_ptr + std::shared_ptr get_serialization_support() override; RCLCPP_PUBLIC - void handle_runtime_type_message( - const std::shared_ptr & ser, - const std::shared_ptr & dyn_data, + void handle_dynamic_message( + const std::shared_ptr & serialization_support, + const std::shared_ptr & dyn_data, const rclcpp::MessageInfo & message_info ) override; private: - RCLCPP_DISABLE_COPY(RuntimeTypeSubscription) + RCLCPP_DISABLE_COPY(DynamicSubscription) rosidl_message_type_support_t & ts_; std::function, std::shared_ptr + std::shared_ptr, std::shared_ptr )> callback_; }; } // namespace rclcpp -#endif // RCLCPP__RUNTIME_TYPE_SUBSCRIPTION_HPP_ +#endif // RCLCPP__DYNAMIC_SUBSCRIPTION_HPP_ diff --git a/rclcpp/include/rclcpp/generic_subscription.hpp b/rclcpp/include/rclcpp/generic_subscription.hpp index 6ab7d083eb..232a8a93bf 100644 --- a/rclcpp/include/rclcpp/generic_subscription.hpp +++ b/rclcpp/include/rclcpp/generic_subscription.hpp @@ -127,18 +127,18 @@ class GenericSubscription : public rclcpp::SubscriptionBase // RUNTIME TYPE ================================================================================== // TODO(methylDragon): Reorder later RCLCPP_PUBLIC - std::shared_ptr get_dynamic_type() override; + std::shared_ptr get_dynamic_type() override; RCLCPP_PUBLIC - std::shared_ptr get_dynamic_data() override; + std::shared_ptr get_dynamic_data() override; RCLCPP_PUBLIC - std::shared_ptr get_serialization_support() override; + std::shared_ptr get_serialization_support() override; RCLCPP_PUBLIC - void handle_runtime_type_message( - const std::shared_ptr & ser, - const std::shared_ptr & dyn_data, + void handle_dynamic_message( + const std::shared_ptr & serialization_support, + const std::shared_ptr & dyn_data, const rclcpp::MessageInfo & message_info) override; private: diff --git a/rclcpp/include/rclcpp/rclcpp.hpp b/rclcpp/include/rclcpp/rclcpp.hpp index af07196587..1611219ef1 100644 --- a/rclcpp/include/rclcpp/rclcpp.hpp +++ b/rclcpp/include/rclcpp/rclcpp.hpp @@ -167,6 +167,6 @@ #include "rclcpp/waitable.hpp" #include "rclcpp/wait_set.hpp" -#include "rclcpp/runtime_type_subscription.hpp" +#include "rclcpp/dynamic_subscription.hpp" #endif // RCLCPP__RCLCPP_HPP_ diff --git a/rclcpp/include/rclcpp/subscription.hpp b/rclcpp/include/rclcpp/subscription.hpp index 09f637e462..512babc3ed 100644 --- a/rclcpp/include/rclcpp/subscription.hpp +++ b/rclcpp/include/rclcpp/subscription.hpp @@ -391,21 +391,21 @@ class Subscription : public SubscriptionBase // RUNTIME TYPE ================================================================================== // TODO(methylDragon): Reorder later // TODO(methylDragon): Implement later... - std::shared_ptr + std::shared_ptr get_dynamic_type() override { throw rclcpp::exceptions::UnimplementedError( "get_dynamic_type is not implemented for Subscription"); } - std::shared_ptr + std::shared_ptr get_dynamic_data() override { throw rclcpp::exceptions::UnimplementedError( "get_dynamic_data is not implemented for Subscription"); } - std::shared_ptr + std::shared_ptr get_serialization_support() override { throw rclcpp::exceptions::UnimplementedError( @@ -413,16 +413,16 @@ class Subscription : public SubscriptionBase } void - handle_runtime_type_message( - const std::shared_ptr & ser, - const std::shared_ptr & dyn_data, + handle_dynamic_message( + const std::shared_ptr & serialization_support, + const std::shared_ptr & dyn_data, const rclcpp::MessageInfo & message_info) override { - (void) ser; + (void) serialization_support; (void) dyn_data; (void) message_info; throw rclcpp::exceptions::UnimplementedError( - "handle_runtime_type_message is not implemented for Subscription"); + "handle_dynamic_message is not implemented for Subscription"); } private: diff --git a/rclcpp/include/rclcpp/subscription_base.hpp b/rclcpp/include/rclcpp/subscription_base.hpp index 5f6ff5ef2d..1054528e67 100644 --- a/rclcpp/include/rclcpp/subscription_base.hpp +++ b/rclcpp/include/rclcpp/subscription_base.hpp @@ -77,7 +77,7 @@ class SubscriptionBase : public std::enable_shared_from_this * \param[in] topic_name Name of the topic to subscribe to. * \param[in] subscription_options Options for the subscription. * \param[in] is_serialized is true if the message will be delivered still serialized - * \param[in] use_runtime_type_cb is true if the message will be taken serialized and then handled + * \param[in] use_dynamic_message_cb is true if the message will be taken serialized and then handled * using dynamic type and dynamic data (type constructed at runtime) */ RCLCPP_PUBLIC @@ -89,8 +89,8 @@ class SubscriptionBase : public std::enable_shared_from_this const SubscriptionEventCallbacks & event_callbacks, bool use_default_callbacks, bool is_serialized = false, - bool use_runtime_type_cb = false, - bool use_take_runtime_type_message = false); + bool use_dynamic_message_cb = false, + bool use_take_dynamic_message = false); // TODO(methylDragon): If we don't need this, remove it, // rclcpp::node_interfaces::NodeGraphInterface * node_graph = 0, // rclcpp::node_interfaces::NodeServicesInterface * node_services = 0); @@ -546,47 +546,47 @@ class SubscriptionBase : public std::enable_shared_from_this // TODO(methylDragon): Reorder later RCLCPP_PUBLIC virtual - std::shared_ptr + std::shared_ptr get_dynamic_type() = 0; RCLCPP_PUBLIC virtual - std::shared_ptr + std::shared_ptr get_dynamic_data() = 0; RCLCPP_PUBLIC virtual - std::shared_ptr + std::shared_ptr get_serialization_support() = 0; RCLCPP_PUBLIC virtual void - handle_runtime_type_message( - const std::shared_ptr & ser, - const std::shared_ptr & dyn_data, + handle_dynamic_message( + const std::shared_ptr & serialization_support, + const std::shared_ptr & dyn_data, const rclcpp::MessageInfo & message_info ) = 0; // TODO(methylDragon): // RCLCPP_PUBLIC // bool - // take_runtime_type_message(ser_dynamic_data_t * message_out, rclcpp::MessageInfo & message_info_out); + // take_dynamic_message(rosidl_dynamic_typesupport_dynamic_data_t * message_out, rclcpp::MessageInfo & message_info_out); /// Return if the subscription should use runtime type /** - * This will cause the subscription to use the handle_runtime_type_message methods, which must be - * used with take_serialized or take_runtime_type. + * This will cause the subscription to use the handle_dynamic_message methods, which must be + * used with take_serialized or take_dynamic_message. * * \return `true` if the subscription should use a runtime type callback, `false` otherwise */ RCLCPP_PUBLIC bool - use_runtime_type_cb() const; + use_dynamic_message_cb() const; RCLCPP_PUBLIC bool - use_take_runtime_type_message() const; + use_take_dynamic_message() const; // =============================================================================================== @@ -644,8 +644,8 @@ class SubscriptionBase : public std::enable_shared_from_this rosidl_message_type_support_t type_support_; bool is_serialized_; - bool use_runtime_type_cb_; - bool use_take_runtime_type_message_; + bool use_dynamic_message_cb_; + bool use_take_dynamic_message_; std::atomic subscription_in_use_by_wait_set_{false}; std::atomic intra_process_subscription_waitable_in_use_by_wait_set_{false}; diff --git a/rclcpp/src/rclcpp/runtime_type_subscription.cpp b/rclcpp/src/rclcpp/dynamic_subscription.cpp similarity index 53% rename from rclcpp/src/rclcpp/runtime_type_subscription.cpp rename to rclcpp/src/rclcpp/dynamic_subscription.cpp index 9edfa5a0f1..777038659e 100644 --- a/rclcpp/src/rclcpp/runtime_type_subscription.cpp +++ b/rclcpp/src/rclcpp/dynamic_subscription.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "rclcpp/runtime_type_subscription.hpp" +#include "rclcpp/dynamic_subscription.hpp" #include #include @@ -24,44 +24,44 @@ namespace rclcpp { -std::shared_ptr RuntimeTypeSubscription::create_message() +std::shared_ptr DynamicSubscription::create_message() { return create_serialized_message(); } -std::shared_ptr RuntimeTypeSubscription::create_serialized_message() +std::shared_ptr DynamicSubscription::create_serialized_message() { return std::make_shared(0); } -void RuntimeTypeSubscription::handle_message( +void DynamicSubscription::handle_message( std::shared_ptr &, const rclcpp::MessageInfo &) { throw rclcpp::exceptions::UnimplementedError( - "handle_message is not implemented for RuntimeTypeSubscription"); + "handle_message is not implemented for DynamicSubscription"); } -void RuntimeTypeSubscription::handle_serialized_message( +void DynamicSubscription::handle_serialized_message( const std::shared_ptr &, const rclcpp::MessageInfo &) { throw rclcpp::exceptions::UnimplementedError( - "handle_serialized_message is not implemented for RuntimeTypeSubscription"); + "handle_serialized_message is not implemented for DynamicSubscription"); } -void RuntimeTypeSubscription::handle_loaned_message( +void DynamicSubscription::handle_loaned_message( void *, const rclcpp::MessageInfo &) { throw rclcpp::exceptions::UnimplementedError( - "handle_loaned_message is not implemented for RuntimeTypeSubscription"); + "handle_loaned_message is not implemented for DynamicSubscription"); } -void RuntimeTypeSubscription::return_message(std::shared_ptr & message) +void DynamicSubscription::return_message(std::shared_ptr & message) { auto typed_message = std::static_pointer_cast(message); return_serialized_message(typed_message); } -void RuntimeTypeSubscription::return_serialized_message( +void DynamicSubscription::return_serialized_message( std::shared_ptr & message) { message.reset(); @@ -70,14 +70,14 @@ void RuntimeTypeSubscription::return_serialized_message( // RUNTIME TYPE ==================================================================================== // TODO(methylDragon): Re-order later -std::shared_ptr -RuntimeTypeSubscription::get_dynamic_type() +std::shared_ptr +DynamicSubscription::get_dynamic_type() { - auto ts_impl = (runtime_type_ts_impl_t *)(ts_.data); + auto ts_impl = (rmw_dynamic_typesupport_impl_t *)(ts_.data); // no-op deleter because the lifetime is managed by the typesupport outside - return std::shared_ptr( - ts_impl->dynamic_type, [](ser_dynamic_type_t *){} + return std::shared_ptr( + ts_impl->dynamic_type, [](rosidl_dynamic_typesupport_dynamic_type_t *){} ); }; @@ -85,33 +85,33 @@ RuntimeTypeSubscription::get_dynamic_type() // to the typesupport instead? // If that's the case, will there ever be a lifetime contention between a sub // that manages the data and the callback/user usage of the data? -std::shared_ptr -RuntimeTypeSubscription::get_dynamic_data() +std::shared_ptr +DynamicSubscription::get_dynamic_data() { - auto ts_impl = (runtime_type_ts_impl_t *)(ts_.data); + auto ts_impl = (rmw_dynamic_typesupport_impl_t *)(ts_.data); // no-op deleter because the lifetime is managed by the typesupport outside - return std::shared_ptr( - ts_impl->dynamic_data, [](ser_dynamic_data_t *){} + return std::shared_ptr( + ts_impl->dynamic_data, [](rosidl_dynamic_typesupport_dynamic_data_t *){} ); }; -std::shared_ptr RuntimeTypeSubscription::get_serialization_support() +std::shared_ptr DynamicSubscription::get_serialization_support() { - auto ts_impl = (runtime_type_ts_impl_t *)(ts_.data); + auto ts_impl = (rmw_dynamic_typesupport_impl_t *)(ts_.data); // no-op deleter because the lifetime is managed by the typesupport outside - return std::shared_ptr( - ts_impl->ser, [](serialization_support_t *){} + return std::shared_ptr( + ts_impl->serialization_support, [](rosidl_dynamic_typesupport_serialization_support_t *){} ); }; -void RuntimeTypeSubscription::handle_runtime_type_message( - const std::shared_ptr & ser, - const std::shared_ptr & dyn_data, +void DynamicSubscription::handle_dynamic_message( + const std::shared_ptr & serialization_support, + const std::shared_ptr & dyn_data, const rclcpp::MessageInfo &) { - callback_(ser, dyn_data); + callback_(serialization_support, dyn_data); } } // namespace rclcpp diff --git a/rclcpp/src/rclcpp/executor.cpp b/rclcpp/src/rclcpp/executor.cpp index 5608052cff..566c5a37ca 100644 --- a/rclcpp/src/rclcpp/executor.cpp +++ b/rclcpp/src/rclcpp/executor.cpp @@ -601,7 +601,7 @@ Executor::execute_subscription(rclcpp::SubscriptionBase::SharedPtr subscription) message_info.get_rmw_message_info().from_intra_process = false; // PROPOSED ====================================================================================== - // If a subscription is meant to use_runtime_type_cb, then it will use its serialization-specific + // If a subscription is meant to use_dynamic_message_cb, then it will use its serialization-specific // dynamic data. // // Two cases: @@ -612,12 +612,12 @@ Executor::execute_subscription(rclcpp::SubscriptionBase::SharedPtr subscription) // - TODO(methylDragon): I won't be handling this case yet // // TODO(methylDragon): - // - use_runtime_type_cb (can use take_serialized or take_runtime_type) - // - take_runtime_type (MUST have use_runtime_type_cb true) - if (subscription->use_runtime_type_cb()) { - if (subscription->use_take_runtime_type_message()) { + // - use_dynamic_message_cb (can use take_serialized or take_dynamic_message) + // - take_dynamic_message (MUST have use_dynamic_message_cb true) + if (subscription->use_dynamic_message_cb()) { + if (subscription->use_take_dynamic_message()) { // TODO(methylDragon) - throw rclcpp::exceptions::UnimplementedError("take_runtime_type_message is not implemented"); + throw rclcpp::exceptions::UnimplementedError("take_dynamic_message is not implemented"); } else { std::shared_ptr serialized_msg = subscription->create_serialized_message(); take_and_do_error_handling( @@ -626,8 +626,8 @@ Executor::execute_subscription(rclcpp::SubscriptionBase::SharedPtr subscription) [&]() {return subscription->take_serialized(*serialized_msg.get(), message_info);}, [&]() { - std::shared_ptr ser = subscription->get_serialization_support(); - std::shared_ptr dyn_data = subscription->get_dynamic_data(); + std::shared_ptr serialization_support = subscription->get_serialization_support(); + std::shared_ptr dyn_data = subscription->get_dynamic_data(); // NOTE(methylDragon): We might want to consider cloning the dynamic data here @@ -637,7 +637,7 @@ Executor::execute_subscription(rclcpp::SubscriptionBase::SharedPtr subscription) if (ret != RMW_RET_OK) { throw_from_rcl_error(ret, "Couldn't convert serialized message to dynamic data!"); } - subscription->handle_runtime_type_message(ser, dyn_data, message_info); + subscription->handle_dynamic_message(serialization_support, dyn_data, message_info); } ); subscription->return_serialized_message(serialized_msg); diff --git a/rclcpp/src/rclcpp/generic_subscription.cpp b/rclcpp/src/rclcpp/generic_subscription.cpp index 0209511951..3be4a67040 100644 --- a/rclcpp/src/rclcpp/generic_subscription.cpp +++ b/rclcpp/src/rclcpp/generic_subscription.cpp @@ -74,21 +74,21 @@ void GenericSubscription::return_serialized_message( // RUNTIME TYPE ================================================================================== // TODO(methylDragon): Reorder later -std::shared_ptr +std::shared_ptr GenericSubscription::get_dynamic_type() { throw rclcpp::exceptions::UnimplementedError( "get_dynamic_type is not implemented for GenericSubscription"); } -std::shared_ptr +std::shared_ptr GenericSubscription::get_dynamic_data() { throw rclcpp::exceptions::UnimplementedError( "get_dynamic_data is not implemented for GenericSubscription"); } -std::shared_ptr +std::shared_ptr GenericSubscription::get_serialization_support() { throw rclcpp::exceptions::UnimplementedError( @@ -96,16 +96,16 @@ GenericSubscription::get_serialization_support() } void -GenericSubscription::handle_runtime_type_message( - const std::shared_ptr & ser, - const std::shared_ptr & dyn_data, +GenericSubscription::handle_dynamic_message( + const std::shared_ptr & serialization_support, + const std::shared_ptr & dyn_data, const rclcpp::MessageInfo & message_info) { - (void) ser; + (void) serialization_support; (void) dyn_data; (void) message_info; throw rclcpp::exceptions::UnimplementedError( - "handle_runtime_type_message is not implemented for GenericSubscription"); + "handle_dynamic_message is not implemented for GenericSubscription"); } } // namespace rclcpp diff --git a/rclcpp/src/rclcpp/subscription_base.cpp b/rclcpp/src/rclcpp/subscription_base.cpp index 6ff196f269..f387de10e5 100644 --- a/rclcpp/src/rclcpp/subscription_base.cpp +++ b/rclcpp/src/rclcpp/subscription_base.cpp @@ -42,8 +42,8 @@ SubscriptionBase::SubscriptionBase( const SubscriptionEventCallbacks & event_callbacks, bool use_default_callbacks, bool is_serialized, - bool use_runtime_type_cb, - bool use_take_runtime_type_message) + bool use_dynamic_message_cb, + bool use_take_dynamic_message) : node_base_(node_base), node_handle_(node_base_->get_shared_rcl_node_handle()), node_logger_(rclcpp::get_node_logger(node_handle_.get())), @@ -52,8 +52,8 @@ SubscriptionBase::SubscriptionBase( event_callbacks_(event_callbacks), type_support_(type_support_handle), is_serialized_(is_serialized), - use_runtime_type_cb_(use_runtime_type_cb), - use_take_runtime_type_message_(use_take_runtime_type_message) + use_dynamic_message_cb_(use_dynamic_message_cb), + use_take_dynamic_message_(use_take_dynamic_message) { auto custom_deletor = [node_handle = this->node_handle_](rcl_subscription_t * rcl_subs) { @@ -487,13 +487,13 @@ SubscriptionBase::get_content_filter() const // RUNTIME TYPE ================================================================================== // TODO(methylDragon): Reorder later bool -SubscriptionBase::use_runtime_type_cb() const +SubscriptionBase::use_dynamic_message_cb() const { - return use_runtime_type_cb_; + return use_dynamic_message_cb_; } bool -SubscriptionBase::use_take_runtime_type_message() const +SubscriptionBase::use_take_dynamic_message() const { - return use_take_runtime_type_message_; + return use_take_dynamic_message_; } diff --git a/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp b/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp index b0664aff9b..d29b51a1c8 100644 --- a/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp +++ b/rclcpp/test/rclcpp/node_interfaces/test_node_topics.cpp @@ -78,11 +78,11 @@ class TestSubscription : public rclcpp::SubscriptionBase void return_message(std::shared_ptr &) override {} void return_serialized_message(std::shared_ptr &) override {} - std::shared_ptr get_dynamic_type() override {return nullptr;} - std::shared_ptr get_dynamic_data() override {return nullptr;} - std::shared_ptr get_serialization_support() override {return nullptr;} - void handle_runtime_type_message( - const std::shared_ptr &, const std::shared_ptr &, + std::shared_ptr get_dynamic_type() override {return nullptr;} + std::shared_ptr get_dynamic_data() override {return nullptr;} + std::shared_ptr get_serialization_support() override {return nullptr;} + void handle_dynamic_message( + const std::shared_ptr &, const std::shared_ptr &, const rclcpp::MessageInfo &) override {} }; diff --git a/rclcpp/test/rclcpp/test_generic_pubsub.cpp b/rclcpp/test/rclcpp/test_generic_pubsub.cpp index f4cef0b757..de50be4fe2 100644 --- a/rclcpp/test/rclcpp/test_generic_pubsub.cpp +++ b/rclcpp/test/rclcpp/test_generic_pubsub.cpp @@ -89,9 +89,9 @@ class RclcppGenericNodeFixture : public Test T2 message; write_message(data, message); - rclcpp::Serialization ser; + rclcpp::Serialization serialization_support; SerializedMessage result; - ser.serialize_message(&message, &result); + serialization_support.serialize_message(&message, &result); return result; }