unilab.terrains.heightfield_terrains.HfRandomUniformTerrainCfg

class unilab.terrains.heightfield_terrains.HfRandomUniformTerrainCfg[source]

Bases: SubTerrainCfg

HfRandomUniformTerrainCfg(proportion: ‘float’ = 1.0, size: ‘tuple[float, float]’ = (10.0, 10.0), flat_patch_sampling: ‘dict[str, FlatPatchSamplingCfg] | None’ = None, *, noise_range: ‘tuple[float, float]’, noise_step: ‘float’ = 0.005, downsampled_scale: ‘float | None’ = None, horizontal_scale: ‘float’ = 0.1, vertical_scale: ‘float’ = 0.005, base_thickness_ratio: ‘float’ = 1.0, border_width: ‘float’ = 0.0)

Parameters:
  • proportion (float)

  • size (tuple[float, float])

  • flat_patch_sampling (dict[str, FlatPatchSamplingCfg] | None)

  • noise_range (tuple[float, float])

  • noise_step (float)

  • downsampled_scale (float | None)

  • horizontal_scale (float)

  • vertical_scale (float)

  • base_thickness_ratio (float)

  • border_width (float)

Methods

__init__([proportion, size, ...])

function(difficulty, rng)

Generate backend-agnostic terrain data.

Attributes

base_thickness_ratio

Ratio of the heightfield base thickness to its maximum surface height.

border_width

Width of the flat border around the terrain edges, in meters.

downsampled_scale

Spacing between randomly sampled height points before interpolation, in meters.

flat_patch_sampling

Named flat-patch sampling configurations, or None to disable.

horizontal_scale

Heightfield grid resolution along x and y, in meters per cell.

noise_step

Height quantization step, in meters.

proportion

Robot spawning weight for this terrain type.

size

Width and length of the terrain patch, in meters.

vertical_scale

Heightfield height resolution, in meters per integer unit of the noise array.

noise_range

Min and max height noise, in meters.

noise_range: tuple[float, float]

Min and max height noise, in meters.

noise_step: float = 0.005

Height quantization step, in meters. Sampled heights are multiples of this value within noise_range.

downsampled_scale: float | None = None

Spacing between randomly sampled height points before interpolation, in meters. If None, uses horizontal_scale. Must be >= horizontal_scale.

horizontal_scale: float = 0.1

Heightfield grid resolution along x and y, in meters per cell.

vertical_scale: float = 0.005

Heightfield height resolution, in meters per integer unit of the noise array.

base_thickness_ratio: float = 1.0

Ratio of the heightfield base thickness to its maximum surface height.

border_width: float = 0.0

Width of the flat border around the terrain edges, in meters. Must be >= horizontal_scale if non-zero.

function(difficulty, rng)[source]

Generate backend-agnostic terrain data.

Return type:

TerrainOutput

Returns:

TerrainOutput containing spawn origin and heightfield data.

Parameters:
__init__(proportion=1.0, size=(10.0, 10.0), flat_patch_sampling=None, *, noise_range, noise_step=0.005, downsampled_scale=None, horizontal_scale=0.1, vertical_scale=0.005, base_thickness_ratio=1.0, border_width=0.0)
Parameters:
  • proportion (float)

  • size (tuple[float, float])

  • flat_patch_sampling (dict[str, FlatPatchSamplingCfg] | None)

  • noise_range (tuple[float, float])

  • noise_step (float)

  • downsampled_scale (float | None)

  • horizontal_scale (float)

  • vertical_scale (float)

  • base_thickness_ratio (float)

  • border_width (float)

flat_patch_sampling: dict[str, FlatPatchSamplingCfg] | None = None

Named flat-patch sampling configurations, or None to disable.

proportion: float = 1.0

Robot spawning weight for this terrain type.

In curriculum mode, controls how many robots are spawned on this terrain’s column relative to other terrain types. Each terrain type always gets exactly one column; proportion only affects spawning distribution.

In random mode, controls the sampling probability for each patch.

size: tuple[float, float] = (10.0, 10.0)

Width and length of the terrain patch, in meters.