|
Nav2 Navigation Stack - lyrical
lyrical
ROS 2 Navigation Stack
|
NodeHybrid implementation for graph, Hybrid-A*. More...
#include <nav2_smac_planner/include/nav2_smac_planner/node_hybrid.hpp>

Classes | |
| struct | NodeContext |
Public Types | |
| typedef NodeHybrid * | NodePtr |
| typedef std::unique_ptr< std::vector< NodeHybrid > > | Graph |
| typedef std::vector< NodePtr > | NodeVector |
| using | Coordinates = nav2_smac_planner::Coordinates |
| typedef std::vector< Coordinates > | CoordinateVector |
Public Member Functions | |
| NodeHybrid (const uint64_t index, NodeContext *ctx) | |
| A constructor for nav2_smac_planner::NodeHybrid. More... | |
| ~NodeHybrid () | |
| A destructor for nav2_smac_planner::NodeHybrid. | |
| bool | operator== (const NodeHybrid &rhs) const |
| operator== for comparisons More... | |
| void | setPose (const Coordinates &pose_in) |
| setting continuous coordinate search poses (in partial-cells) More... | |
| void | reset () |
| Reset method for new search. | |
| float | getAccumulatedCost () |
| Gets the accumulated cost at this node. More... | |
| void | setAccumulatedCost (const float &cost_in) |
| Sets the accumulated cost at this node. More... | |
| void | setMotionPrimitiveIndex (const unsigned int &idx, const TurnDirection &turn_dir) |
| Sets the motion primitive index used to achieve node in search. More... | |
| unsigned int & | getMotionPrimitiveIndex () |
| Gets the motion primitive index used to achieve node in search. More... | |
| TurnDirection & | getTurnDirection () |
| Gets the motion primitive turning direction used to achieve node in search. More... | |
| float | getCost () |
| Gets the costmap cost at this node. More... | |
| bool | wasVisited () |
| Gets if cell has been visited in search. More... | |
| void | visited () |
| Sets if cell has been visited in search. | |
| uint64_t | getIndex () |
| Gets cell index. More... | |
| bool | isNodeValid (const bool &traverse_unknown, GridCollisionChecker *collision_checker) |
| Check if this node is valid. More... | |
| float | getTraversalCost (const NodePtr &child) |
| Get traversal cost of parent node to child node. More... | |
| float | getHeuristicCost (const Coordinates &node_coords, const CoordinateVector &goals_coords) |
| Get cost of heuristic of node. More... | |
| void | getNeighbors (std::function< bool(const uint64_t &, nav2_smac_planner::NodeHybrid *&)> &validity_checker, GridCollisionChecker *collision_checker, const bool &traverse_unknown, NodeVector &neighbors) |
| Retrieve all valid neighbors of a node. More... | |
| bool | backtracePath (CoordinateVector &path) |
| Set the starting pose for planning, as a node index. More... | |
Static Public Member Functions | |
| static uint64_t | getIndex (const unsigned int &x, const unsigned int &y, const unsigned int &angle, const unsigned int &width, const unsigned int &angle_quantization) |
| Get index at coordinates. More... | |
| static Coordinates | getCoords (const uint64_t &index, const unsigned int &width, const unsigned int &angle_quantization) |
| Get coordinates at index. More... | |
| static void | initMotionModel (NodeContext *ctx, const MotionModel &motion_model, unsigned int &size_x, unsigned int &size_y, unsigned int &angle_quantization, SearchInfo &search_info) |
| Initialize motion models. More... | |
Public Attributes | |
| NodeHybrid * | parent |
| Coordinates | pose |
NodeHybrid implementation for graph, Hybrid-A*.
Definition at line 131 of file node_hybrid.hpp.
|
explicit |
A constructor for nav2_smac_planner::NodeHybrid.
| index | The index of this node for self-reference |
Definition at line 340 of file node_hybrid.cpp.
| bool nav2_smac_planner::NodeHybrid::backtracePath | ( | CoordinateVector & | path | ) |
Set the starting pose for planning, as a node index.
| path | Reference to a vector of indices of generated path |
Definition at line 517 of file node_hybrid.cpp.
References nav2_smac_planner::HybridMotionTable::getAngleFromBin().

|
inline |
Gets the accumulated cost at this node.
Definition at line 193 of file node_hybrid.hpp.
|
inlinestatic |
Get coordinates at index.
| index | Index of point |
| width | Width of costmap |
| angle_quantization | Theta size of costmap |
Definition at line 313 of file node_hybrid.hpp.
|
inline |
Gets the costmap cost at this node.
Definition at line 239 of file node_hybrid.hpp.
Referenced by getTraversalCost().

| float nav2_smac_planner::NodeHybrid::getHeuristicCost | ( | const Coordinates & | node_coords, |
| const CoordinateVector & | goals_coords | ||
| ) |
Get cost of heuristic of node.
| node | Node index current |
| node | Node index of new |
Definition at line 436 of file node_hybrid.cpp.
|
inline |
Gets cell index.
Definition at line 265 of file node_hybrid.hpp.
Referenced by nav2_simple_commander.costmap_2d.PyCostmap2D::getCostXY(), nav2_simple_commander.occupancy_grid.PyOccupancyGrid::getCostXY(), nav2_smac_planner::NodeLattice::getIndex(), getNeighbors(), nav2_simple_commander.occupancy_grid.PyOccupancyGrid::setCost(), and nav2_simple_commander.costmap_2d.PyCostmap2D::setCost().

|
inlinestatic |
Get index at coordinates.
| x | X coordinate of point |
| y | Y coordinate of point |
| angle | Theta coordinate of point |
| width | Width of costmap |
| angle_quantization | Number of theta bins |
Definition at line 296 of file node_hybrid.hpp.
Referenced by nav2_simple_commander.costmap_2d.PyCostmap2D::getCostXY(), nav2_simple_commander.occupancy_grid.PyOccupancyGrid::getCostXY(), nav2_simple_commander.occupancy_grid.PyOccupancyGrid::setCost(), and nav2_simple_commander.costmap_2d.PyCostmap2D::setCost().

|
inline |
Gets the motion primitive index used to achieve node in search.
Definition at line 221 of file node_hybrid.hpp.
Referenced by getTraversalCost().

| void nav2_smac_planner::NodeHybrid::getNeighbors | ( | std::function< bool(const uint64_t &, nav2_smac_planner::NodeHybrid *&)> & | validity_checker, |
| GridCollisionChecker * | collision_checker, | ||
| const bool & | traverse_unknown, | ||
| NodeVector & | neighbors | ||
| ) |
Retrieve all valid neighbors of a node.
| validity_checker | Functor for state validity checking |
| collision_checker | Collision checker to use |
| traverse_unknown | If unknown costs are valid to traverse |
| neighbors | Vector of neighbors to be filled |
Definition at line 479 of file node_hybrid.cpp.
References getIndex(), nav2_smac_planner::HybridMotionTable::getProjections(), isNodeValid(), setMotionPrimitiveIndex(), setPose(), and wasVisited().

| float nav2_smac_planner::NodeHybrid::getTraversalCost | ( | const NodePtr & | child | ) |
Get traversal cost of parent node to child node.
| child | Node pointer to child |
Definition at line 386 of file node_hybrid.cpp.
References getCost(), getMotionPrimitiveIndex(), and getTurnDirection().

|
inline |
Gets the motion primitive turning direction used to achieve node in search.
Definition at line 230 of file node_hybrid.hpp.
Referenced by getTraversalCost().

|
static |
Initialize motion models.
| motion_model | Motion model enum to use |
| size_x | Size of X of graph |
| size_y | Size of y of graph |
| angle_quantization | Size of theta bins of graph |
| search_info | Search info to use |
Definition at line 455 of file node_hybrid.cpp.
| bool nav2_smac_planner::NodeHybrid::isNodeValid | ( | const bool & | traverse_unknown, |
| GridCollisionChecker * | collision_checker | ||
| ) |
Check if this node is valid.
| traverse_unknown | If we can explore unknown nodes on the graph |
| collision_checker | Collision checker object |
Definition at line 371 of file node_hybrid.cpp.
References nav2_smac_planner::GridCollisionChecker::getCost(), and nav2_smac_planner::GridCollisionChecker::inCollision().
Referenced by getNeighbors().


|
inline |
operator== for comparisons
| NodeHybrid | right hand side node reference |
Definition at line 170 of file node_hybrid.hpp.
|
inline |
Sets the accumulated cost at this node.
| reference | to accumulated cost |
Definition at line 202 of file node_hybrid.hpp.
|
inline |
Sets the motion primitive index used to achieve node in search.
| reference | to motion primitive idx |
Definition at line 211 of file node_hybrid.hpp.
Referenced by getNeighbors().

|
inline |
setting continuous coordinate search poses (in partial-cells)
| Pose | pose |
Definition at line 179 of file node_hybrid.hpp.
Referenced by getNeighbors().

|
inline |
Gets if cell has been visited in search.
| If | cell was visited |
Definition at line 248 of file node_hybrid.hpp.
Referenced by getNeighbors().
