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
A Node can store data to all valid neighbors (successors) and a precessor.
Definition Node.h:18
std::vector< Eigen::Vector2f > traversePredecessors() const
Collects all predecessors in order to generate path to starting point.
Definition Node.cpp:14
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Node(const Eigen::Vector2f &position, float obstacleDistance)
Definition Node.cpp:8
NodePtr predecessor
For traversal.
Definition Node.h:28
std::vector< NodePtr > successors
All nodes that are adjacent to this one.
Definition Node.h:26
std::shared_ptr< Node > NodePtr
Definition Node.h:11