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

Classes | |
| struct | NodeContext |
Public Types | |
| typedef NodeLattice * | NodePtr |
| typedef std::unique_ptr< std::vector< NodeLattice > > | Graph |
| typedef std::vector< NodePtr > | NodeVector |
| typedef NodeHybrid::Coordinates | Coordinates |
| typedef NodeHybrid::CoordinateVector | CoordinateVector |
Public Member Functions | |
| NodeLattice (const uint64_t index, NodeContext *ctx) | |
| A constructor for nav2_smac_planner::NodeLattice. More... | |
| ~NodeLattice () | |
| A destructor for nav2_smac_planner::NodeLattice. | |
| bool | operator== (const NodeLattice &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. | |
| void | setMotionPrimitive (MotionPrimitive *prim) |
| Sets the motion primitive used to achieve node in search. More... | |
| MotionPrimitive *& | getMotionPrimitive () |
| Gets the motion primitive used to achieve node in search. More... | |
| float | getAccumulatedCost () |
| Gets the accumulated cost at this node. More... | |
| void | setAccumulatedCost (const float &cost_in) |
| Sets the accumulated cost at this node. 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... | |
| void | backwards (bool back=true) |
| Sets that this primitive is moving in reverse. | |
| bool | isBackward () |
| Gets if this primitive is moving in reverse. More... | |
| bool | isNodeValid (const bool &traverse_unknown, GridCollisionChecker *collision_checker, MotionPrimitive *primitive=nullptr, bool is_backwards=false) |
| 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::NodeLattice *&)> &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... | |
| void | addNodeToPath (NodePtr current_node, CoordinateVector &path) |
| add node to the path 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 | |
| NodeLattice * | parent |
| Coordinates | pose |
NodeLattice implementation for graph, Hybrid-A*.
Definition at line 124 of file node_lattice.hpp.
|
explicit |
A constructor for nav2_smac_planner::NodeLattice.
| index | The index of this node for self-reference |
Definition at line 189 of file node_lattice.cpp.
| void nav2_smac_planner::NodeLattice::addNodeToPath | ( | NodeLattice::NodePtr | current_node, |
| NodeLattice::CoordinateVector & | path | ||
| ) |
add node to the path
| current_node |
Definition at line 488 of file node_lattice.cpp.
References nav2_smac_planner::LatticeMotionTable::getAngleFromBin(), getMotionPrimitive(), and isBackward().
Referenced by backtracePath().


| bool nav2_smac_planner::NodeLattice::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 469 of file node_lattice.cpp.
References addNodeToPath().

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

| float nav2_smac_planner::NodeLattice::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 358 of file node_lattice.cpp.
|
inline |
Gets cell index.
Definition at line 250 of file node_lattice.hpp.
Referenced by nav2_simple_commander.costmap_2d.PyCostmap2D::getCostXY(), nav2_simple_commander.occupancy_grid.PyOccupancyGrid::getCostXY(), 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 304 of file node_lattice.hpp.
References nav2_smac_planner::NodeHybrid::getIndex().
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 used to achieve node in search.
Definition at line 197 of file node_lattice.hpp.
Referenced by addNodeToPath(), and getTraversalCost().

| void nav2_smac_planner::NodeLattice::getNeighbors | ( | std::function< bool(const uint64_t &, nav2_smac_planner::NodeLattice *&)> & | 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 395 of file node_lattice.cpp.
References backwards(), getIndex(), nav2_smac_planner::LatticeMotionTable::getMotionPrimitives(), isNodeValid(), setMotionPrimitive(), setPose(), and wasVisited().

| float nav2_smac_planner::NodeLattice::getTraversalCost | ( | const NodePtr & | child | ) |
Get traversal cost of parent node to child node.
| child | Node pointer to child |
Definition at line 299 of file node_lattice.cpp.
References getCost(), getMotionPrimitive(), and isBackward().

|
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 378 of file node_lattice.cpp.
|
inline |
Gets if this primitive is moving in reverse.
Definition at line 267 of file node_lattice.hpp.
Referenced by addNodeToPath(), and getTraversalCost().

| bool nav2_smac_planner::NodeLattice::isNodeValid | ( | const bool & | traverse_unknown, |
| GridCollisionChecker * | collision_checker, | ||
| MotionPrimitive * | primitive = nullptr, |
||
| bool | is_backwards = false |
||
| ) |
Check if this node is valid.
| traverse_unknown | If we can explore unknown nodes on the graph |
| collision_checker | Collision checker object to aid in validity checking |
| primitive | Optional argument if needing to check over a primitive not only a terminal pose |
| is_backwards | Optional argument if needed to check if prim expansion is in reverse |
Definition at line 222 of file node_lattice.cpp.
References nav2_smac_planner::LatticeMotionTable::getAngleFromBin(), nav2_smac_planner::GridCollisionChecker::getCost(), nav2_smac_planner::GridCollisionChecker::getPrecomputedAngles(), and nav2_smac_planner::GridCollisionChecker::inCollision().
Referenced by getNeighbors().


|
inline |
operator== for comparisons
| NodeLattice | right hand side node reference |
Definition at line 165 of file node_lattice.hpp.
|
inline |
Sets the accumulated cost at this node.
| reference | to accumulated cost |
Definition at line 215 of file node_lattice.hpp.
|
inline |
Sets the motion primitive used to achieve node in search.
| pointer | to motion primitive |
Definition at line 188 of file node_lattice.hpp.
Referenced by getNeighbors().

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

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