Skip to content

Curriculum-Showcase: Genesis NaN constraint after teleport-on-terrain #33

Description

@KraHsu

Symptom

`uv run genelab play GeneLab-Curriculum-Showcase-v0 --vis --steps 500` crashes mid-run with:

```
genesis.GenesisException: Invalid constraint forces causing 'nan'. Please decrease Rigid simulation timestep.
```

Full traceback (relevant frames):

```
File ".../genelab_showcase/runner.py", line 100, in play
env.step(action)
File ".../src/genelab/envs/manager_based_rl_env.py", line 267, in step
self._scene.step()
File ".../src/genelab/scene/interactive_scene.py", line 218, in step
self._gs_scene.step()
File ".../genesis/engine/solvers/rigid/rigid_solver.py", line 1030, in check_errno
gs.raise_exception("Invalid constraint forces causing 'nan'. ...")
```

Likely cause

The curriculum runner teleports 8 of 16 G1 envs 6.0 m forward of spawn every 30 control steps to trip the `walked > distance_threshold` branch. The instant teleport drops the robot onto a fresh `RandomRough` sub-terrain at `vis_dt = 0.01` with `substeps=1` (per `curriculum/env_cfg.py`); the rigid solver runs into degenerate constraints on the first post-teleport contact and produces NaN.

Confirmed working

The other five showcase tasks run `exit=0` to completion with the same Genesis build:

Task Status
Sensors / RayCast / Contact / Terrain / Actuator ✅ pass
Curriculum ❌ NaN constraint mid-run

Suggested investigation

  1. Drop `dt` to 0.005 or set `substeps=2` in `examples/genelab_showcase/src/genelab_showcase/curriculum/env_cfg.py`.
  2. Soft-teleport (multi-step relocate instead of single-frame jump), or set velocity to zero before the teleport.
  3. Check whether `articulation.write_root_state` is being called before or after the contact-pair refresh — a stale contact set at the new pose could explain the NaN.

Repro

```bash
git checkout feat/showcase-and-foundation-docs # or any branch with the showcase package
uv pip install -e examples/genelab_showcase
uv run genelab play GeneLab-Curriculum-Showcase-v0 --vis --steps 500
```

Surfaced while smoke-testing PR #29's human verification checklist.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions