Skip to content

Commit b930ef5

Browse files
committed
service methods fixed
1 parent e933a2f commit b930ef5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

simple_node/include/simple_node/node.hpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <thread>
88

99
#include "rclcpp/executor.hpp"
10+
#include "rclcpp/qos.hpp"
1011
#include "rclcpp/rclcpp.hpp"
1112

1213
#include "simple_node/actions/action_client.hpp"
@@ -118,22 +119,23 @@ class Node : public rclcpp::Node {
118119
}
119120

120121
template <typename ServiceT>
121-
typename rclcpp::Client<ServiceT>::SharedPtr
122-
create_client(const std::string &service_name,
123-
const rmw_qos_profile_t &qos_profile) {
122+
typename rclcpp::Client<ServiceT>::SharedPtr create_client(
123+
const std::string &service_name,
124+
const rmw_qos_profile_t &qos_profile = rmw_qos_profile_services_default) {
124125
return rclcpp::create_client<ServiceT>(
125-
node_base_, node_graph_, node_services_,
126+
this->get_node_base_interface(), this->get_node_graph_interface(),
127+
this->get_node_services_interface(),
126128
rclcpp::extend_name_with_sub_namespace(service_name,
127129
this->get_sub_namespace()),
128130
qos_profile, this->group);
129131
}
130132

131133
template <typename ServiceT, typename CallbackT>
132-
typename rclcpp::Service<ServiceT>::SharedPtr
133-
create_service(const std::string &service_name, CallbackT &&callback,
134-
const rmw_qos_profile_t &qos_profile) {
134+
typename rclcpp::Service<ServiceT>::SharedPtr create_service(
135+
const std::string &service_name, CallbackT &&callback,
136+
const rmw_qos_profile_t &qos_profile = rmw_qos_profile_services_default) {
135137
return rclcpp::create_service<ServiceT, CallbackT>(
136-
node_base_, node_services_,
138+
this->get_node_base_interface(), this->get_node_services_interface(),
137139
rclcpp::extend_name_with_sub_namespace(service_name,
138140
this->get_sub_namespace()),
139141
std::forward<CallbackT>(callback), qos_profile, this->group);

0 commit comments

Comments
 (0)