From 6ca1023ef77f19897d74b5864300125d92ac47b3 Mon Sep 17 00:00:00 2001 From: methylDragon Date: Mon, 1 May 2023 13:56:29 -0700 Subject: [PATCH] Fix delivered message kind (#2175) Signed-off-by: methylDragon --- rclcpp/include/rclcpp/subscription_base.hpp | 6 +++--- rclcpp/src/rclcpp/executor.cpp | 2 +- rclcpp/src/rclcpp/subscription_base.cpp | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rclcpp/include/rclcpp/subscription_base.hpp b/rclcpp/include/rclcpp/subscription_base.hpp index f4957824a5..b122e96575 100644 --- a/rclcpp/include/rclcpp/subscription_base.hpp +++ b/rclcpp/include/rclcpp/subscription_base.hpp @@ -260,13 +260,13 @@ class SubscriptionBase : public std::enable_shared_from_this bool is_serialized() const; - /// Return the type of the subscription. + /// Return the delivered message kind. /** * \return `DeliveredMessageKind`, which adjusts how messages are received and delivered. */ RCLCPP_PUBLIC DeliveredMessageKind - get_subscription_type() const; + get_delivered_message_kind() const; /// Get matching publisher count. /** \return The number of publishers on this topic. */ @@ -663,7 +663,7 @@ class SubscriptionBase : public std::enable_shared_from_this RCLCPP_DISABLE_COPY(SubscriptionBase) rosidl_message_type_support_t type_support_; - DeliveredMessageKind delivered_message_type_; + DeliveredMessageKind delivered_message_kind_; 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/executor.cpp b/rclcpp/src/rclcpp/executor.cpp index a7a2b8278b..50529a102a 100644 --- a/rclcpp/src/rclcpp/executor.cpp +++ b/rclcpp/src/rclcpp/executor.cpp @@ -603,7 +603,7 @@ Executor::execute_subscription(rclcpp::SubscriptionBase::SharedPtr subscription) rclcpp::MessageInfo message_info; message_info.get_rmw_message_info().from_intra_process = false; - switch (subscription->get_subscription_type()) { + switch (subscription->get_delivered_message_kind()) { // Deliver ROS message case rclcpp::DeliveredMessageKind::ROS_MESSAGE: { diff --git a/rclcpp/src/rclcpp/subscription_base.cpp b/rclcpp/src/rclcpp/subscription_base.cpp index 18ccab0eb0..6db3bf5ceb 100644 --- a/rclcpp/src/rclcpp/subscription_base.cpp +++ b/rclcpp/src/rclcpp/subscription_base.cpp @@ -52,7 +52,7 @@ SubscriptionBase::SubscriptionBase( intra_process_subscription_id_(0), event_callbacks_(event_callbacks), type_support_(type_support_handle), - delivered_message_type_(delivered_message_kind) + delivered_message_kind_(delivered_message_kind) { auto custom_deletor = [node_handle = this->node_handle_](rcl_subscription_t * rcl_subs) { @@ -261,13 +261,13 @@ SubscriptionBase::get_message_type_support_handle() const bool SubscriptionBase::is_serialized() const { - return delivered_message_type_ == rclcpp::DeliveredMessageKind::SERIALIZED_MESSAGE; + return delivered_message_kind_ == rclcpp::DeliveredMessageKind::SERIALIZED_MESSAGE; } rclcpp::DeliveredMessageKind -SubscriptionBase::get_subscription_type() const +SubscriptionBase::get_delivered_message_kind() const { - return delivered_message_type_; + return delivered_message_kind_; } size_t