Central engineering reference and operations manual for the MRDT Autonomy Software.
View the Project on GitHub MissouriMRDT/Autonomy_Software
Return to RoveSoDocs Guides for Today, Tomorrow, and Forever.
The LiDARHandler (src/handlers/LiDARHandler.h & LiDARHandler.cpp) manages runtime spatial queries against preprocessed LiDAR point cloud databases, providing real-time terrain topology and obstacle metrics to GeoPlanner and VisualizationHandler.
constants::LIDAR_HANDLER_DB_PATH) containing millions of geospatial points derived from USGS 3DEP LAS 1.4 point clouds.GeoPlanner costmap generator.Points are stored and returned in the LiDARHandler::PointRow structure:
struct PointRow
{
int nID; // Unique point identifier
double dEasting; // UTM Easting coordinate (meters)
double dNorthing; // UTM Northing coordinate (meters)
double dAltitude; // Altitude above sea level (meters)
std::string szZone; // UTM Zone designator
std::string szClassification; // Point classification (ground, rock, etc.)
double dNormalX; // X component of local surface normal vector
double dNormalY; // Y component of local surface normal vector
double dNormalZ; // Z component of local surface normal vector
double dSlope; // Surface slope (degrees)
double dRoughness; // Local terrain roughness metric
double dCurvature; // Surface curvature metric
double dTraversalScore; // Composite score [0.0 = impassable, 1.0 = smooth]
};
PointFilterQueries can be conditioned using LiDARHandler::PointFilter, specifying min/max bounds on slope, roughness, curvature, and normal vectors to isolate specific terrain hazards.
The handler leverages DuckDB rather than traditional relational engines:
std::shared_mutex to allow concurrent read queries across GeoPlanner and VisualizationHandler threads.// Opening the database during initialization (in main.cpp)
globals::g_pLiDARHandler = new LiDARHandler();
if (!globals::g_pLiDARHandler->OpenDB(constants::LIDAR_HANDLER_DB_PATH))
{
LOG_ERROR(logging::g_qSharedLogger, "Failed to open LiDAR DuckDB database.");
}
// Querying terrain within a 15-meter radius of the rover
std::vector<LiDARHandler::PointRow> vNearbyPoints;
vNearbyPoints = globals::g_pLiDARHandler->GetPointsInRadius(stRoverUTM, 15.0);
// Filtering for steep obstacles (slope > 25 degrees)
LiDARHandler::PointFilter stFilter;
stFilter.dEasting = stRoverUTM.dEasting;
stFilter.dNorthing = stRoverUTM.dNorthing;
stFilter.dRadius = 20.0;
stFilter.dSlope = LiDARHandler::PointFilter::Range<double>{25.0, 90.0};
std::vector<LiDARHandler::PointRow> vSteepObstacles;
vSteepObstacles = globals::g_pLiDARHandler->GetPointsWithFilter(stFilter);
The spatial elevation and terrain point clouds queried by LiDARHandler are sourced from the USGS 3D Elevation Program (3DEP) and processed into indexed DuckDB databases. Raw LAS/LAZ point cloud tiles, pre-generated DuckDB database artifacts, and ingestion scripts are hosted on the team’s GitLab server:
Developers running simulations or offline tests requiring local terrain maps should acquire the appropriate regional .duckdb tiles from USGS_Data and place them at the path configured in constants::LIDAR_HANDLER_DB_PATH (data/LiDAR/ by default).
Terrain point clouds, cross-sectional elevation profiles, and traversability slopes can be visualized interactively in the web browser without launching local DuckDB instances:
This tool supports inspecting 3D colored point distributions, evaluating elevation gradients, and testing traversability threshold configurations across competition terrains.