Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
Nodes.hpp
Go to the documentation of this file.
1
14#ifndef NODES_HPP
15#define NODES_HPP
16
17#include "../GeospatialOperations.hpp"
18
20// Put implicit includes in here.
21
23
24
33namespace pathplanners
34{
35
44 namespace nodes
45 {
46
47
56 struct AStarNode
57 {
58 public:
59 // Declare struct public member variables.
60 std::shared_ptr<AStarNode> pParentNode; // A shared pointer to the parent node the this nodes comes after in the path.
61 geoops::UTMCoordinate stNodeLocation; // The global position of this point/node stored in UTM format.
62 double dKg; // The cost of the path from the star node to the current node.
63 double dKh; // The heuristic estimate of how much it will cost to get to the end node.
64 double dKf; // The sum of dKg and dKh. An estimate for the total cost of the node.
65
66
78 AStarNode(std::shared_ptr<AStarNode> pParentNode = nullptr,
79 const geoops::UTMCoordinate stNodeLocation = geoops::UTMCoordinate(),
80 const double dKg = 0.0,
81 const double dKh = 0.0,
82 const double dKf = 0.0)
83 {
84 // Initialize struct member variables.
85 this->pParentNode = pParentNode;
86 this->stNodeLocation = stNodeLocation;
87 this->dKg = dKg;
88 this->dKh = dKh;
89 this->dKf = dKf;
90 }
91
92
101 bool operator<(const AStarNode& other) const { return this->dKf < other.dKf; }
102
103
112 bool operator<=(const AStarNode& other) const { return this->dKf <= other.dKf; }
113
114
123 bool operator>(const AStarNode& other) const { return this->dKf > other.dKf; }
124
125
134 bool operator>=(const AStarNode& other) const { return this->dKf >= other.dKf; }
135
136
145 bool operator==(const AStarNode& other) const
146 {
147 return this->stNodeLocation.dEasting == other.stNodeLocation.dEasting && this->stNodeLocation.dNorthing == other.stNodeLocation.dNorthing;
148 }
149 };
150 } // namespace nodes
151} // namespace pathplanners
152
153#endif
This namespace stores classes, functions, and structs that are used to implement different path plann...
Definition AStar.cpp:30
This struct stores/contains information about a UTM coordinate.
Definition GeospatialOperations.hpp:244
This node struct stores point data needed by the A* (ASTAR) algorithm to properly plan a path....
Definition Nodes.hpp:57
AStarNode(std::shared_ptr< AStarNode > pParentNode=nullptr, const geoops::UTMCoordinate stNodeLocation=geoops::UTMCoordinate(), const double dKg=0.0, const double dKh=0.0, const double dKf=0.0)
Construct a new AStarNode struct.
Definition Nodes.hpp:78
bool operator>(const AStarNode &other) const
Overloaded > comparison operator for AStarNode struct. Evaluates based on dKf value of nodes.
Definition Nodes.hpp:123
bool operator<(const AStarNode &other) const
Overloaded < comparison operator for AStarNode struct. Evaluates based on dKf value of nodes.
Definition Nodes.hpp:101
bool operator>=(const AStarNode &other) const
Overloaded >= comparison operator for AStarNode struct. Evaluates based on dKf value of nodes.
Definition Nodes.hpp:134
bool operator<=(const AStarNode &other) const
Overloaded <= comparison operator for AStarNode struct. Evaluates based on dKf value of nodes.
Definition Nodes.hpp:112
bool operator==(const AStarNode &other) const
Overloaded equality operator for AStarNode struct. This overload is used to see if two nodes have mat...
Definition Nodes.hpp:145