Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c62f718
Add show collision mesh toggle to Newton viewer
vidurv-nvidia Apr 3, 2026
d232e02
Update source/isaaclab_visualizers/isaaclab_visualizers/newton/newton…
vidurv-nvidia Apr 3, 2026
0d0d99a
Update source/isaaclab_visualizers/isaaclab_visualizers/newton/newton…
vidurv-nvidia Apr 3, 2026
9e6d2ff
Update newton_visualizer_cfg.py
vidurv-nvidia Apr 3, 2026
2ec08d9
Remove duplicate variable definitions in NewtonVisualizerCfg
vidurv-nvidia Apr 3, 2026
82e14f9
Add show inertia boxes toggle to Newton viewer
vidurv-nvidia Apr 3, 2026
803da43
Add SDF and Hydroelastic collisions in ISaacLab
vidurv-nvidia Apr 2, 2026
c195a2a
Integrate Octi's changes to the collision pipline creation from https…
vidurv-nvidia Apr 2, 2026
2331815
Add unit tests for SDF and Hydroelastic configuration
vidurv-nvidia Apr 2, 2026
9a2b417
Update source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py
vidurv-nvidia Apr 3, 2026
b8afb8b
Move the import to the top level
vidurv-nvidia Apr 3, 2026
114c25a
Make config variable access consistent
vidurv-nvidia Apr 3, 2026
9aaeff8
Update body and shape pattern matching
vidurv-nvidia Apr 3, 2026
e48fbf6
Apply SDF mesh conversion before the enviorment is replicated
vidurv-nvidia Apr 3, 2026
a0ac249
Raise TypeError for invalid collision_cfg instead of silent fallback
vidurv-nvidia Apr 3, 2026
91cf1b9
Guard against None PhysicsManager._cfg in _apply_sdf_config
vidurv-nvidia Apr 3, 2026
b7c2c76
Fix lint and formatting issues from pre-commit
vidurv-nvidia Apr 3, 2026
bd1189d
Merge branch 'vidur/feature/newton-viewer-collision' into vidur/featu…
vidurv-nvidia Apr 7, 2026
9b112c7
Add show visual geometries toggle to Newton viewer
vidurv-nvidia Apr 7, 2026
3fca0dc
Fix SDF config bugs: skip redundant rebuilds, respect hydro patterns,…
vidurv-nvidia Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/isaaclab_newton/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.5.9"
version = "0.5.10"

# Description
title = "Newton simulation interfaces for IsaacLab core package"
Expand Down
19 changes: 19 additions & 0 deletions source/isaaclab_newton/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
Changelog
---------

0.5.10 (2026-04-02)
~~~~~~~~~~~~~~~~~~~

Added
^^^^^

* Added :class:`~isaaclab_newton.physics.NewtonCollisionPipelineCfg` for configuring
Newton's collision pipeline parameters (broad phase, contact limits, triangle pairs).
Set via :attr:`~isaaclab_newton.physics.NewtonCfg.collision_cfg`.
* Added :class:`~isaaclab_newton.physics.SDFCfg` for configuring SDF-based mesh
collisions via Newton's ``mesh.build_sdf()`` API. Supports per-body and per-shape
regex pattern matching, per-pattern resolution overrides, and optional creation of
collision shapes from visual meshes.
* Added :class:`~isaaclab_newton.physics.HydroelasticCfg` for distributed surface
contacts computed via SDF overlap with marching cubes.
* Added SDF pattern skip in the Newton cloner to preserve original triangle
meshes for shapes that will use SDF collision.


0.5.9 (2026-03-16)
~~~~~~~~~~~~~~~~~~

Expand Down
43 changes: 41 additions & 2 deletions source/isaaclab_newton/isaaclab_newton/cloner/newton_replicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@

from __future__ import annotations

import re
from collections.abc import Callable

import torch
import warp as wp
from newton import ModelBuilder, solvers
from newton import GeoType, ModelBuilder, solvers
from newton._src.usd.schemas import SchemaResolverNewton, SchemaResolverPhysx

from pxr import Usd, UsdGeom

from isaaclab.physics import PhysicsManager
from isaaclab.physics.scene_data_requirements import VisualizerPrebuiltArtifacts

from isaaclab_newton.physics import NewtonManager
Expand Down Expand Up @@ -62,6 +64,17 @@ def _build_newton_builder_from_mapping(
# The prototype is built from env_0 in absolute world coordinates.
# add_builder xforms are deltas from env_0 so positions don't get double-counted.
env0_pos = positions[0]

# SDF collision requires original triangle meshes for mesh.build_sdf().
# Convex hull approximation destroys the source geometry, so shapes
# matching SDF patterns must be excluded from approximation here.
# _apply_sdf_config() builds the SDF on each prototype after approximation.
cfg = PhysicsManager._cfg
sdf_cfg = getattr(cfg, "sdf_cfg", None) if cfg is not None else None
body_pats = [re.compile(x) for x in sdf_cfg.body_patterns] if sdf_cfg and sdf_cfg.body_patterns else None
shape_pats = [re.compile(x) for x in sdf_cfg.shape_patterns] if sdf_cfg and sdf_cfg.shape_patterns else None
has_sdf_patterns = body_pats is not None or shape_pats is not None

protos: dict[str, ModelBuilder] = {}
for src_path in sources:
p = ModelBuilder(up_axis=up_axis)
Expand All @@ -74,7 +87,33 @@ def _build_newton_builder_from_mapping(
schema_resolvers=schema_resolvers,
)
if simplify_meshes:
p.approximate_meshes("convex_hull", keep_visual_shapes=True)
if has_sdf_patterns:
sdf_bodies: set[int] = set()
if body_pats is not None:
for bi in range(len(p.body_label)):
if any(pat.search(p.body_label[bi]) for pat in body_pats):
sdf_bodies.add(bi)

approx_indices = []
for i in range(len(p.shape_type)):
if p.shape_type[i] != GeoType.MESH:
continue
# Skip shapes that will use SDF (matched by body or shape pattern)
if p.shape_body[i] in sdf_bodies:
continue
if shape_pats is not None:
lbl = p.shape_label[i] if i < len(p.shape_label) else ""
if any(pat.search(lbl) for pat in shape_pats):
continue
approx_indices.append(i)
if approx_indices:
p.approximate_meshes("convex_hull", shape_indices=approx_indices, keep_visual_shapes=True)
else:
p.approximate_meshes("convex_hull", keep_visual_shapes=True)
# Build SDF on prototype before add_builder copies it N times.
# Mesh objects are shared by reference, so SDF is built once and
# all environments inherit it.
NewtonManager._apply_sdf_config(p)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 _apply_sdf_config crashes when PhysicsManager._cfg is None

_apply_sdf_config(p) is called unconditionally for every prototype here, but inside _apply_sdf_config, the first two lines are:

cfg = PhysicsManager._cfg
sdf_cfg = cfg.sdf_cfg   # AttributeError if cfg is None

There is no None guard on cfg. Meanwhile, the code added just above in this same function (lines 77–78) explicitly guards against cfg being None:

cfg = PhysicsManager._cfg
sdf_cfg = getattr(cfg, "sdf_cfg", None) if cfg is not None else None

This inconsistency means: in the exact scenario the replicate code considers valid (where PhysicsManager._cfg is None), calling _apply_sdf_config(p) unconditionally will raise AttributeError: 'NoneType' object has no attribute 'sdf_cfg'.

The simplest fix is to add the same guard inside _apply_sdf_config:

@classmethod
def _apply_sdf_config(cls, builder: ModelBuilder):
    """Apply SDF collision and optional hydroelastic flags to matching mesh shapes."""
    from newton import GeoType, ShapeFlags

    cfg = PhysicsManager._cfg
    if cfg is None:
        return
    sdf_cfg = cfg.sdf_cfg
    if sdf_cfg is None:
        return
    ...

protos[src_path] = p

# create a separate world for each environment (heterogeneous spawning)
Expand Down
14 changes: 13 additions & 1 deletion source/isaaclab_newton/isaaclab_newton/physics/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@

__all__ = [
"FeatherstoneSolverCfg",
"HydroelasticCfg",
"MJWarpSolverCfg",
"NewtonCfg",
"NewtonCollisionPipelineCfg",
"NewtonManager",
"NewtonSolverCfg",
"SDFCfg",
"XPBDSolverCfg",
]

from .newton_manager import NewtonManager
from .newton_manager_cfg import FeatherstoneSolverCfg, MJWarpSolverCfg, NewtonCfg, NewtonSolverCfg, XPBDSolverCfg
from .newton_manager_cfg import (
FeatherstoneSolverCfg,
HydroelasticCfg,
MJWarpSolverCfg,
NewtonCfg,
NewtonCollisionPipelineCfg,
NewtonSolverCfg,
SDFCfg,
XPBDSolverCfg,
)
Loading