Unverified Commit 23e935c3 authored by Kyle Morgenstein's avatar Kyle Morgenstein Committed by GitHub

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: 's avatarKyle Morgenstein <34984693+KyleM73@users.noreply.github.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
parent a2540cd6
......@@ -397,7 +397,7 @@ def rails_terrain(
A tuple containing the tri-mesh of the terrain and the origin of the terrain (in m).
"""
# resolve the terrain configuration
rail_height = cfg.rail_height_range[1] - difficulty * (cfg.rail_height_range[1] - cfg.rail_height_range[0])
rail_height = cfg.rail_height_range[0] + difficulty * (cfg.rail_height_range[1] - cfg.rail_height_range[0])
# initialize list of meshes
meshes_list = list()
......
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