Unverified Commit c5fd8ebe authored by James Tigue's avatar James Tigue Committed by GitHub

Adds ability to set platform height independent of object height for terrain (#2695)

# Description
Allow to set platform height independent of the object height.

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change
- New feature (non-breaking change which adds functionality)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

Credit: @fjenelten-bdai

---------
Signed-off-by: 's avatarJames Tigue <166445701+jtigue-bdai@users.noreply.github.com>
Signed-off-by: 's avatarKelly Guo <kellyg@nvidia.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
parent db5c1c32
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.40.14" version = "0.40.15"
# Description # Description
title = "Isaac Lab framework for Robot Learning" title = "Isaac Lab framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.40.15 (2025-07-08)
~~~~~~~~~~~~~~~~~~~~
Added
^^^^^
* Added ability to set platform height independent of object height for trimesh terrains.
0.40.14 (2025-07-01) 0.40.14 (2025-07-01)
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
...@@ -37,6 +46,7 @@ Changed ...@@ -37,6 +46,7 @@ Changed
Added Added
^^^^^ ^^^^^
* Added unit test for :func:`~isaaclab.utils.math.quat_inv`. * Added unit test for :func:`~isaaclab.utils.math.quat_inv`.
Fixed Fixed
......
...@@ -773,6 +773,7 @@ def repeated_objects_terrain( ...@@ -773,6 +773,7 @@ def repeated_objects_terrain(
# -- common parameters # -- common parameters
num_objects = cp_0.num_objects + int(difficulty * (cp_1.num_objects - cp_0.num_objects)) num_objects = cp_0.num_objects + int(difficulty * (cp_1.num_objects - cp_0.num_objects))
height = cp_0.height + difficulty * (cp_1.height - cp_0.height) height = cp_0.height + difficulty * (cp_1.height - cp_0.height)
platform_height = cfg.platform_height if cfg.platform_height >= 0.0 else height
# -- object specific parameters # -- object specific parameters
# note: SIM114 requires duplicated logical blocks under a single body. # note: SIM114 requires duplicated logical blocks under a single body.
if isinstance(cfg, MeshRepeatedBoxesTerrainCfg): if isinstance(cfg, MeshRepeatedBoxesTerrainCfg):
...@@ -808,7 +809,7 @@ def repeated_objects_terrain( ...@@ -808,7 +809,7 @@ def repeated_objects_terrain(
# initialize list of meshes # initialize list of meshes
meshes_list = list() meshes_list = list()
# compute quantities # compute quantities
origin = np.asarray((0.5 * cfg.size[0], 0.5 * cfg.size[1], 0.5 * height)) origin = np.asarray((0.5 * cfg.size[0], 0.5 * cfg.size[1], 0.5 * platform_height))
platform_corners = np.asarray([ platform_corners = np.asarray([
[origin[0] - cfg.platform_width / 2, origin[1] - cfg.platform_width / 2], [origin[0] - cfg.platform_width / 2, origin[1] - cfg.platform_width / 2],
[origin[0] + cfg.platform_width / 2, origin[1] + cfg.platform_width / 2], [origin[0] + cfg.platform_width / 2, origin[1] + cfg.platform_width / 2],
...@@ -851,8 +852,8 @@ def repeated_objects_terrain( ...@@ -851,8 +852,8 @@ def repeated_objects_terrain(
ground_plane = make_plane(cfg.size, height=0.0, center_zero=False) ground_plane = make_plane(cfg.size, height=0.0, center_zero=False)
meshes_list.append(ground_plane) meshes_list.append(ground_plane)
# generate a platform in the middle # generate a platform in the middle
dim = (cfg.platform_width, cfg.platform_width, 0.5 * height) dim = (cfg.platform_width, cfg.platform_width, 0.5 * platform_height)
pos = (0.5 * cfg.size[0], 0.5 * cfg.size[1], 0.25 * height) pos = (0.5 * cfg.size[0], 0.5 * cfg.size[1], 0.25 * platform_height)
platform = trimesh.creation.box(dim, trimesh.transformations.translation_matrix(pos)) platform = trimesh.creation.box(dim, trimesh.transformations.translation_matrix(pos))
meshes_list.append(platform) meshes_list.append(platform)
......
...@@ -42,6 +42,10 @@ class MeshPyramidStairsTerrainCfg(SubTerrainBaseCfg): ...@@ -42,6 +42,10 @@ class MeshPyramidStairsTerrainCfg(SubTerrainBaseCfg):
"""The width of the steps (in m).""" """The width of the steps (in m)."""
platform_width: float = 1.0 platform_width: float = 1.0
"""The width of the square platform at the center of the terrain. Defaults to 1.0.""" """The width of the square platform at the center of the terrain. Defaults to 1.0."""
platform_height: float = -1.0
"""The height of the platform. Defaults to -1.0.
If the value is negative, the height is the same as the object height."""
holes: bool = False holes: bool = False
"""If True, the terrain will have holes in the steps. Defaults to False. """If True, the terrain will have holes in the steps. Defaults to False.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment