Create traversability map with a sample digital elevation model (DEM) and set the map resolution.
The resolution sets the size of each grid cell in meters. A smaller value of resolution gives finer details.
Visualize digital elevation model (DEM) of the terrain.
Create traversability map from the digital elevation model (DEM).
map =
traversabilityMap with properties:
SlopeThreshold: [0.2000 0.3000]
RoughnessThreshold: [0.1000 0.2000]
StepHeightThreshold: [1.1352 1.7323]
StepHeightWindowSize: 5.6000
CostWeight: [1 1 1]
GridOriginInLocal: [0 0]
Resolution: 1.2500
XLocalLimits: [0 64.8000]
YLocalLimits: [0 64.8000]
Display the traversability map.
Enable SlopeThreshold
and set the safe and critical values.
Flexible threshold values allow intermediate terrains with moderate slopes (e.g., between 10° and 15°) to have a cost but remain traversable. In this case, areas with slope ≤ 10° are considered safe whereas areas with slope > 15° are non-traversable. Areas between the safe and critical thresholds are assigned intermediate cost values.
Set the StepHeightThreshold
and RoughnessThreshold
to infinity to disable their influence.
Display the updated traversability map in the local coordinate frame.
Access traversability data for analysis or debugging. Extract the data for a window whose bottom-left corner is at [X,Y] = [20,30] metres and its [Width,Height] = [5,7] metres.
Traversability Cost Data:
0.8802 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
0 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
0 0 1.0000 1.0000 1.0000 1.0000 1.0000
0 0 0 1.0000 1.0000 1.0000 1.0000
0 0 0 0.7495 1.0000 1.0000 1.0000
0 0 0 0 1.0000 1.0000 1.0000
0 0 0 0 0 1.0000 1.0000
0 0 0 0 0 0.8712 1.0000
0 0 0 0 0 0 1.0000
To configure strict slope threshold, set identical values for safe and critical threshold limits. This use case is applicable for offroad vehicles designed for flat terrains or with low tolerance for inclines.
Visualize the updated traversability map. You can access the traversability data by using getMapData
.