Node2D implementation for graph.
More...
#include <nav2_smac_planner/include/nav2_smac_planner/node_2d.hpp>
|
|
typedef Node2D * | NodePtr |
| |
|
typedef std::unique_ptr< std::vector< Node2D > > | Graph |
| |
|
typedef std::vector< NodePtr > | NodeVector |
| |
|
typedef std::vector< Coordinates > | CoordinateVector |
| |
|
| static uint64_t | getIndex (const unsigned int &x, const unsigned int &y, const unsigned int &width) |
| | Get index. More...
|
| |
| static Coordinates | getCoords (const uint64_t &index, const unsigned int &width, const unsigned int &angles) |
| | Get index. More...
|
| |
| static Coordinates | getCoords (const uint64_t &index) |
| | Get index. More...
|
| |
| static float | getHeuristicCost (const Coordinates &node_coords, const CoordinateVector &goals_coords) |
| | Get cost of heuristic of node. More...
|
| |
| static void | initMotionModel (const MotionModel &motion_model, unsigned int &size_x, unsigned int &size_y, unsigned int &num_angle_quantization, SearchInfo &search_info) |
| | Initialize the neighborhood to be used in A* We support 4-connect (VON_NEUMANN) and 8-connect (MOORE) More...
|
| |
|
|
static float | cost_travel_multiplier = 2.0 |
| |
|
static std::vector< int > | _neighbors_grid_offsets |
| |
Node2D implementation for graph.
Definition at line 35 of file node_2d.hpp.
◆ Node2D()
| nav2_smac_planner::Node2D::Node2D |
( |
const uint64_t |
index | ) |
|
|
explicit |
◆ backtracePath()
| bool nav2_smac_planner::Node2D::backtracePath |
( |
CoordinateVector & |
path | ) |
|
Set the starting pose for planning, as a node index.
- Parameters
-
| path | Reference to a vector of indices of generated path |
- Returns
- whether the path was able to be backtraced
Definition at line 155 of file node_2d.cpp.
References getCoords(), and getIndex().
◆ getAccumulatedCost()
| float nav2_smac_planner::Node2D::getAccumulatedCost |
( |
| ) |
|
|
inline |
Gets the accumulated cost at this node.
- Returns
- accumulated cost
Definition at line 105 of file node_2d.hpp.
◆ getCoords() [1/2]
| static Coordinates nav2_smac_planner::Node2D::getCoords |
( |
const uint64_t & |
index | ) |
|
|
inlinestatic |
Get index.
- Parameters
-
- Returns
- coordinates of point
Definition at line 232 of file node_2d.hpp.
◆ getCoords() [2/2]
| static Coordinates nav2_smac_planner::Node2D::getCoords |
( |
const uint64_t & |
index, |
|
|
const unsigned int & |
width, |
|
|
const unsigned int & |
angles |
|
) |
| |
|
inlinestatic |
◆ getCost()
| float nav2_smac_planner::Node2D::getCost |
( |
| ) |
|
|
inline |
◆ getHeuristicCost()
| float nav2_smac_planner::Node2D::getHeuristicCost |
( |
const Coordinates & |
node_coords, |
|
|
const CoordinateVector & |
goals_coords |
|
) |
| |
|
static |
Get cost of heuristic of node.
- Parameters
-
| node | Node index current |
| node | Node index of new |
- Returns
- Heuristic cost between the nodes
Definition at line 86 of file node_2d.cpp.
◆ getIndex() [1/2]
| uint64_t nav2_smac_planner::Node2D::getIndex |
( |
| ) |
|
|
inline |
◆ getIndex() [2/2]
| static uint64_t nav2_smac_planner::Node2D::getIndex |
( |
const unsigned int & |
x, |
|
|
const unsigned int & |
y, |
|
|
const unsigned int & |
width |
|
) |
| |
|
inlinestatic |
◆ getNeighbors()
| void nav2_smac_planner::Node2D::getNeighbors |
( |
std::function< bool(const uint64_t &, nav2_smac_planner::Node2D *&)> & |
validity_checker, |
|
|
GridCollisionChecker * |
collision_checker, |
|
|
const bool & |
traverse_unknown, |
|
|
NodeVector & |
neighbors |
|
) |
| |
Retrieve all valid neighbors of a node.
- Parameters
-
| 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 114 of file node_2d.cpp.
References getCoords(), getIndex(), isNodeValid(), and wasVisited().
◆ getTraversalCost()
| float nav2_smac_planner::Node2D::getTraversalCost |
( |
const NodePtr & |
child | ) |
|
◆ initMotionModel()
| void nav2_smac_planner::Node2D::initMotionModel |
( |
const MotionModel & |
motion_model, |
|
|
unsigned int & |
size_x, |
|
|
unsigned int & |
size_y, |
|
|
unsigned int & |
num_angle_quantization, |
|
|
SearchInfo & |
search_info |
|
) |
| |
|
static |
Initialize the neighborhood to be used in A* We support 4-connect (VON_NEUMANN) and 8-connect (MOORE)
- Parameters
-
| neighborhood | The desired neighborhood type |
| x_size_uint | The total x size to find neighbors |
| y_size | The total y size to find neighbors |
| num_angle_quantization | Number of quantizations, must be 0 |
| search_info | Search parameters, unused by 2D node |
Definition at line 97 of file node_2d.cpp.
◆ isNodeValid()
| bool nav2_smac_planner::Node2D::isNodeValid |
( |
const bool & |
traverse_unknown, |
|
|
GridCollisionChecker * |
collision_checker |
|
) |
| |
◆ isQueued()
| bool& nav2_smac_planner::Node2D::isQueued |
( |
| ) |
|
|
inline |
Gets if cell is currently queued in search.
- Parameters
-
Definition at line 159 of file node_2d.hpp.
◆ operator==()
| bool nav2_smac_planner::Node2D::operator== |
( |
const Node2D & |
rhs | ) |
|
|
inline |
operator== for comparisons
- Parameters
-
| Node2D | right hand side node reference |
- Returns
- If cell indices are equal
Definition at line 83 of file node_2d.hpp.
◆ setAccumulatedCost()
| void nav2_smac_planner::Node2D::setAccumulatedCost |
( |
const float & |
cost_in | ) |
|
|
inline |
Sets the accumulated cost at this node.
- Parameters
-
| reference | to accumulated cost |
Definition at line 114 of file node_2d.hpp.
◆ setCost()
| void nav2_smac_planner::Node2D::setCost |
( |
const float & |
cost | ) |
|
|
inline |
Gets the costmap cost at this node.
- Returns
- costmap cost
Definition at line 132 of file node_2d.hpp.
◆ setPose()
| void nav2_smac_planner::Node2D::setPose |
( |
const Coordinates & |
pose_in | ) |
|
|
inline |
setting continuous coordinate search poses (in partial-cells)
- Parameters
-
Definition at line 92 of file node_2d.hpp.
◆ wasVisited()
| bool nav2_smac_planner::Node2D::wasVisited |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: