17 #ifndef BEHAVIOR_TREE__SERVER_HANDLER_HPP_
18 #define BEHAVIOR_TREE__SERVER_HANDLER_HPP_
26 #include "nav2_msgs/srv/clear_entire_costmap.hpp"
27 #include "nav2_msgs/action/compute_path_to_pose.hpp"
28 #include "nav2_msgs/action/follow_path.hpp"
29 #include "nav2_msgs/action/spin.hpp"
30 #include "nav2_msgs/action/back_up.hpp"
31 #include "nav2_msgs/action/wait.hpp"
32 #include "nav2_msgs/action/drive_on_heading.hpp"
33 #include "nav2_msgs/action/compute_path_through_poses.hpp"
35 #include "geometry_msgs/msg/point_stamped.hpp"
37 #include "rclcpp/rclcpp.hpp"
39 #include "dummy_servers.hpp"
48 result_ = std::make_shared<nav2_msgs::action::ComputePathToPose::Result>();
49 geometry_msgs::msg::PoseStamped pose;
50 pose.header = result_->path.header;
51 pose.pose.position.x = 0.0;
52 pose.pose.position.y = 0.0;
53 pose.pose.position.z = 0.0;
54 pose.pose.orientation.x = 0.0;
55 pose.pose.orientation.y = 0.0;
56 pose.pose.orientation.z = 0.0;
57 pose.pose.orientation.w = 1.0;
58 for (
int i = 0; i < 6; ++i) {
59 result_->path.poses.push_back(pose);
63 std::shared_ptr<nav2_msgs::action::ComputePathToPose::Result> fillResult()
override
69 std::shared_ptr<nav2_msgs::action::ComputePathToPose::Result> result_;
90 std::unique_ptr<DummyService<nav2_msgs::srv::ClearEntireCostmap>> clear_local_costmap_server;
91 std::unique_ptr<DummyService<nav2_msgs::srv::ClearEntireCostmap>> clear_global_costmap_server;
92 std::unique_ptr<ComputePathToPoseActionServer> compute_path_to_pose_server;
93 std::unique_ptr<DummyActionServer<nav2_msgs::action::FollowPath>> follow_path_server;
94 std::unique_ptr<DummyActionServer<nav2_msgs::action::Spin>> spin_server;
95 std::unique_ptr<DummyActionServer<nav2_msgs::action::Wait>> wait_server;
96 std::unique_ptr<DummyActionServer<nav2_msgs::action::BackUp>> backup_server;
97 std::unique_ptr<DummyActionServer<nav2_msgs::action::DriveOnHeading>> drive_on_heading_server;
98 std::unique_ptr<DummyActionServer<nav2_msgs::action::ComputePathThroughPoses>> ntp_server;
104 rclcpp::Node::SharedPtr node_;
105 std::shared_ptr<std::thread> server_thread_;