Node.cpp
Go to the documentation of this file.
1#include "Node.h"
2
3#include <experimental/memory>
4#include <vector>
6
8{
9
14
15 void
16 Node::initialize(const Eigen::Vector2f& position, const float obstacleDistance, float orientation_deg)
17 {
18 this->position = position;
19 this->obstacleDistance = obstacleDistance;
20 this->orientation_deg = orientation_deg;
21 }
22
23 std::vector<const Node*>
25 {
26 std::vector<const Node*> result;
27 result.push_back(this);
28
30 while (predecessor)
31 {
32 result.push_back(predecessor.get());
33 predecessor = predecessor->predecessor;
34 }
35 return result;
36 }
37
38} // namespace armarx::navigation::algorithms::orientation_aware
std::vector< const Node * > traversePredecessors() const
Collects all predecessors in order to generate path to starting point.
Definition Node.cpp:24
void initialize(const Eigen::Vector2f &position, float obstacleDistance, float orientation_deg)
Definition Node.cpp:16
std::experimental::observer_ptr< Node > predecessor
For traversal.
Definition Node.h:72