Trail - #6539
Conversation
Greptile SummaryThis PR introduces a modular mountain-bike trail terrain generator for Isaac Lab, producing parameterizable terrain patches (start platform → trail with skill elements → end platform) as trimesh meshes with semantic vertex coloring and curriculum-aware difficulty scaling.
Confidence Score: 3/5Not safe to merge as-is: incorrect vertex colors on all decorated objects, potential out-of-bounds decoration placement, and a broken N-pass accumulation in a terrain deformation function. Three independent logic bugs affect the generated terrain output. The no-op HSV modifications silently produce wrong colors on every decorated object. The boundary check in add_decoration is logically inverted on the x-axis, so decorations can be placed outside the patch. The delta_z_sin_xy accumulation bug means any configuration with N > 1 computes the wrong deformation. All are straightforward one-line fixes. decoration_functions.py (HSV no-ops and annotation), trail_terrains.py (boundary guard in add_decoration), terrain_functions.py (delta_z_sin_xy accumulation). Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[mesh_trail_segment] --> B[Interpolate curriculum params]
B --> C{Object loop}
C -->|fits on trail| D[object_function]
D --> E[sweep_polygon]
E --> F[Apply transform + color]
F --> C
C -->|no more room| G[trail_profile polygon]
G --> H[down_sample_to_enforce_min_res]
H --> I[Compute trail_roll]
I --> J[Apply roll to objects]
J --> K[sweep_polygon trail along full path]
K --> L{extrude_trail_objects?}
L -->|yes| M[Ray-cast objects into trail mesh]
L -->|no| N[Merge object meshes]
M --> O[color_mesh]
N --> O
O --> P[process_floor]
P --> Q[add_platforms P0 + P1]
Q --> R[Apply terrain_functions]
R --> S[add_decoration]
S --> T{ride_direction}
T -->|uphill| U[origin = P0]
T -->|downhill| V[Flip mesh, origin = P1]
U --> W[Translate to world frame]
V --> W
W --> X[Return mesh + origin]
Reviews (1): Last reviewed commit: "improve readme" | Re-trigger Greptile |
ac8b115 to
856c0f6
Compare
7fe7120 to
a070b40
Compare
|
|
||
| --- | ||
|
|
||
| ## Trail Library (Detailed) |
There was a problem hiding this comment.
could we put the details in its own doc page under https://isaac-sim.github.io/IsaacLab/develop/source/experimental-features/bleeding-edge.html
There was a problem hiding this comment.
I have added a trail.rst file with the same infomration as the current readme. I have also enriched the documentation with 4 fpeg images. I have added the compiled dock below for a quick visual check.
Regarding the README file: Do you recommend to completely remove the changes there, or support both readme and web doc as currently the case?
|
|
||
| # Copyright (c) 2024-2026 Robotics and AI Institute LLC dba RAI Institute. All rights reserved. | ||
|
|
||
| """Example configuration for custom trail terrains.""" |
There was a problem hiding this comment.
maybe this could become a demo script?
| "protobuf>=4.25.8,!=5.26.0", | ||
| "hidapi>=0.14.0", | ||
| "gymnasium>=1.2.0", | ||
| "shapely", |
There was a problem hiding this comment.
could you add license files for these under https://github.com/isaac-sim/IsaacLab/tree/develop/docs/licenses/dependencies?
There was a problem hiding this comment.
the shapely packages seems to be already installed, hence I have removed it. I have now added the manifold3d package to pyproject.toml, which was missing. The license for this package appears to be already present within the linked directory.
| Changelog | ||
| --------- | ||
|
|
||
| [Unreleased] |
There was a problem hiding this comment.
we've updated our dev workflow to add changelog fragments now instead of modifying the changelog file directly to avoid conflicts between PRs
There was a problem hiding this comment.
I have added two rst files, both names fjenelten-feature-trail_library_migration.rst, one placed in isaaclab_tasks/changelog.d and the other in isaaclab_contrib/changelog.d.
8b394f7 to
16e7b0e
Compare
65c86a5 to
4556cc3
Compare
4556cc3 to
0e4f4dc
Compare
520a5a6 to
332b753
Compare
332b753 to
67ac518
Compare
88dcd06 to
a700a61
Compare
a700a61 to
8834105
Compare
|
@kellyguo11 Thanks a lot for the review! Addressing your feedback led to the following updates: Changes made:
To verify everything works, I have done the following:
|

Description
This PR adds a modular framework for generating parameterizable mountain-bike trails. Each terrain patch comprises four components: a starting platform, a final platform, a connecting trail segment, and distinct skill elements. The resulting terrain is represented as a single mesh using the trimesh library, which models geometry as triangles and stores visual information within the RGB channels.
A trail segment is generated by first defining a cross-section polygon with counter-clockwise ordered vertices. This polygon is then swept along a sweeping path, a sequence of knot-points (x, y, z and yaw) connecting the two platforms. To form a simple ground floor around the trail, the vertices on the left and right borders are expanded outward. Each trail segment may contain one or more skill elements of a unique type, such as ramps, skinnies, roots, rocks, or waves. Each element is parameterized by a uniform distribution over its dimensions.
The generated terrains can easily be embedded into the existing Terrain Generator. The parameterization of the skill elements scales linearly (other maps may be defined) with the terrain level, allowing to employ a classical terrain curriculum.
The terrain mesh is systematically randomized by overlaying the vertices with a sequence of geometric disturbances. Additionally, decorative elements such as trees, roots, or stones can be procedurally placed adjacent to the trail. These perturbations break predictable structural patterns, preventing overfitting to specific procedural patterns.
Semantic information is explicitly stored in the vertex colors. The exact RGB values can be chosen arbitrarily, provided the mapping from RGB to semantic label remains bijective.
As training environment we have generate more than 1000 unique terrain patches and trained behaviors on a single NVIDIA L4 GPU.
This PR is part of an upcoming publication from the Robotics and AI (RAI) institute.
Type of change
Screenshots
trail_library_short.mp4
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there