Nav2 Navigation Stack - kilted  kilted
ROS 2 Navigation Stack
global_planner.hpp
1 // Copyright (c) 2019 Samsung Research America
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef NAV2_CORE__GLOBAL_PLANNER_HPP_
16 #define NAV2_CORE__GLOBAL_PLANNER_HPP_
17 
18 #include <memory>
19 #include <string>
20 #include "rclcpp/rclcpp.hpp"
21 #include "nav2_costmap_2d/costmap_2d_ros.hpp"
22 #include "tf2_ros/buffer.h"
23 #include "nav_msgs/msg/path.hpp"
24 #include "geometry_msgs/msg/pose_stamped.hpp"
25 #include "nav2_util/lifecycle_node.hpp"
26 
27 namespace nav2_core
28 {
29 
35 {
36 public:
37  using Ptr = std::shared_ptr<GlobalPlanner>;
38 
42  virtual ~GlobalPlanner() {}
43 
50  virtual void configure(
51  const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent,
52  std::string name, std::shared_ptr<tf2_ros::Buffer> tf,
53  std::shared_ptr<nav2_costmap_2d::Costmap2DROS> costmap_ros) = 0;
54 
58  virtual void cleanup() = 0;
59 
63  virtual void activate() = 0;
64 
68  virtual void deactivate() = 0;
69 
77  virtual nav_msgs::msg::Path createPlan(
78  const geometry_msgs::msg::PoseStamped & start,
79  const geometry_msgs::msg::PoseStamped & goal,
80  std::function<bool()> cancel_checker) = 0;
81 };
82 
83 } // namespace nav2_core
84 
85 #endif // NAV2_CORE__GLOBAL_PLANNER_HPP_
Abstract interface for global planners to adhere to with pluginlib.
virtual void activate()=0
Method to active planner and any threads involved in execution.
virtual void cleanup()=0
Method to cleanup resources used on shutdown.
virtual void deactivate()=0
Method to deactivate planner and any threads involved in execution.
virtual nav_msgs::msg::Path createPlan(const geometry_msgs::msg::PoseStamped &start, const geometry_msgs::msg::PoseStamped &goal, std::function< bool()> cancel_checker)=0
Method create the plan from a starting and ending goal.
virtual void configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr &parent, std::string name, std::shared_ptr< tf2_ros::Buffer > tf, std::shared_ptr< nav2_costmap_2d::Costmap2DROS > costmap_ros)=0
virtual ~GlobalPlanner()
Virtual destructor.