Skip to content

Commit 23e935c

Browse files
KyleM73kellyguo11
andauthored
Fixes rail difficulty-based height calculation in mesh_terrains.py (#3254)
# Description The rail mesh terrain created terrains from hardest to easiest due to a bug in how difficulty was used. This PR fixes that bug. Before: `rail_height = cfg.rail_height_range[1] - difficulty * (cfg.rail_height_range[1] - cfg.rail_height_range[0])` After: `rail_height = cfg.rail_height_range[0] + difficulty * (cfg.rail_height_range[1] - cfg.rail_height_range[0])` ## Type of change - Bug fix (non-breaking change which fixes an issue) ## 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 - [ ] 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 Signed-off-by: Kyle Morgenstein <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
1 parent a2540cd commit 23e935c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/isaaclab/isaaclab/terrains/trimesh/mesh_terrains.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def rails_terrain(
397397
A tuple containing the tri-mesh of the terrain and the origin of the terrain (in m).
398398
"""
399399
# resolve the terrain configuration
400-
rail_height = cfg.rail_height_range[1] - difficulty * (cfg.rail_height_range[1] - cfg.rail_height_range[0])
400+
rail_height = cfg.rail_height_range[0] + difficulty * (cfg.rail_height_range[1] - cfg.rail_height_range[0])
401401

402402
# initialize list of meshes
403403
meshes_list = list()

0 commit comments

Comments
 (0)