Node.cpp
Go to the documentation of this file.
1 #include "Node.h"
2 
4 {
5 
6  Node::Node(const Eigen::Vector2f& position, const float obstacleDistance) :
7  position(position), obstacleDistance(obstacleDistance)
8  {
9  }
10 
11  std::vector<Eigen::Vector2f>
13  {
14  std::vector<Eigen::Vector2f> result;
15  result.push_back(position);
16 
18  while (predecessor)
19  {
20  result.push_back(predecessor->position);
21  predecessor = predecessor->predecessor;
22  }
23  return result;
24  }
25 
26 } // namespace armarx::navigation::algorithm::astar
armarx::navigation::algorithm::astar::Node::Node
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Node(const Eigen::Vector2f &position, float obstacleDistance)
Definition: Node.cpp:6
armarx::navigation::algorithm::astar::Node::traversePredecessors
std::vector< Eigen::Vector2f > traversePredecessors() const
Collects all predecessors in order to generate path to starting point.
Definition: Node.cpp:12
armarx::navigation::algorithm::astar::Node::position
Eigen::Vector2f position
Definition: Node.h:26
armarx::navigation::algorithm::astar::NodePtr
std::shared_ptr< Node > NodePtr
Definition: Node.h:13
armarx::navigation::algorithm::astar
Definition: AStarPlanner.cpp:29
Node.h
armarx::navigation::algorithm::astar::Node::predecessor
NodePtr predecessor
For traversal.
Definition: Node.h:30