unilab.envs.locomotion.go2.rough.Go2RoughTerrainCfg

class unilab.envs.locomotion.go2.rough.Go2RoughTerrainCfg[source]

Bases: TerrainGeneratorCfg

Go2RoughTerrainCfg(*, seed: ‘int | None’ = None, curriculum: ‘bool’ = False, size: ‘tuple[float, float]’ = (8.0, 8.0), horizontal_scale: ‘float’ = 0.2, vertical_scale: ‘float’ = 0.005, border_width: ‘float’ = 1.0, num_rows: ‘int’ = 6, num_cols: ‘int’ = 6, sub_terrains: ‘dict[str, SubTerrainCfg]’ = <factory>, difficulty_range: ‘tuple[float, float]’ = (0.0, 1.0), add_lights: ‘bool’ = True)

Parameters:

Methods

__init__(*[, seed, curriculum, size, ...])

Attributes

add_lights

If True, adds a directional light above the terrain grid.

border_width

Width of the flat border around the entire terrain grid, in meters.

curriculum

Controls terrain allocation mode:

difficulty_range

Min and max difficulty values used when generating sub-terrains.

horizontal_scale

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

num_cols

Number of sub-terrain columns in the grid.

num_rows

Number of sub-terrain rows in the grid.

seed

Random seed for terrain generation.

size

Width and length of each sub-terrain patch, in meters.

vertical_scale

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

sub_terrains

Named sub-terrain configurations to populate the grid.

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

Width and length of each sub-terrain patch, in meters. Both components must be integer multiples of horizontal_scale.

num_rows: int = 6

Number of sub-terrain rows in the grid. Represents difficulty levels in curriculum mode. Note: Environments are randomly assigned to rows, so multiple envs can share the same patch.

num_cols: int = 6

Number of sub-terrain columns in the grid.

In curriculum mode the generator ignores this value and uses one column per terrain type (len(sub_terrains)). In random mode it is used as-is.

border_width: float = 1.0

Width of the flat border around the entire terrain grid, in meters. Must be an integer multiple of horizontal_scale if non-zero. The border is a flat hfield slab whose top surface is flush with the inner-terrain floor at z=0; it is NOT a wall.

add_lights: bool = True

If True, adds a directional light above the terrain grid.

horizontal_scale: float = 0.2

Heightfield grid resolution along x and y, in meters per cell. Shared by every sub-terrain (overwritten in TerrainGenerator __init__). All length-like sub-terrain parameters (step_width, platform_width, border_width, etc.) must be integer multiples of this value.

sub_terrains: dict[str, SubTerrainCfg]

Named sub-terrain configurations to populate the grid.

__init__(*, seed=None, curriculum=False, size=(8.0, 8.0), horizontal_scale=0.2, vertical_scale=0.005, border_width=1.0, num_rows=6, num_cols=6, sub_terrains=<factory>, difficulty_range=(0.0, 1.0), add_lights=True)
Parameters:
curriculum: bool = False

Controls terrain allocation mode:

  • curriculum=True: Each terrain type gets exactly ONE column. The generator uses

    len(sub_terrains) columns regardless of num_cols. Difficulty increases along rows. The proportion field controls how many robots are spawned per column, not column count.

  • curriculum=False: Every patch is randomly sampled from all terrain types.

    Proportions control sampling probability. Use this for random variety.

difficulty_range: tuple[float, float] = (0.0, 1.0)

Min and max difficulty values used when generating sub-terrains.

seed: int | None = None

Random seed for terrain generation. None uses a random seed.

vertical_scale: float = 0.005

Heightfield height resolution, in meters per integer unit of the noise array. Shared by every sub-terrain (overwritten in TerrainGenerator __init__).