Unverified Commit 912279d5 authored by Pascal Roth's avatar Pascal Roth Committed by GitHub

Adds option to set the height of the border in the `TerrainGenerator` (#744)

# Description

Adds a parameter `border_height` to `TerrainGeneratorCfg` to be able to
control the height of the generator border instead of having a
hard-coded value of 1.0m.

## 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`
- [ ] 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
parent 692b1779
[package]
# Note: Semantic Versioning is used: https://semver.org/
version = "0.20.4"
version = "0.20.5"
# Description
title = "Isaac Lab framework for Robot Learning"
......
Changelog
---------
0.20.5 (2024-08-02)
~~~~~~~~~~~~~~~~~~~
Added
^^^^^
* Added :attr:`omni.isaac.lab.terrain.TerrainGeneratorCfg.border_height` to set the height of the border
around the terrain.
0.20.4 (2024-08-02)
~~~~~~~~~~~~~~~~~~~
......
......@@ -259,9 +259,13 @@ class TerrainGenerator:
self.cfg.num_cols * self.cfg.size[1] + 2 * self.cfg.border_width,
)
inner_size = (self.cfg.num_rows * self.cfg.size[0], self.cfg.num_cols * self.cfg.size[1])
border_center = (self.cfg.num_rows * self.cfg.size[0] / 2, self.cfg.num_cols * self.cfg.size[1] / 2, -0.5)
border_center = (
self.cfg.num_rows * self.cfg.size[0] / 2,
self.cfg.num_cols * self.cfg.size[1] / 2,
-self.cfg.border_height / 2,
)
# border mesh
border_meshes = make_border(border_size, inner_size, height=1.0, position=border_center)
border_meshes = make_border(border_size, inner_size, height=self.cfg.border_height, position=border_center)
border = trimesh.util.concatenate(border_meshes)
# update the faces to have minimal triangles
selector = ~(np.asarray(border.triangles)[:, :, 2] < -0.1).any(1)
......
......@@ -125,6 +125,9 @@ class TerrainGeneratorCfg:
border_width: float = 0.0
"""The width of the border around the terrain (in m). Defaults to 0.0."""
border_height: float = 1.0
"""The height of the border around the terrain (in m). Defaults to 1.0."""
num_rows: int = 1
"""Number of rows of sub-terrains to generate. Defaults to 1."""
......
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