EasyNav Plugins
Loading...
Searching...
No Matches
SimplePlanner.hpp
Go to the documentation of this file.
1// Copyright 2025 Intelligent Robotics Lab
2//
3// This file is part of the project Easy Navigation (EasyNav in short)
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
18
19#ifndef EASYNAV_PLANNER__SIMPLEPLANNER_HPP_
20#define EASYNAV_PLANNER__SIMPLEPLANNER_HPP_
21
22#include <vector>
23
24#include "nav_msgs/msg/path.hpp"
25
26#include "easynav_core/PlannerMethodBase.hpp"
28#include "easynav_common/types/NavState.hpp"
29
30namespace easynav
31{
32
35{
36public:
42 explicit SimplePlanner();
43
52 virtual void on_initialize() override;
53
62 void update(NavState & nav_state) override;
63
64protected:
67
68 nav_msgs::msg::Path current_path_;
69
71 rclcpp::Publisher<nav_msgs::msg::Path>::SharedPtr path_pub_;
72
82 std::vector<geometry_msgs::msg::Pose> a_star_path(
83 const SimpleMap & map,
84 const geometry_msgs::msg::Pose & start,
85 const geometry_msgs::msg::Pose & goal,
86 double resolution);
87
101 const SimpleMap & map,
102 int cx, int cy,
103 double clearance_cells);
104};
105
106} // namespace easynav
107
108#endif // EASYNAV_PLANNER__SIMPLEPLANNER_HPP_
Declaration of the SimpleMap type.
Simple 2D uint8_t grid using basic C++ types, with full metric conversion support.
Definition SimpleMap.hpp:38
void update(NavState &nav_state) override
Updates the planner by computing a new path.
Definition SimplePlanner.cpp:102
bool isFreeWithClearance(const SimpleMap &map, int cx, int cy, double clearance_cells)
Checks whether a map cell is free, considering a clearance area.
Definition SimplePlanner.cpp:183
double robot_radius_
Radius of the robot used for collision checking.
Definition SimplePlanner.hpp:65
std::vector< geometry_msgs::msg::Pose > a_star_path(const SimpleMap &map, const geometry_msgs::msg::Pose &start, const geometry_msgs::msg::Pose &goal, double resolution)
Runs the A* algorithm to compute a path.
Definition SimplePlanner.cpp:206
SimplePlanner()
Default constructor.
Definition SimplePlanner.cpp:72
nav_msgs::msg::Path current_path_
The last computed path.
Definition SimplePlanner.hpp:68
rclcpp::Publisher< nav_msgs::msg::Path >::SharedPtr path_pub_
Publisher for the computed navigation path.
Definition SimplePlanner.hpp:71
virtual void on_initialize() override
Initializes the planner.
Definition SimplePlanner.cpp:87
double clearance_distance_
Minimum clearance distance from obstacles in meters.
Definition SimplePlanner.hpp:66
Provides a mapping for often used cost values.
Definition cost_values.hpp:41