SMACC2
forward_global_planner.hpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
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/*****************************************************************************************************************
16 *
17 * Authors: Pablo Inigo Blasco, Brett Aldrich
18 *
19 ******************************************************************************************************************/
20#pragma once
21
22#include <memory>
23#include <string>
24
25#include <nav2_core/global_planner.hpp>
26#include <nav_msgs/msg/path.hpp>
27#include <rclcpp/rclcpp.hpp>
28
29namespace cl_nav2z
30{
31namespace forward_global_planner
32{
33class ForwardGlobalPlanner : public nav2_core::GlobalPlanner
34{
35public:
36 using Ptr = std::shared_ptr<ForwardGlobalPlanner>;
37
39
43 virtual ~ForwardGlobalPlanner();
44
51 void configure(
52 const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std::string name,
53 const std::shared_ptr<tf2_ros::Buffer> tf,
54 const std::shared_ptr<nav2_costmap_2d::Costmap2DROS> costmap_ros) override;
55
59 virtual void cleanup();
60
64 virtual void activate();
65
69 virtual void deactivate();
70
77 virtual nav_msgs::msg::Path createPlan(
78 const geometry_msgs::msg::PoseStamped & start, const geometry_msgs::msg::PoseStamped & goal);
79
80private:
81 // rclcpp::Node::SharedPtr nh_;
82 rclcpp_lifecycle::LifecycleNode::SharedPtr nh_;
83
84 std::shared_ptr<rclcpp_lifecycle::LifecyclePublisher<nav_msgs::msg::Path>> planPub_;
85
87 std::shared_ptr<nav2_costmap_2d::Costmap2DROS> costmap_ros_;
88
90
91 double puresSpinningRadStep_; // rads
92
93 std::string name_;
94
96
97 std::shared_ptr<tf2_ros::Buffer> tf_;
98};
99} // namespace forward_global_planner
100} // namespace cl_nav2z
virtual void deactivate()
Method to deactivate planner and any threads involved in execution.
void configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr &parent, std::string name, const std::shared_ptr< tf2_ros::Buffer > tf, const std::shared_ptr< nav2_costmap_2d::Costmap2DROS > costmap_ros) override
std::shared_ptr< rclcpp_lifecycle::LifecyclePublisher< nav_msgs::msg::Path > > planPub_
virtual void cleanup()
Method to cleanup resources used on shutdown.
virtual nav_msgs::msg::Path createPlan(const geometry_msgs::msg::PoseStamped &start, const geometry_msgs::msg::PoseStamped &goal)
Method create the plan from a starting and ending goal.
std::shared_ptr< nav2_costmap_2d::Costmap2DROS > costmap_ros_
stored but almost not used
virtual void activate()
Method to active planner and any threads involved in execution.