From 41a7e783ecbd9af41a3382576ca1229f14323a20 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Thu, 3 Oct 2019 15:49:08 -0700 Subject: [PATCH 1/4] add mechanism to pass rmw impl specific payloads during pub/sub creation Signed-off-by: William Woodall --- rclcpp/CMakeLists.txt | 3 ++ .../rmw_implementation_specific_payload.hpp | 50 +++++++++++++++++++ ...lementation_specific_publisher_payload.hpp | 48 ++++++++++++++++++ ...entation_specific_subscription_payload.hpp | 49 ++++++++++++++++++ rclcpp/include/rclcpp/publisher.hpp | 5 ++ rclcpp/include/rclcpp/publisher_options.hpp | 12 +++++ rclcpp/include/rclcpp/subscription.hpp | 7 +++ .../include/rclcpp/subscription_options.hpp | 18 ++++++- .../rmw_implementation_specific_payload.cpp | 35 +++++++++++++ ...lementation_specific_publisher_payload.cpp | 33 ++++++++++++ ...entation_specific_subscription_payload.cpp | 33 ++++++++++++ 11 files changed, 291 insertions(+), 2 deletions(-) create mode 100644 rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp create mode 100644 rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp create mode 100644 rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp create mode 100644 rclcpp/src/rclcpp/detail/rmw_implementation_specific_payload.cpp create mode 100644 rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp create mode 100644 rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp diff --git a/rclcpp/CMakeLists.txt b/rclcpp/CMakeLists.txt index bdf968b9b2..0fa5b9754f 100644 --- a/rclcpp/CMakeLists.txt +++ b/rclcpp/CMakeLists.txt @@ -32,6 +32,9 @@ set(${PROJECT_NAME}_SRCS src/rclcpp/clock.cpp src/rclcpp/context.cpp src/rclcpp/contexts/default_context.cpp + src/rclcpp/detail/rmw_implementation_specific_payload.cpp + src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp + src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp src/rclcpp/duration.cpp src/rclcpp/event.cpp src/rclcpp/exceptions.cpp diff --git a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp new file mode 100644 index 0000000000..c16d02a19c --- /dev/null +++ b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp @@ -0,0 +1,50 @@ +// Copyright 2019 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PAYLOAD_HPP_ +#define RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PAYLOAD_HPP_ + +#include "rclcpp/visibility_control.hpp" + +namespace rclcpp +{ +namespace detail +{ + +/// Mechanism for passing rmw implementation specific settings through the ROS interfaces. +struct RCLCPP_PUBLIC RMWImplementationSpecificPayload +{ + virtual + ~RMWImplementationSpecificPayload() = default; + + /// Return false if this class has not been customized, otherwise true. + /** + * It does this based on the value of the rmw implementation identifier that + * this class reports, and so it is important for a specialization of this + * class to override the get_rmw_implementation_identifier() method to return + * something other than nullptr. + */ + bool + has_been_customized() const; + + /// Derrived classes should override this and return the identifier of its rmw implementation. + virtual + const char * + get_implementation_identifier() const; +}; + +} // namespace detail +} // namespace rclcpp + +#endif // RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PAYLOAD_HPP_ diff --git a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp new file mode 100644 index 0000000000..a1379556f6 --- /dev/null +++ b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp @@ -0,0 +1,48 @@ +// Copyright 2019 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PUBLISHER_PAYLOAD_HPP_ +#define RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PUBLISHER_PAYLOAD_HPP_ + +#include "rcl/publisher.h" + +#include "rclcpp/detail/rmw_implementation_specific_payload.hpp" +#include "rclcpp/visibility_control.hpp" + +namespace rclcpp +{ +namespace detail +{ + +struct RCLCPP_PUBLIC RMWImplementationSpecificPublisherPayload + : public RMWImplementationSpecificPayload +{ + ~RMWImplementationSpecificPublisherPayload() override = default; + + /// Opportunity for a derived class to inject information into the rcl options. + /** + * This is called after the rcl_publisher_options_t has been prepared by + * rclcpp, but before rcl_publisher_init() is called. + * + * By default the options are unmodified. + */ + virtual + void + modify_rcl_publisher_options(rcl_publisher_options_t & rcl_publisher_options) const; +}; + +} // namespace detail +} // namespace rclcpp + +#endif // RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_PUBLISHER_PAYLOAD_HPP_ diff --git a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp new file mode 100644 index 0000000000..020ecba675 --- /dev/null +++ b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp @@ -0,0 +1,49 @@ +// Copyright 2019 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_SUBSCRIPTION_PAYLOAD_HPP_ +#define RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_SUBSCRIPTION_PAYLOAD_HPP_ + +#include "rcl/subscription.h" + +#include "rclcpp/detail/rmw_implementation_specific_payload.hpp" +#include "rclcpp/visibility_control.hpp" + +namespace rclcpp +{ +namespace detail +{ + +/// Subscription payload that may be rmw implementation specific. +struct RCLCPP_PUBLIC RMWImplementationSpecificSubscriptionPayload + : public RMWImplementationSpecificPayload +{ + ~RMWImplementationSpecificSubscriptionPayload() override = default; + + /// Opportunity for a derived class to inject information into the rcl options. + /** + * This is called after the rcl_subscription_options_t has been prepared by + * rclcpp, but before rcl_subscription_init() is called. + * + * By default the options are unmodified. + */ + virtual + void + modify_rcl_subscription_options(rcl_subscription_options_t & rcl_subscription_options) const; +}; + +} // namespace detail +} // namespace rclcpp + +#endif // RCLCPP__DETAIL__RMW_IMPLEMENTATION_SPECIFIC_SUBSCRIPTION_PAYLOAD_HPP_ diff --git a/rclcpp/include/rclcpp/publisher.hpp b/rclcpp/include/rclcpp/publisher.hpp index 2bb31018c5..e9df937004 100644 --- a/rclcpp/include/rclcpp/publisher.hpp +++ b/rclcpp/include/rclcpp/publisher.hpp @@ -288,6 +288,11 @@ class Publisher : public PublisherBase return message_seq; } + /// Copy of original options passed during construction. + /** + * It is important to save a copy of this so that the rmw payload which it + * may contain is kept alive for the duration of the publisher. + */ const rclcpp::PublisherOptionsWithAllocator options_; std::shared_ptr message_allocator_; diff --git a/rclcpp/include/rclcpp/publisher_options.hpp b/rclcpp/include/rclcpp/publisher_options.hpp index 405d3399d3..ab66d025a7 100644 --- a/rclcpp/include/rclcpp/publisher_options.hpp +++ b/rclcpp/include/rclcpp/publisher_options.hpp @@ -22,6 +22,7 @@ #include "rcl/publisher.h" #include "rclcpp/allocator/allocator_common.hpp" +#include "rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp" #include "rclcpp/intra_process_setting.hpp" #include "rclcpp/qos.hpp" #include "rclcpp/qos_event.hpp" @@ -45,6 +46,10 @@ struct PublisherOptionsBase /// Callback group in which the waitable items from the publisher should be placed. std::shared_ptr callback_group; + + /// Optional RMW implementation specific payload to be used during creation of the publisher. + std::shared_ptr + rmw_implementation_payload = nullptr; }; /// Structure containing optional configuration for Publishers. @@ -72,9 +77,16 @@ struct PublisherOptionsWithAllocator : public PublisherOptionsBase auto message_alloc = std::make_shared(*this->get_allocator().get()); result.allocator = rclcpp::allocator::get_rcl_allocator(*message_alloc); result.qos = qos.get_rmw_qos_profile(); + + // Apply payload to rcl_publisher_options if necessary. + if (rmw_implementation_payload && rmw_implementation_payload->has_been_customized()) { + rmw_implementation_payload->modify_rcl_publisher_options(result); + } + return result; } + /// Get the allocator, creating one if needed. std::shared_ptr get_allocator() const diff --git a/rclcpp/include/rclcpp/subscription.hpp b/rclcpp/include/rclcpp/subscription.hpp index ae768359c2..4be5284b5f 100644 --- a/rclcpp/include/rclcpp/subscription.hpp +++ b/rclcpp/include/rclcpp/subscription.hpp @@ -104,6 +104,7 @@ class Subscription : public SubscriptionBase options.template to_rcl_subscription_options(qos), rclcpp::subscription_traits::is_serialized_subscription_argument::value), any_callback_(callback), + options_(options), message_memory_strategy_(message_memory_strategy) { if (options.event_callbacks.deadline_callback) { @@ -302,6 +303,12 @@ class Subscription : public SubscriptionBase RCLCPP_DISABLE_COPY(Subscription) AnySubscriptionCallback any_callback_; + /// Copy of original options passed during construction. + /** + * It is important to save a copy of this so that the rmw payload which it + * may contain is kept alive for the duration of the subscription. + */ + const rclcpp::SubscriptionOptionsWithAllocator options_; typename message_memory_strategy::MessageMemoryStrategy::SharedPtr message_memory_strategy_; }; diff --git a/rclcpp/include/rclcpp/subscription_options.hpp b/rclcpp/include/rclcpp/subscription_options.hpp index 710d66af47..f381cc1d29 100644 --- a/rclcpp/include/rclcpp/subscription_options.hpp +++ b/rclcpp/include/rclcpp/subscription_options.hpp @@ -20,6 +20,7 @@ #include #include "rclcpp/callback_group.hpp" +#include "rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp" #include "rclcpp/intra_process_setting.hpp" #include "rclcpp/qos.hpp" #include "rclcpp/qos_event.hpp" @@ -33,12 +34,19 @@ struct SubscriptionOptionsBase { /// Callbacks for events related to this subscription. SubscriptionEventCallbacks event_callbacks; + /// True to ignore local publications. bool ignore_local_publications = false; + /// The callback group for this subscription. NULL to use the default callback group. rclcpp::callback_group::CallbackGroup::SharedPtr callback_group = nullptr; + /// Setting to explicitly set intraprocess communications. IntraProcessSetting use_intra_process_comm = IntraProcessSetting::NodeDefault; + + /// Optional RMW implementation specific payload to be used during creation of the subscription. + std::shared_ptr + rmw_implementation_payload = nullptr; }; /// Structure containing optional configuration for Subscriptions. @@ -61,13 +69,19 @@ struct SubscriptionOptionsWithAllocator : public SubscriptionOptionsBase rcl_subscription_options_t to_rcl_subscription_options(const rclcpp::QoS & qos) const { - rcl_subscription_options_t result; + rcl_subscription_options_t result = rcl_subscription_get_default_options(); using AllocatorTraits = std::allocator_traits; using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc; auto message_alloc = std::make_shared(*allocator.get()); result.allocator = allocator::get_rcl_allocator(*message_alloc); - result.ignore_local_publications = this->ignore_local_publications; result.qos = qos.get_rmw_qos_profile(); + result.rmw_subscription_options.ignore_local_publications = this->ignore_local_publications; + + // Apply payload to rcl_subscription_options if necessary. + if (rmw_implementation_payload && rmw_implementation_payload->has_been_customized()) { + rmw_implementation_payload->modify_rcl_subscription_options(result); + } + return result; } diff --git a/rclcpp/src/rclcpp/detail/rmw_implementation_specific_payload.cpp b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_payload.cpp new file mode 100644 index 0000000000..be6ec91c9b --- /dev/null +++ b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_payload.cpp @@ -0,0 +1,35 @@ +// Copyright 2019 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +namespace rclcpp +{ +namespace detail +{ + +bool +RMWImplementationSpecificPayload::has_been_customized() const +{ + return nullptr != this->get_implementation_identifier(); +} + +const char * +RMWImplementationSpecificPayload::get_implementation_identifier() const +{ + return nullptr; +} + +} // namespace detail +} // namespace rclcpp diff --git a/rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp new file mode 100644 index 0000000000..4d5c2c0a3d --- /dev/null +++ b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp @@ -0,0 +1,33 @@ +// Copyright 2019 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "rcl/publisher.h" + +namespace rclcpp +{ +namespace detail +{ + +void +RMWImplementationSpecificPublisherPayload::modify_rcl_publisher_options( + rcl_publisher_options_t & rcl_publisher_options) const +{ + // By default, do not mutate the rcl publisher options. + (void)rcl_publisher_options; +} + +} // namespace detail +} // namespace rclcpp diff --git a/rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp new file mode 100644 index 0000000000..b7c660eafa --- /dev/null +++ b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp @@ -0,0 +1,33 @@ +// Copyright 2019 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include + +#include "rcl/subscription.h" + +namespace rclcpp +{ +namespace detail +{ + +void +RMWImplementationSpecificSubscriptionPayload::modify_rcl_subscription_options( + rcl_subscription_options_t & rcl_subscription_options) const +{ + // By default, do not mutate the rcl subscription options. + (void)rcl_subscription_options; +} + +} // namespace detail +} // namespace rclcpp From a0a9ce482931505681544d5148aaa45c68623ba2 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Mon, 7 Oct 2019 10:59:49 -0700 Subject: [PATCH 2/4] use class instead of struct Signed-off-by: William Woodall --- .../rclcpp/detail/rmw_implementation_specific_payload.hpp | 3 ++- .../detail/rmw_implementation_specific_publisher_payload.hpp | 3 ++- .../rmw_implementation_specific_subscription_payload.hpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp index c16d02a19c..60bc930f9d 100644 --- a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp +++ b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_payload.hpp @@ -23,8 +23,9 @@ namespace detail { /// Mechanism for passing rmw implementation specific settings through the ROS interfaces. -struct RCLCPP_PUBLIC RMWImplementationSpecificPayload +class RCLCPP_PUBLIC RMWImplementationSpecificPayload { +public: virtual ~RMWImplementationSpecificPayload() = default; diff --git a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp index a1379556f6..4a1f60e80a 100644 --- a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp +++ b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp @@ -25,9 +25,10 @@ namespace rclcpp namespace detail { -struct RCLCPP_PUBLIC RMWImplementationSpecificPublisherPayload +class RCLCPP_PUBLIC RMWImplementationSpecificPublisherPayload : public RMWImplementationSpecificPayload { +public: ~RMWImplementationSpecificPublisherPayload() override = default; /// Opportunity for a derived class to inject information into the rcl options. diff --git a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp index 020ecba675..d412cbcf32 100644 --- a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp +++ b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp @@ -26,9 +26,10 @@ namespace detail { /// Subscription payload that may be rmw implementation specific. -struct RCLCPP_PUBLIC RMWImplementationSpecificSubscriptionPayload +class RCLCPP_PUBLIC RMWImplementationSpecificSubscriptionPayload : public RMWImplementationSpecificPayload { +public: ~RMWImplementationSpecificSubscriptionPayload() override = default; /// Opportunity for a derived class to inject information into the rcl options. From ac90f9abf69af2b16c230b8825560a7cefef3ae3 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Mon, 7 Oct 2019 16:45:08 -0700 Subject: [PATCH 3/4] narrow API of rmw payload to just use rmw_*_options_t's Signed-off-by: William Woodall --- .../rmw_implementation_specific_publisher_payload.hpp | 5 ++++- .../rmw_implementation_specific_subscription_payload.hpp | 5 ++++- .../rmw_implementation_specific_publisher_payload.cpp | 8 ++++---- .../rmw_implementation_specific_subscription_payload.cpp | 8 ++++---- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp index 4a1f60e80a..08925a17d1 100644 --- a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp +++ b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_publisher_payload.hpp @@ -36,11 +36,14 @@ class RCLCPP_PUBLIC RMWImplementationSpecificPublisherPayload * This is called after the rcl_publisher_options_t has been prepared by * rclcpp, but before rcl_publisher_init() is called. * + * The passed option is the rmw_publisher_options field of the + * rcl_publisher_options_t that will be passed to rcl_publisher_init(). + * * By default the options are unmodified. */ virtual void - modify_rcl_publisher_options(rcl_publisher_options_t & rcl_publisher_options) const; + modify_rmw_publisher_options(rmw_publisher_options_t & rmw_publisher_options) const; }; } // namespace detail diff --git a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp index d412cbcf32..b909a35179 100644 --- a/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp +++ b/rclcpp/include/rclcpp/detail/rmw_implementation_specific_subscription_payload.hpp @@ -37,11 +37,14 @@ class RCLCPP_PUBLIC RMWImplementationSpecificSubscriptionPayload * This is called after the rcl_subscription_options_t has been prepared by * rclcpp, but before rcl_subscription_init() is called. * + * The passed option is the rmw_subscription_options field of the + * rcl_subscription_options_t that will be passed to rcl_subscription_init(). + * * By default the options are unmodified. */ virtual void - modify_rcl_subscription_options(rcl_subscription_options_t & rcl_subscription_options) const; + modify_rmw_subscription_options(rmw_subscription_options_t & rmw_subscription_options) const; }; } // namespace detail diff --git a/rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp index 4d5c2c0a3d..cd7580d493 100644 --- a/rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp +++ b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_publisher_payload.cpp @@ -22,11 +22,11 @@ namespace detail { void -RMWImplementationSpecificPublisherPayload::modify_rcl_publisher_options( - rcl_publisher_options_t & rcl_publisher_options) const +RMWImplementationSpecificPublisherPayload::modify_rmw_publisher_options( + rmw_publisher_options_t & rmw_publisher_options) const { - // By default, do not mutate the rcl publisher options. - (void)rcl_publisher_options; + // By default, do not mutate the rmw publisher options. + (void)rmw_publisher_options; } } // namespace detail diff --git a/rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp index b7c660eafa..c84c3d4b03 100644 --- a/rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp +++ b/rclcpp/src/rclcpp/detail/rmw_implementation_specific_subscription_payload.cpp @@ -22,11 +22,11 @@ namespace detail { void -RMWImplementationSpecificSubscriptionPayload::modify_rcl_subscription_options( - rcl_subscription_options_t & rcl_subscription_options) const +RMWImplementationSpecificSubscriptionPayload::modify_rmw_subscription_options( + rmw_subscription_options_t & rmw_subscription_options) const { - // By default, do not mutate the rcl subscription options. - (void)rcl_subscription_options; + // By default, do not mutate the rmw subscription options. + (void)rmw_subscription_options; } } // namespace detail From 3cb431ce4307dbc50db1a355b70e26986ae65b58 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Tue, 8 Oct 2019 12:50:30 -0700 Subject: [PATCH 4/4] fixup after recent change Signed-off-by: William Woodall --- rclcpp/include/rclcpp/publisher_options.hpp | 2 +- rclcpp/include/rclcpp/subscription_options.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rclcpp/include/rclcpp/publisher_options.hpp b/rclcpp/include/rclcpp/publisher_options.hpp index ab66d025a7..cd78d51569 100644 --- a/rclcpp/include/rclcpp/publisher_options.hpp +++ b/rclcpp/include/rclcpp/publisher_options.hpp @@ -80,7 +80,7 @@ struct PublisherOptionsWithAllocator : public PublisherOptionsBase // Apply payload to rcl_publisher_options if necessary. if (rmw_implementation_payload && rmw_implementation_payload->has_been_customized()) { - rmw_implementation_payload->modify_rcl_publisher_options(result); + rmw_implementation_payload->modify_rmw_publisher_options(result.rmw_publisher_options); } return result; diff --git a/rclcpp/include/rclcpp/subscription_options.hpp b/rclcpp/include/rclcpp/subscription_options.hpp index f381cc1d29..8ee6e7ffb4 100644 --- a/rclcpp/include/rclcpp/subscription_options.hpp +++ b/rclcpp/include/rclcpp/subscription_options.hpp @@ -79,7 +79,7 @@ struct SubscriptionOptionsWithAllocator : public SubscriptionOptionsBase // Apply payload to rcl_subscription_options if necessary. if (rmw_implementation_payload && rmw_implementation_payload->has_been_customized()) { - rmw_implementation_payload->modify_rcl_subscription_options(result); + rmw_implementation_payload->modify_rmw_subscription_options(result.rmw_subscription_options); } return result;