unilab.terrains.terrain_generator.FlatPatchSamplingCfg

class unilab.terrains.terrain_generator.FlatPatchSamplingCfg[source]

Bases: object

Configuration for sampling flat patches on a heightfield surface.

Parameters:

Methods

__init__([num_patches, patch_radius, ...])

Attributes

grid_resolution

Resolution of the grid used for flat-patch detection, in meters.

max_height_diff

Maximum allowed height variation within the patch footprint, in meters.

num_patches

Number of flat patches to sample per sub-terrain.

patch_radius

Radius of the circular footprint used to test flatness, in meters.

x_range

Allowed range of x coordinates for sampled patches, in meters.

y_range

Allowed range of y coordinates for sampled patches, in meters.

z_range

Allowed range of z coordinates (world height) for sampled patches, in meters.

num_patches: int = 10

Number of flat patches to sample per sub-terrain.

patch_radius: float = 0.5

Radius of the circular footprint used to test flatness, in meters.

max_height_diff: float = 0.05

Maximum allowed height variation within the patch footprint, in meters.

x_range: tuple[float, float] = (-1000000.0, 1000000.0)

Allowed range of x coordinates for sampled patches, in meters.

y_range: tuple[float, float] = (-1000000.0, 1000000.0)

Allowed range of y coordinates for sampled patches, in meters.

z_range: tuple[float, float] = (-1000000.0, 1000000.0)

Allowed range of z coordinates (world height) for sampled patches, in meters.

grid_resolution: float | None = None

Resolution of the grid used for flat-patch detection, in meters. When None (default), the terrain’s own horizontal_scale is used. Set to a smaller value (e.g. 0.025) for finer boundary precision at the cost of a larger intermediate grid.

__init__(num_patches=10, patch_radius=0.5, max_height_diff=0.05, x_range=(-1000000.0, 1000000.0), y_range=(-1000000.0, 1000000.0), z_range=(-1000000.0, 1000000.0), grid_resolution=None)
Parameters: