![]() |
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.
|
This class implements a geospatial path planner that uses a discrete 2.5D Costmap and a fast Weighted A* algorithm with Kinematic Constraints to find the optimal path through complex terrain between two coordinates. All tunable heuristics and parameters are accessible via constructor initialization. More...
#include <GeoPlanner.h>

Classes | |
| struct | GridCell |
| Represents a single cell in our 2.5D discretized Costmap grid. This is used to aggregate sparse point cloud data into a unified, easy-to-search surface for the A* algorithm. More... | |
| struct | PlannerState |
| This struct represents the state of a node in the A* algorithm. Optimized to work with a flat 1D vector instead of a hash map to prevent heavy heap allocations and memory fragmentation. More... | |
| struct | PlannerStateCompare |
| This struct is used to compare two PlannerState objects based on their cost to properly sort the priority queue. More... | |
| struct | TileKey |
| This struct represents a tile key in the implicit graph representation. We divide the plan into a regular grid of tiles of size dTileSize*dTileSize meters. More... | |
| struct | TileKeyEqual |
| This struct is used to compare two TileKey objects for equality after a hash collision is triggered. More... | |
| struct | TileKeyHash |
| This struct is used to hash TileKey objects for use in unordered maps. More... | |
Public Member Functions | |
| GeoPlanner (double dTileSize=50.0, double dGridResolution=0.5, double dHeuristicWeight=1.5, double dBetaBias=1.0, double dMinTravScore=0.0, int nDilationPasses=2, double dSafeTravScoreThreshold=0.5, int nMaxSpiralSearchRadius=20, size_t siMaxPlotPointsPerTile=10, double dPenaltyScalingFactor=10.0, double dPenaltyPower=2.0, double dPathWaypointTolerance=0.5) | |
| Construct a new Geo Planner:: Geo Planner object. Initializes all complex algorithms and mathematical hyperparameters to avoid explicitly hardcoded magic numbers logic. | |
| ~GeoPlanner () | |
| Destroy the Geo Planner:: Geo Planner object. | |
| std::vector< geoops::Waypoint > | PlanPath (LiDARHandler *pLiDARHandler, const geoops::UTMCoordinate &stStart, const geoops::UTMCoordinate &stEnd, double dSearchRadius=3.0, double dMaxSearchTimeSeconds=120.0, double dCorridorPadding=100.0) |
| Plan an optimal trajectory path from the start UTM to the end UTM coordinate utilizing a 2.5D hierarchical Costmap grid representation. | |
| void | ClearGeoCache () |
| Explicitly zeroes and reclaims internal spatial database mapping arrays. | |
| void | UnloadLiDARTiles (double minX, double maxX, double minY, double maxY) |
| Unload tile LiDAR data. | |
| void | SetTileSize (double dTileSize) |
| Sets the dimensional size of database tiles mapped during planning. | |
| void | SetMinTravScore (double dMinTravScore) |
| Sets the absolute minimum travel score required for a valid cell. | |
| void | SetBetaBias (double dBetaBias) |
| Sets the algorithm's penalty sensitivity bias multiplier. | |
| double | GetTileSize () const |
| Retrieves the currently configured database tile size constraint. | |
| double | GetMinTravScore () const |
| Retrieves the actively configured minimum travel score parameter limit. | |
| double | GetBetaBias () const |
| Retrieves the beta heuristic bias factor configured dynamically. | |
Private Member Functions | |
| bool | PreloadCorridorAndBuildGrid (const geoops::UTMCoordinate &stStart, const geoops::UTMCoordinate &stEnd) |
| Calculates a bounding box based on Start and End coordinates, preloads LiDAR chunks, and structures them down into a contiguous 1D Costmap vector. | |
| void | SearchAStar () |
| Actively runs a highly optimized Weighted A* pathfinding search upon the 1D Costmap grid utilizing kinematic 3D spatial awareness. | |
| std::vector< geoops::Waypoint > | ReconstructPath () const |
| Transforms the abstract 1D computational grid configurations logically backward to rebuild a continuous stream of actionable UTM Geographic sequences. | |
| void | CheckAndLoadTile (int nTileX, int nTileY) |
| Checks if a specific tile is loaded in the cache, and if not, fetches the relevant LiDAR point cloud data into memory. | |
| void | FillGridHoles () |
| Performs morphological dilation on the costmap to fill in structural voids or gaps caused by sparse LiDAR data collections. | |
| int | FindNearestValidCell (int nStartIndex) const |
| Expands outward concentrically from a target grid cell to locate the nearest neighboring cell that contains valid and safe traversal structures. | |
| double | EuclideanDistance (double dEasting1, double dNorthing1, double dEasting2, double dNorthing2) const |
| Calculates the standard 2D Euclidean distance between two geographic coordinates. This establishes mathematically admissible baseline heuristic bounds for A*. | |
| int | GetGridIndex (int nX, int nY) const |
| Inline helper to convert 2D grid coordinates to a 1D vector index. | |
| void | GetGridCoords (int nIndex, int &nX, int &nY) const |
| Inline helper to convert a 1D vector index back into 2D grid coordinates. | |
Private Attributes | |
| const std::function< void(const rovecomm::RoveCommPacket< float > &, const sockaddr_in &)> | fnMinTravScoreCallback |
| Callback function used to set the minimum travel score for path planning. | |
| const std::function< void(const rovecomm::RoveCommPacket< float > &, const sockaddr_in &)> | fnBetaBiasCallback |
| Callback function used to set the beta bias for travel scores in path planning. | |
| double | m_dTileSize |
| double | m_dGridResolution |
| double | m_dHeuristicWeight |
| double | m_dBeta |
| double | m_dMinTravScore |
| int | m_nDilationPasses |
| double | m_dSafeTravScoreThreshold |
| int | m_nMaxSpiralSearchRadius |
| size_t | m_siMaxPlotPointsPerTile |
| double | m_dPenaltyScalingFactor |
| double | m_dPenaltyPower |
| double | m_dPathWaypointTolerance |
| double | m_dSearchRadius |
| double | m_dMaxSearchTimeSeconds |
| double | m_dCorridorPadding |
| LiDARHandler * | m_pLiDARHandler |
| std::mutex | m_muPathGenMutex |
| double | m_dGridOriginEasting |
| double | m_dGridOriginNorthing |
| int | m_nGridWidth |
| int | m_nGridHeight |
| int | m_nStartIndex |
| int | m_nEndIndex |
| std::vector< GridCell > | m_vCostmap |
| std::priority_queue< PlannerState, std::vector< PlannerState >, PlannerStateCompare > | m_pqOpenSetNextBest |
| std::vector< int > | m_vPredecessors |
| std::vector< bool > | m_vbClosedSet |
| std::vector< double > | m_vdGCosts |
| std::unordered_map< TileKey, std::vector< LiDARHandler::PointRow >, TileKeyHash, TileKeyEqual > | m_umTileMapCache |
This class implements a geospatial path planner that uses a discrete 2.5D Costmap and a fast Weighted A* algorithm with Kinematic Constraints to find the optimal path through complex terrain between two coordinates. All tunable heuristics and parameters are accessible via constructor initialization.
| pathplanners::GeoPlanner::GeoPlanner | ( | double | dTileSize = 50.0, |
| double | dGridResolution = 0.5, |
||
| double | dHeuristicWeight = 1.5, |
||
| double | dBetaBias = 1.0, |
||
| double | dMinTravScore = 0.0, |
||
| int | nDilationPasses = 2, |
||
| double | dSafeTravScoreThreshold = 0.5, |
||
| int | nMaxSpiralSearchRadius = 20, |
||
| size_t | siMaxPlotPointsPerTile = 10, |
||
| double | dPenaltyScalingFactor = 10.0, |
||
| double | dPenaltyPower = 2.0, |
||
| double | dPathWaypointTolerance = 0.5 |
||
| ) |
Construct a new Geo Planner:: Geo Planner object. Initializes all complex algorithms and mathematical hyperparameters to avoid explicitly hardcoded magic numbers logic.
| dTileSize | - The size of each database tile block loaded in meters. |
| dGridResolution | - Metric scale of an individual discrete costmap cell. |
| dHeuristicWeight | - The A* bias weight to accelerate goal seeking behaviors. |
| dBetaBias | - Baseline beta algorithmic multiplier for penalizing bad terrain. |
| dMinTravScore | - Absolute required lower bound on traversal values to be considered usable pathing terrain. |
| nDilationPasses | - Number of morphological loop passes executed to fill void structures in sparse point clouds. |
| dSafeTravScoreThreshold | - Baseline score requirement applied when attempting to snap stray origin coordinates. |
| nMaxSpiralSearchRadius | - Max concentric rings expanded when searching for safe origin snapping structures. |
| siMaxPlotPointsPerTile | - Rendering density constraint to prevent visualizer overload. |
| dPenaltyScalingFactor | - Multiplier intensifying standard penalty math strictly during node score resolution. |
| dPenaltyPower | - Exponential scaler applied universally to mathematically discourage steep or dangerous zones. |
| dPathWaypointTolerance | - Native radius value embedded into actively returned planned telemetry sequence nodes. |
| pathplanners::GeoPlanner::~GeoPlanner | ( | ) |
Destroy the Geo Planner:: Geo Planner object.
| std::vector< geoops::Waypoint > pathplanners::GeoPlanner::PlanPath | ( | LiDARHandler * | pLiDARHandler, |
| const geoops::UTMCoordinate & | stStart, | ||
| const geoops::UTMCoordinate & | stEnd, | ||
| double | dSearchRadius = 3.0, |
||
| double | dMaxSearchTimeSeconds = 120.0, |
||
| double | dCorridorPadding = 100.0 |
||
| ) |
Plan an optimal trajectory path from the start UTM to the end UTM coordinate utilizing a 2.5D hierarchical Costmap grid representation.
| pLiDARHandler | - Pointer to the LiDARHandler database instance for fetching geospatial data. |
| stStart | - The desired starting UTM geographic coordinate representation. |
| stEnd | - The ultimate destination UTM geographic coordinate representation. |
| dSearchRadius | - Padding base radius used to compute bounds. |
| dMaxSearchTimeSeconds | - The absolute maximum CPU time in seconds allocated to search attempts. |
| dCorridorPadding | - The extended corridor buffer dimension appended dynamically outside raw bounds. |


| void pathplanners::GeoPlanner::ClearGeoCache | ( | ) |
Explicitly zeroes and reclaims internal spatial database mapping arrays.
| void pathplanners::GeoPlanner::UnloadLiDARTiles | ( | double | minX, |
| double | maxX, | ||
| double | minY, | ||
| double | maxY | ||
| ) |
Unload tile LiDAR data.
| minX | - Minimum x coordinate of tile range. |
| maxX | - Maximum x coordinate of tile range. |
| minY | - Minimum y coordinate of tile range. |
| maxY | - Maximum y coordinate of tile range. |
| void pathplanners::GeoPlanner::SetTileSize | ( | double | dTileSize | ) |
Sets the dimensional size of database tiles mapped during planning.
| dTileSize | - The block size in meters. |
| void pathplanners::GeoPlanner::SetMinTravScore | ( | double | dMinTravScore | ) |
Sets the absolute minimum travel score required for a valid cell.
| dMinTravScore | - Minimum permissible score limit. |
| void pathplanners::GeoPlanner::SetBetaBias | ( | double | dBetaBias | ) |
Sets the algorithm's penalty sensitivity bias multiplier.
| dBetaBias | - Baseline beta algorithmic multiplier. |
| double pathplanners::GeoPlanner::GetTileSize | ( | ) | const |
Retrieves the currently configured database tile size constraint.
| double pathplanners::GeoPlanner::GetMinTravScore | ( | ) | const |
Retrieves the actively configured minimum travel score parameter limit.
| double pathplanners::GeoPlanner::GetBetaBias | ( | ) | const |
Retrieves the beta heuristic bias factor configured dynamically.
|
private |
Calculates a bounding box based on Start and End coordinates, preloads LiDAR chunks, and structures them down into a contiguous 1D Costmap vector.
| stStart | - The designated starting UTM geographic coordinate. |
| stEnd | - The designated end UTM geographic coordinate. |


|
private |
Actively runs a highly optimized Weighted A* pathfinding search upon the 1D Costmap grid utilizing kinematic 3D spatial awareness.


|
private |
Transforms the abstract 1D computational grid configurations logically backward to rebuild a continuous stream of actionable UTM Geographic sequences.


|
private |
Checks if a specific tile is loaded in the cache, and if not, fetches the relevant LiDAR point cloud data into memory.
| nTileX | - The exact coordinate identifier X block reference naturally mapping structurally. |
| nTileY | - The exact coordinate identifier Y block reference naturally mapping structurally. |


|
private |
Performs morphological dilation on the costmap to fill in structural voids or gaps caused by sparse LiDAR data collections.


|
private |
Expands outward concentrically from a target grid cell to locate the nearest neighboring cell that contains valid and safe traversal structures.
| nStartIndex | - Origin array structural identifier originally derived from GPS. |

|
private |
Calculates the standard 2D Euclidean distance between two geographic coordinates. This establishes mathematically admissible baseline heuristic bounds for A*.
| dEasting1 | - The numeric coordinate east bounds establishing start reference. |
| dNorthing1 | - The numeric coordinate north bounds establishing start reference. |
| dEasting2 | - The numeric coordinate east bounds establishing end reference. |
| dNorthing2 | - The numeric coordinate north bounds establishing end reference. |

|
inlineprivate |
Inline helper to convert 2D grid coordinates to a 1D vector index.
| nX | - The X grid coordinate. |
| nY | - The Y grid coordinate. |

|
inlineprivate |
Inline helper to convert a 1D vector index back into 2D grid coordinates.
| nIndex | - The 1D vector index to decode. |
| nX | - Reference to store the resultant X coordinate. |
| nY | - Reference to store the resultant Y coordinate. |

|
private |
Callback function used to set the minimum travel score for path planning.
|
private |
Callback function used to set the beta bias for travel scores in path planning.