15 #ifndef BEHAVIOR_TREE__DUMMY_SERVICE_HPP_
16 #define BEHAVIOR_TREE__DUMMY_SERVICE_HPP_
24 #include "rclcpp_action/rclcpp_action.hpp"
25 #include "rclcpp/rclcpp.hpp"
27 namespace nav2_system_tests
30 template<
class ServiceT>
35 const rclcpp::Node::SharedPtr & node,
36 std::string service_name)
38 service_name_(service_name),
42 service_ = node->create_service<ServiceT>(
44 std::bind(&DummyService::handle_service,
this, _1, _2, _3));
58 service_ = node_->create_service<ServiceT>(
60 std::bind(&DummyService::handle_service,
this, _1, _2, _3));
71 int getRequestCount()
const
73 return request_count_;
77 virtual void fillResponse(
78 const std::shared_ptr<typename ServiceT::Request>,
79 const std::shared_ptr<typename ServiceT::Response>) {}
82 const std::shared_ptr<rmw_request_id_t>,
83 const std::shared_ptr<typename ServiceT::Request> request,
84 const std::shared_ptr<typename ServiceT::Response> response)
87 fillResponse(request, response);
91 rclcpp::Node::SharedPtr node_;
92 typename rclcpp::Service<ServiceT>::SharedPtr service_;
93 std::string service_name_;