Node.cpp
Go to the documentation of this file.
1
#include "
Node.h
"
2
3
#include <vector>
4
5
namespace
armarx::navigation::algorithm::astar
6
{
7
8
Node::Node
(
const
Eigen::Vector2f& position,
const
float
obstacleDistance) :
9
position(position), obstacleDistance(obstacleDistance)
10
{
11
}
12
13
std::vector<Eigen::Vector2f>
14
Node::traversePredecessors
()
const
15
{
16
std::vector<Eigen::Vector2f> result;
17
result.push_back(
position
);
18
19
NodePtr
predecessor
= this->
predecessor
;
20
while
(predecessor)
21
{
22
result.push_back(
predecessor
->position);
23
predecessor
=
predecessor
->predecessor;
24
}
25
return
result;
26
}
27
28
}
// 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::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
Node.h
armarx::navigation::algorithm::astar::Node::predecessor
NodePtr predecessor
For traversal.
Definition:
Node.h:28
armarx
navigation
algorithms
astar
Node.cpp
Generated by
1.8.17