15 #ifndef BEHAVIOR_TREE__DUMMY_SERVICE_HPP_
16 #define BEHAVIOR_TREE__DUMMY_SERVICE_HPP_
24 #include "rclcpp_action/rclcpp_action.hpp"
25 #include "rclcpp/node.hpp"
26 #include "rclcpp/service.hpp"
28 namespace nav2_system_tests
31 template<
class ServiceT>
36 const rclcpp::Node::SharedPtr & node,
37 std::string service_name)
39 service_name_(service_name),
43 service_ = node->create_service<ServiceT>(
45 std::bind(&DummyService::handle_service,
this, _1, _2, _3));
59 service_ = node_->create_service<ServiceT>(
61 std::bind(&DummyService::handle_service,
this, _1, _2, _3));
72 int getRequestCount()
const
74 return request_count_;
78 virtual void fillResponse(
79 const std::shared_ptr<typename ServiceT::Request>,
80 const std::shared_ptr<typename ServiceT::Response>) {}
83 const std::shared_ptr<rmw_request_id_t>,
84 const std::shared_ptr<typename ServiceT::Request> request,
85 const std::shared_ptr<typename ServiceT::Response> response)
88 fillResponse(request, response);
92 rclcpp::Node::SharedPtr node_;
93 typename rclcpp::Service<ServiceT>::SharedPtr service_;
94 std::string service_name_;