|
7 | 7 | #include <thread> |
8 | 8 |
|
9 | 9 | #include "rclcpp/executor.hpp" |
| 10 | +#include "rclcpp/qos.hpp" |
10 | 11 | #include "rclcpp/rclcpp.hpp" |
11 | 12 |
|
12 | 13 | #include "simple_node/actions/action_client.hpp" |
@@ -118,22 +119,23 @@ class Node : public rclcpp::Node { |
118 | 119 | } |
119 | 120 |
|
120 | 121 | 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) { |
124 | 125 | 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(), |
126 | 128 | rclcpp::extend_name_with_sub_namespace(service_name, |
127 | 129 | this->get_sub_namespace()), |
128 | 130 | qos_profile, this->group); |
129 | 131 | } |
130 | 132 |
|
131 | 133 | 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) { |
135 | 137 | return rclcpp::create_service<ServiceT, CallbackT>( |
136 | | - node_base_, node_services_, |
| 138 | + this->get_node_base_interface(), this->get_node_services_interface(), |
137 | 139 | rclcpp::extend_name_with_sub_namespace(service_name, |
138 | 140 | this->get_sub_namespace()), |
139 | 141 | std::forward<CallbackT>(callback), qos_profile, this->group); |
|
0 commit comments