unilab.terrains.terrain_generator.SubTerrainCfg

class unilab.terrains.terrain_generator.SubTerrainCfg[source]

Bases: ABC

SubTerrainCfg(proportion: ‘float’ = 1.0, size: ‘tuple[float, float]’ = (10.0, 10.0), flat_patch_sampling: ‘dict[str, FlatPatchSamplingCfg] | None’ = None)

Parameters:

Methods

__init__([proportion, size, flat_patch_sampling])

function(difficulty, rng)

Generate backend-agnostic terrain data.

Attributes

flat_patch_sampling

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

proportion

Robot spawning weight for this terrain type.

size

Width and length of the terrain patch, in meters.

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.

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

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

abstract 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)
Parameters: