An optical computer vision and soil mechanics telemetry system designed for unmanned ground vehicles (UGVs), field rovers, and outdoor robotics. It classifies terrain patches in real time, computes surface friction coefficients (
flowchart TD
Camera["Optical Camera Sensor Stream (RGB Ground Patches)"] --> FeatureExtractor["Spectral & Texture Gradient Extractor (src/terrain_classifier.py)"]
FeatureExtractor --> Classifier["Multi-Class Terrain Classifier (Desert, Forest, Mountain, Plains, Marshland)"]
Classifier --> SoilModel["Bekker-Wong Soil Mechanics & Traction Estimator"]
SoilModel --> Traction["Friction Coefficient (mu) & Wheel Slip Hazard %"]
SoilModel --> Velocity["Max Safe Velocity Limit (v_max km/h)"]
SoilModel --> NavCost["ROS 2 Nav2 Costmap Traversal Penalty (0 - 100)"]
Traction --> ROS2["ROS 2 Navigation2 Costmap Layer (/terrain/traversability_cost)"]
Velocity --> ROS2
NavCost --> ROS2
SoilModel --> Dashboard["Mission Control Ground Console (app/streamlit_app.py)"]
SoilModel --> API["FastAPI Edge Endpoints (src/api.py)"]
In outdoor robotics (planetary exploration rovers, autonomous agricultural harvesters, construction site UGVs, search-and-rescue robots), standard geometric obstacle detection (e.g. LiDAR point clouds) fails to determine whether flat ground is traversable. A level surface of soft sand, deep mud, or loose gravel can immobilize or flip a rover.
This platform bridges vision perception and physical locomotion:
-
Soil Mechanics & Friction Attribution: Calculates surface friction coefficients (
$\mu$ ) ranging from 0.22 (waterlogged marsh) to 0.72 (compact soil) to calibrate vehicle motor torque. -
Dynamic Velocity Throttling: Automatically enforces linear speed limits (
$v_{\max}$ ) to prevent rollover on steep mountain scree or chassis sinkage in desert dunes. - ROS 2 Nav2 Costmap Injection: Translates optical classifications into continuous traversal costs (0-100) consumable by global and local A*/Dijkstra path planners.
| Terrain Class | Primary Characteristics | Friction Coeff ( |
Sinkage Risk (%) | Max Velocity ( |
Nav2 Costmap Cost | Navigational Action |
|---|---|---|---|---|---|---|
| Plains | Grassland, compact topsoil | 0.72 | 15% | 28.0 km/h | 20 / 100 | NORMAL_CRUISE |
| Forest | Dense leaf litter, hidden root obstacles | 0.58 | 45% | 14.0 km/h | 60 / 100 | THROTTLE_DRIVE |
| Mountain | Rocky scree, steep slope, loose stone | 0.52 | 35% | 8.0 km/h | 85 / 100 | ENGAGE_DIFF_LOCK |
| Desert | Granular sand dunes, loose dry sediment | 0.38 | 75% | 12.0 km/h | 70 / 100 | THROTTLE_AND_MOMENTUM |
| Marshland | Saturated silt, mud, standing water | 0.22 | 90% | 5.0 km/h | 98 / 100 | HAZARDOUS_REROUTE |
GET /healthResponse:
{
"status": "healthy",
"service": "vision-based-terrain-classification",
"supported_classes": ["Plains", "Desert", "Mountain", "Forest", "Marshland"]
}GET /api/v1/profilesPOST /api/v1/classify/upload
Content-Type: multipart/form-data
file: [binary image file]POST /api/v1/classify/base64
Content-Type: application/json
{
"image_base64": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}git clone https://github.com/MuhammadMinhaj229/Vision-Based-Terrain-Classification.git
cd Vision-Based-Terrain-Classification
pip install -r requirements.txtpython -m pytest tests/streamlit run app/streamlit_app.pyuvicorn src.api:app --host 0.0.0.0 --port 8000 --reload