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 unsigned int | getIndex (const unsigned int &x, const unsigned int &y, const unsigned int &width) |
| Get index. More...
|
|
static Coordinates | getCoords (const unsigned int &index, const unsigned int &width, const unsigned int &angles) |
| Get index. More...
|
|
static Coordinates | getCoords (const unsigned int &index) |
| Get index. More...
|
|
static float | getHeuristicCost (const Coordinates &node_coords, const Coordinates &goal_coordinates, const nav2_costmap_2d::Costmap2D *costmap) |
| 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 39 of file node_2d.hpp.
◆ Node2D()
nav2_smac_planner::Node2D::Node2D |
( |
const unsigned int |
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 indicies of generated path |
- Returns
- whether the path was able to be backtraced
Definition at line 151 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 90 of file node_2d.hpp.
◆ getCoords() [1/2]
static Coordinates nav2_smac_planner::Node2D::getCoords |
( |
const unsigned int & |
index | ) |
|
|
inlinestatic |
Get index.
- Parameters
-
- Returns
- coordinates of point
Definition at line 216 of file node_2d.hpp.
◆ getCoords() [2/2]
static Coordinates nav2_smac_planner::Node2D::getCoords |
( |
const unsigned int & |
index, |
|
|
const unsigned int & |
width, |
|
|
const unsigned int & |
angles |
|
) |
| |
|
inlinestatic |
◆ getCost()
float& nav2_smac_planner::Node2D::getCost |
( |
| ) |
|
|
inline |
◆ getHeuristicCost()
Get cost of heuristic of node.
- Parameters
-
node | Node index current |
node | Node index of new |
costmap | Costmap ptr to use |
- Returns
- Heuristic cost between the nodes
Definition at line 82 of file node_2d.cpp.
◆ getIndex() [1/2]
unsigned int& nav2_smac_planner::Node2D::getIndex |
( |
| ) |
|
|
inline |
◆ getIndex() [2/2]
static unsigned int 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 unsigned int &, 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 111 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 94 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 144 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 indicies are equal
Definition at line 77 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 99 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 117 of file node_2d.hpp.
◆ wasVisited()
bool& nav2_smac_planner::Node2D::wasVisited |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: