unilab.terrains.utils

Utility functions for terrain generation.

References

IsaacLab terrain utilities: https://github.com/isaac-sim/IsaacLab/blob/main/source/isaaclab/isaaclab/terrains/trimesh/utils.py

Functions

bilinear_resample_grid(x, y, z, x_new, y_new)

Resample a regular grid z(x, y) at the cartesian product of new coords.

bilinear_zoom_2d(arr, zoom_factors)

Resize a 2D array with bilinear interpolation.

find_flat_patches_from_heightfield(heights, ...)

Find flat patches on a heightfield surface using morphological filtering.

max_filter_with_footprint(arr, footprint[, ...])

Maximum filter with arbitrary footprint, padding out-of-bounds with fill_value.

min_filter_with_footprint(arr, footprint[, ...])

Minimum filter with arbitrary footprint, padding out-of-bounds with fill_value.

unilab.terrains.utils.bilinear_zoom_2d(arr, zoom_factors)[source]

Resize a 2D array with bilinear interpolation.

Parameters:
Return type:

ndarray

unilab.terrains.utils.bilinear_resample_grid(x, y, z, x_new, y_new)[source]

Resample a regular grid z(x, y) at the cartesian product of new coords.

Parameters:
Return type:

ndarray

unilab.terrains.utils.max_filter_with_footprint(arr, footprint, fill_value=-inf)[source]

Maximum filter with arbitrary footprint, padding out-of-bounds with fill_value.

Parameters:
Return type:

ndarray

unilab.terrains.utils.min_filter_with_footprint(arr, footprint, fill_value=inf)[source]

Minimum filter with arbitrary footprint, padding out-of-bounds with fill_value.

Parameters:
Return type:

ndarray

unilab.terrains.utils.find_flat_patches_from_heightfield(heights, horizontal_scale, z_offset, cfg, rng)[source]

Find flat patches on a heightfield surface using morphological filtering.

Parameters:
Return type:

ndarray