From c845e9bd45e2913493b37ecd86cf1ee530e8685b Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Mon, 19 Oct 2015 12:58:21 -0700 Subject: [PATCH] Made rmw_qos_profile argument optional --- rclcpp/include/rclcpp/node.hpp | 7 ++++--- rclcpp/include/rclcpp/node_impl.hpp | 4 ++-- rclcpp/include/rclcpp/parameter_client.hpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/rclcpp/include/rclcpp/node.hpp b/rclcpp/include/rclcpp/node.hpp index 9c57c8c..f48ef80 100644 --- a/rclcpp/include/rclcpp/node.hpp +++ b/rclcpp/include/rclcpp/node.hpp @@ -112,13 +112,14 @@ public: template typename rclcpp::publisher::Publisher::SharedPtr create_publisher( - const std::string & topic_name, const rmw_qos_profile_t & qos_profile); + const std::string & topic_name, + const rmw_qos_profile_t & qos_profile = rmw_qos_profile_default); /// Create and return a Subscription. /** * \param[in] topic_name The topic to subscribe on. - * \param[in] qos_profile The quality of service profile to pass on to the rmw implementation. * \param[in] callback The user-defined callback function. + * \param[in] qos_profile The quality of service profile to pass on to the rmw implementation. * \param[in] group The callback group for this subscription. NULL for no callback group. * \param[in] ignore_local_publications True to ignore local publications. * \param[in] msg_mem_strat The message memory strategy to use for allocating messages. @@ -132,8 +133,8 @@ public: typename rclcpp::subscription::Subscription::SharedPtr create_subscription( const std::string & topic_name, - const rmw_qos_profile_t & qos_profile, CallbackT callback, + const rmw_qos_profile_t & qos_profile = rmw_qos_profile_default, rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr, bool ignore_local_publications = false, typename rclcpp::message_memory_strategy::MessageMemoryStrategy::SharedPtr diff --git a/rclcpp/include/rclcpp/node_impl.hpp b/rclcpp/include/rclcpp/node_impl.hpp index f854ada..b86cf8e 100644 --- a/rclcpp/include/rclcpp/node_impl.hpp +++ b/rclcpp/include/rclcpp/node_impl.hpp @@ -209,8 +209,8 @@ template typename rclcpp::subscription::Subscription::SharedPtr Node::create_subscription( const std::string & topic_name, - const rmw_qos_profile_t & qos_profile, CallbackT callback, + const rmw_qos_profile_t & qos_profile, rclcpp::callback_group::CallbackGroup::SharedPtr group, bool ignore_local_publications, typename rclcpp::message_memory_strategy::MessageMemoryStrategy::SharedPtr @@ -321,8 +321,8 @@ Node::create_subscription( qos.depth = qos_history_depth; return this->create_subscription( topic_name, - qos, callback, + qos, group, ignore_local_publications, msg_mem_strat); diff --git a/rclcpp/include/rclcpp/parameter_client.hpp b/rclcpp/include/rclcpp/parameter_client.hpp index 03bf28e..1ce0562 100644 --- a/rclcpp/include/rclcpp/parameter_client.hpp +++ b/rclcpp/include/rclcpp/parameter_client.hpp @@ -232,7 +232,7 @@ public: on_parameter_event(FunctorT callback) { return node_->create_subscription( - "parameter_events", rmw_qos_profile_parameter_events, callback); + "parameter_events", callback, rmw_qos_profile_parameter_events); } private: