15 #ifndef NAV2_SMAC_PLANNER__ANALYTIC_EXPANSION_HPP_
16 #define NAV2_SMAC_PLANNER__ANALYTIC_EXPANSION_HPP_
18 #include <ompl/base/ScopedState.h>
19 #include <ompl/base/spaces/DubinsStateSpace.h>
20 #include <ompl/base/spaces/ReedsSheppStateSpace.h>
28 #include "nav2_smac_planner/node_2d.hpp"
29 #include "nav2_smac_planner/node_hybrid.hpp"
30 #include "nav2_smac_planner/node_lattice.hpp"
31 #include "nav2_smac_planner/types.hpp"
32 #include "nav2_smac_planner/constants.hpp"
34 namespace nav2_smac_planner
37 template<
typename NodeT>
41 typedef NodeT * NodePtr;
42 typedef std::vector<NodePtr> NodeVector;
43 typedef typename NodeT::Coordinates Coordinates;
44 typedef std::function<bool (
const uint64_t &, NodeT * &)> NodeGetter;
45 typedef typename NodeT::CoordinateVector CoordinateVector;
55 Coordinates & initial_coords_in,
56 Coordinates & proposed_coords_in)
58 initial_coords(initial_coords_in),
59 proposed_coords(proposed_coords_in)
64 Coordinates initial_coords;
65 Coordinates proposed_coords;
81 Coordinates & initial_coords,
82 Coordinates & proposed_coords)
84 nodes.emplace_back(node, initial_coords, proposed_coords);
87 void setDirectionChanges(
int changes)
89 direction_changes = changes;
92 std::vector<AnalyticExpansionNode> nodes;
93 int direction_changes{0};
100 const MotionModel & motion_model,
102 const bool & traverse_unknown,
103 const unsigned int & dim_3_size);
124 const NodePtr & current_node,
125 const NodeVector & coarse_check_goals,
126 const NodeVector & fine_check_goals,
127 const CoordinateVector & goals_coords,
128 const NodeGetter & getter,
int & iterations,
129 int & closest_distance);
140 const NodePtr & node,
const NodePtr & goal,
141 const NodeGetter & getter,
const ompl::base::StateSpacePtr & state_space);
154 const NodePtr & goal_node,
155 const NodeGetter & getter,
166 const NodePtr & node,
const NodePtr & goal,
184 MotionModel _motion_model;
186 bool _traverse_unknown;
187 unsigned int _dim_3_size;
189 std::list<std::unique_ptr<NodeT>> _detached_nodes;
AnalyticExpansionNodes getAnalyticPath(const NodePtr &node, const NodePtr &goal, const NodeGetter &getter, const ompl::base::StateSpacePtr &state_space)
Perform an analytic path expansion to the goal.
NodePtr tryAnalyticExpansion(const NodePtr ¤t_node, const NodeVector &coarse_check_goals, const NodeVector &fine_check_goals, const CoordinateVector &goals_coords, const NodeGetter &getter, int &iterations, int &closest_distance)
Attempt an analytic path completion.
int countDirectionChanges(const ompl::base::ReedsSheppStateSpace::ReedsSheppPath &path)
Counts the number of direction changes in a Reeds-Shepp path.
void cleanNode(const NodePtr &nodes)
Takes an expanded nodes to clean up, if necessary, of any state information that may be polluting it ...
void setCollisionChecker(GridCollisionChecker *collision_checker)
Sets the collision checker and costmap to use in expansion validation.
AnalyticExpansion(const MotionModel &motion_model, const SearchInfo &search_info, const bool &traverse_unknown, const unsigned int &dim_3_size)
Constructor for analytic expansion object.
float refineAnalyticPath(NodePtr &node, const NodePtr &goal_node, const NodeGetter &getter, AnalyticExpansionNodes &analytic_nodes)
Refined analytic path from the current node to the goal.
NodePtr setAnalyticPath(const NodePtr &node, const NodePtr &goal, const AnalyticExpansionNodes &expanded_nodes)
Takes final analytic expansion and appends to current expanded node.
A costmap grid collision checker.
Analytic expansion nodes and associated metadata.
Search properties and penalties.