32
32
#include " nav2_smac_planner/node_hybrid.hpp"
33
33
#include " nav2_smac_planner/node_lattice.hpp"
34
34
#include " nav2_smac_planner/node_basic.hpp"
35
+ #include " nav2_smac_planner/goal_manager.hpp"
35
36
#include " nav2_smac_planner/types.hpp"
36
37
#include " nav2_smac_planner/constants.hpp"
37
38
@@ -54,6 +55,9 @@ class AStarAlgorithm
54
55
typedef typename NodeT::CoordinateVector CoordinateVector;
55
56
typedef typename NodeVector::iterator NeighborIterator;
56
57
typedef std::function<bool (const uint64_t &, NodeT * &)> NodeGetter;
58
+ typedef GoalManager<NodeT> GoalManagerT;
59
+ typedef std::vector<GoalState<NodeT>> GoalStateVector;
60
+
57
61
58
62
/* *
59
63
* @struct nav2_smac_planner::NodeComparator
@@ -90,6 +94,8 @@ class AStarAlgorithm
90
94
* or planning time exceeded
91
95
* @param max_planning_time Maximum time (in seconds) to wait for a plan, createPath returns
92
96
* false after this timeout
97
+ * @param lookup_table_size Size of the lookup table to store heuristic values
98
+ * @param dim_3_size Number of quantization bins
93
99
*/
94
100
void initialize (
95
101
const bool & allow_unknown,
@@ -125,11 +131,15 @@ class AStarAlgorithm
125
131
* @param mx The node X index of the goal
126
132
* @param my The node Y index of the goal
127
133
* @param dim_3 The node dim_3 index of the goal
134
+ * @param goal_heading_mode The goal heading mode to use
135
+ * @param coarse_search_resolution The resolution to search for goal heading
128
136
*/
129
137
void setGoal (
130
138
const float & mx,
131
139
const float & my,
132
- const unsigned int & dim_3);
140
+ const unsigned int & dim_3,
141
+ const GoalHeadingMode & goal_heading_mode = GoalHeadingMode::DEFAULT,
142
+ const int & coarse_search_resolution = 1 );
133
143
134
144
/* *
135
145
* @brief Set the starting pose for planning, as a node index
@@ -154,12 +164,6 @@ class AStarAlgorithm
154
164
*/
155
165
NodePtr & getStart ();
156
166
157
- /* *
158
- * @brief Get pointer reference to goal node
159
- * @return Node pointer reference to goal node
160
- */
161
- NodePtr & getGoal ();
162
-
163
167
/* *
164
168
* @brief Get maximum number of on-approach iterations after within threshold
165
169
* @return Reference to Maximum on-approach iterations parameter
@@ -190,6 +194,18 @@ class AStarAlgorithm
190
194
*/
191
195
unsigned int & getSizeDim3 ();
192
196
197
+ /* *
198
+ * @brief Get the resolution of the coarse search
199
+ * @return Size of the goals to expand
200
+ */
201
+ unsigned int getCoarseSearchResolution ();
202
+
203
+ /* *
204
+ * @brief Get the goals manager class
205
+ * @return Goal manager class
206
+ */
207
+ GoalManagerT getGoalManager ();
208
+
193
209
protected:
194
210
/* *
195
211
* @brief Get pointer to next goal in open set
@@ -210,13 +226,6 @@ class AStarAlgorithm
210
226
*/
211
227
inline NodePtr addToGraph (const uint64_t & index);
212
228
213
- /* *
214
- * @brief Check if this node is the goal node
215
- * @param node Node pointer to check if its the goal node
216
- * @return if node is goal
217
- */
218
- inline bool isGoal (NodePtr & node);
219
-
220
229
/* *
221
230
* @brief Get cost of heuristic of node
222
231
* @param node Node pointer to get heuristic for
@@ -240,6 +249,11 @@ class AStarAlgorithm
240
249
*/
241
250
inline void clearGraph ();
242
251
252
+ /* *
253
+ * @brief Check if node has been visited
254
+ * @param current_node Node to check if visited
255
+ * @return if node has been visited
256
+ */
243
257
inline bool onVisitationCheckNode (const NodePtr & node);
244
258
245
259
/* *
@@ -260,12 +274,11 @@ class AStarAlgorithm
260
274
unsigned int _x_size;
261
275
unsigned int _y_size;
262
276
unsigned int _dim3_size;
277
+ unsigned int _coarse_search_resolution;
263
278
SearchInfo _search_info;
264
279
265
- Coordinates _goal_coordinates;
266
280
NodePtr _start;
267
- NodePtr _goal;
268
-
281
+ GoalManagerT _goal_manager;
269
282
Graph _graph;
270
283
NodeQueue _queue;
271
284
0 commit comments