Skip to content

fix(isaacgym): default projectiles=1 + match hidden-projectile layout…#223

Open
jyf588 wants to merge 1 commit into
mainfrom
fix/issue-222-isaacgym-projectile-patch-budget
Open

fix(isaacgym): default projectiles=1 + match hidden-projectile layout…#223
jyf588 wants to merge 1 commit into
mainfrom
fix/issue-222-isaacgym-projectile-patch-budget

Conversation

@jyf588

@jyf588 jyf588 commented May 19, 2026

Copy link
Copy Markdown
Collaborator

… across backends

Fixes #222.

  • Add ProjectileConfig.hide_spacing (4 m default) + hidden_z_for_index() helper so hidden cubes get unique z slots; use it at both spawn time (all 4 backends) and runtime hide paths (_update_projectiles / _hide_projectiles_for_envs).
  • IsaacGym: override SimulatorConfig.projectile default_factory to ProjectileConfig(num_projectiles=1). Each cube is a full dynamic rigid body that allocates PhysX contact patches against the wildcard-collidable add_triangle_mesh terrain; at 4096 envs × 5 cubes this exceeded the ~80k maxRigidPatchCount budget (not configurable from gymapi.PhysXParams). Other backends keep the 5-cube default. Override via --overrides simulator.projectile.num_projectiles=N to opt back into more cubes.
  • IsaacGym / IsaacLab / Newton: in _set_projectile_root_states, rewrite hidden cubes' X/Y by env_id (z <= hide_z is the hidden marker, throws skip this) so post-init projectile layout is consistent across backends.
  • base_simulator._throw_projectile: early-return when num_projectiles==0 so backends that opt out can't crash on the J key.

… across backends

Fixes #222.

- Add ProjectileConfig.hide_spacing (4 m default) + hidden_z_for_index()
  helper so hidden cubes get unique z slots; use it at both spawn time
  (all 4 backends) and runtime hide paths (_update_projectiles /
  _hide_projectiles_for_envs).
- IsaacGym: override SimulatorConfig.projectile default_factory to
  ProjectileConfig(num_projectiles=1). Each cube is a full dynamic
  rigid body that allocates PhysX contact patches against the
  wildcard-collidable add_triangle_mesh terrain; at 4096 envs × 5 cubes
  this exceeded the ~80k maxRigidPatchCount budget (not configurable
  from gymapi.PhysXParams). Other backends keep the 5-cube default.
  Override via --overrides simulator.projectile.num_projectiles=N to
  opt back into more cubes.
- IsaacGym / IsaacLab / Newton: in _set_projectile_root_states, rewrite
  hidden cubes' X/Y by env_id (z <= hide_z is the hidden marker, throws
  skip this) so post-init projectile layout is consistent across backends.
- base_simulator._throw_projectile: early-return when num_projectiles==0
  so backends that opt out can't crash on the J key.

Signed-off-by: protomotions <protomotions.nvidia@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IsaacGym crashes with 2048 parallel environments on H800 when training h1_2 mimic task

2 participants