Node.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
6 #include <Eigen/Geometry>
7 
9 {
10  class Node;
11  using NodePtr = std::shared_ptr<Node>;
12 
13  /**
14  * A Node can store data to all valid neighbors (successors) and a precessor.
15  * It offers methods to determine the complete path to the starting point.
16  */
17  class Node
18  {
19  public:
20  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
21 
22  Node(const Eigen::Vector2f& position, float obstacleDistance);
23 
24  Eigen::Vector2f position;
25  /// All nodes that are adjacent to this one.
26  std::vector<NodePtr> successors;
27  /// For traversal.
29 
31 
32  /// Collects all predecessors in order to generate path to starting point.
33  std::vector<Eigen::Vector2f> traversePredecessors() const;
34  };
35 
36 } // 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:8
armarx::navigation::algorithm::astar::Node
A Node can store data to all valid neighbors (successors) and a precessor.
Definition: Node.h:17
armarx::navigation::algorithm::astar::Node::successors
std::vector< NodePtr > successors
All nodes that are adjacent to this one.
Definition: Node.h:26
armarx::navigation::algorithm::astar::Node::obstacleDistance
float obstacleDistance
Definition: Node.h:30
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:14
armarx::navigation::algorithm::astar::Node::position
Eigen::Vector2f position
Definition: Node.h:24
armarx::navigation::algorithm::astar::NodePtr
std::shared_ptr< Node > NodePtr
Definition: Node.h:11
armarx::navigation::algorithm::astar
Definition: AStarPlanner.cpp:32
armarx::navigation::algorithm::astar::Node::predecessor
NodePtr predecessor
For traversal.
Definition: Node.h:28