Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ Guidelines for modifications:
* Xavier Nal
* Xinjie Yao
* Xinpeng Liu
* Xin Xu
* Yang Jin
* Yanzi Zhu
* Yijie Guo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
Expand Down Expand Up @@ -29,9 +29,11 @@
HfDiscreteObstaclesTerrainCfg,
HfInvertedPyramidSlopedTerrainCfg,
HfInvertedPyramidStairsTerrainCfg,
HfInvertedRoughSlopeTerrainCfg,
HfPyramidSlopedTerrainCfg,
HfPyramidStairsTerrainCfg,
HfRandomUniformTerrainCfg,
HfRoughSlopeTerrainCfg,
HfSteppingStonesTerrainCfg,
HfTerrainBaseCfg,
HfWaveTerrainCfg,
Expand Down
20 changes: 19 additions & 1 deletion source/isaaclab/isaaclab/terrains/height_field/hf_terrains.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
Expand Down Expand Up @@ -148,6 +148,24 @@ def pyramid_sloped_terrain(difficulty: float, cfg: hf_terrains_cfg.HfPyramidSlop
return np.rint(hf_raw).astype(np.int16)


@height_field_to_mesh
def rough_slope_terrain(difficulty: float, cfg: hf_terrains_cfg.HfRoughSlopeTerrainCfg) -> np.ndarray:
# combine the two methods
terrain1 = pyramid_sloped_terrain.__wrapped__(difficulty, cfg)
terrain2 = random_uniform_terrain.__wrapped__(difficulty, cfg)
hf = terrain1 + terrain2

# the platform at center do not need to be rough
width_pixels = int(cfg.size[0] / cfg.horizontal_scale)
length_pixels = int(cfg.size[1] / cfg.horizontal_scale)
platform_width = int(cfg.platform_width / cfg.horizontal_scale / 2)
x_pf = width_pixels // 2 - platform_width
y_pf = length_pixels // 2 - platform_width
z_pf = hf[x_pf, y_pf]
hf = np.clip(hf, min(0, z_pf), max(0, z_pf))
return hf


@height_field_to_mesh
def pyramid_stairs_terrain(difficulty: float, cfg: hf_terrains_cfg.HfPyramidStairsTerrainCfg) -> np.ndarray:
"""Generate a terrain with a pyramid stair pattern.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
Expand Down Expand Up @@ -91,6 +91,20 @@ class HfInvertedPyramidSlopedTerrainCfg(HfPyramidSlopedTerrainCfg):
inverted: bool = True


@configclass
class HfRoughSlopeTerrainCfg(HfRandomUniformTerrainCfg, HfPyramidSlopedTerrainCfg):
"rough slope cfg, combine the cfg of random terrain and smooth slope terrain"

function = hf_terrains.rough_slope_terrain


@configclass
class HfInvertedRoughSlopeTerrainCfg(HfRandomUniformTerrainCfg, HfInvertedPyramidSlopedTerrainCfg):
"rough slope cfg, combine the cfg of random terrain and smooth slope terrain"

function = hf_terrains.rough_slope_terrain


@configclass
class HfPyramidStairsTerrainCfg(HfTerrainBaseCfg):
"""Configuration for a pyramid stairs height field terrain."""
Expand Down