Skip to content

Commit 787a4e2

Browse files
committed
Merge upstream main into changelog audit
2 parents a685455 + 0efb72d commit 787a4e2

64 files changed

Lines changed: 955 additions & 1024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
- Add CUDA-graph-capturable rebuildable sparse grids to `SolverImplicitMPM` when `max_active_cell_count` is positive, with optional `max_leaf_node_count`, `max_lower_node_count`, and `max_upper_node_count` hierarchy capacities.
1414
- Add opt-in isolated multi-world implicit MPM with capacity-bounded rebuildable sparse grids, selective world resets, outer graph capture, and asynchronous overflow reporting; legacy shared topology remains the default.
1515
- Add contact examples for Newton's cradle, a balance bird, and a domino spiral
16+
- Document geometry-pair contact behavior and clarify that MuJoCo Warp currently produces a single contact for cylinder--box pairs even with MultiCCD enabled.
17+
- Add `ViewerUSD(points_as_spheres=...)` to render `log_points` particles as a `UsdGeom.PointInstancer` of sphere prototypes; enabled by default (opt out with `points_as_spheres=False` for flat `UsdGeom.Points` splats)
18+
- Add list-of-pattern and explicit-index selectors to `ArticulationView`.
19+
- Add `newton[onnx]` for ONNX policy inference through Warp-NN; `ControllerNeuralMLP`, `ControllerNeuralLSTM`, and RL policy examples can run exported `.onnx` policies without requiring PyTorch for ONNX execution.
20+
- Add three VBD contact examples — `vbd_rigid_rigid_contact`, `vbd_soft_rigid_contact`, and `vbd_soft_rigid_mix_contact` — demonstrating rigid-rigid, soft (particle-rigid), and mixed cloth-bag contacts
21+
- Add masked rigid-body reset support to `SolverVBD`. (#3256)
1622
- Add `Mesh.invalidate_cache()` to drop cached derived data (hash, edges, finalized Warp meshes) after in-place modification of `Mesh.vertices` or `Mesh.indices`; reassigning those properties invalidates automatically.
1723
- Add `Heightfield.create_from_mesh()` and `newton.utils.rasterize_mesh_to_heightfield()` to build a heightfield collider by ray-casting a `wp.Mesh`, replacing a large static terrain mesh with an equivalent heightfield.
1824
- Add read-only `Contacts.contact_matching_mode` metadata reporting whether the `CollisionPipeline` that produced or last filled the buffer used `"disabled"`, `"latest"`, or `"sticky"` contact matching.
@@ -77,6 +83,36 @@
7783
- Remove the deprecated `Model.has_heightfields` property (deprecated in 1.3.0); use `Model.heightfield_count`, or `model.heightfield_count > 0` for boolean checks, instead. (#3619)
7884
- Remove the deprecated `SolverNotifyFlags` enum (deprecated in 1.3.0); use `ModelFlags` instead. (#3619)
7985
- Remove the deprecated `ls_parallel` parameter of `SolverMuJoCo` (deprecated in 1.3.0); parallel line search was removed from `mujoco_warp` and the option had no effect. (#3619)
86+
- Deprecate scalar `ModelBuilder.gravity`; pass a three-component gravity vector instead.
87+
- Deprecate local-only `SolverBase.reset()` world masks in favor of masks with shape `(world_count + 1,)`; append a final entry that selects global entities in world `-1`. (#3374)
88+
- Deprecate and ignore `SolverVBD`'s `rigid_contact_stick_motion_eps`, `rigid_contact_stick_freeze_translation_eps`, and `rigid_contact_stick_freeze_angular_eps`; use collision-pipeline sticky matching for persistent geometry. The SolverVBD body deadzone was removed without replacement.
89+
- Deprecate per-DOF `newton:{axis}:limitStiffness` and `newton:{axis}:limitDamping` attributes (where `{axis}` is `linear`, `angular`, `rotX`, `rotY`, or `rotZ`). Use the broadcast `newton:limitStiffness` and `newton:limitDamping` attributes from `NewtonJointAPI` instead; the broadcast value applies uniformly to all DOFs on the joint. For joints requiring per-DOF variance, split into separate 1-DOF (revolute / prismatic) joints.
90+
- Deprecate passing solver constructor options positionally after stable positional inputs such as `model` and explicit solver configs; migrate calls such as `SolverVBD(model, 10)` to `SolverVBD(model, iterations=10)`.
91+
- Deprecate `Model.contacts()` and `Model.collide()` in favor of explicitly creating a `CollisionPipeline`, allocating with `pipeline.contacts()`, and detecting collisions with `pipeline.collide(state, contacts)`.
92+
- Deprecate `ModelBuilder.find_shape_contact_pairs()`; shape contact pairs are generated automatically by `ModelBuilder.finalize()`, so configure collision filters before finalization instead of rebuilding contact pairs manually.
93+
- Deprecate `newton.EqType` in favor of `newton.solvers.SolverMuJoCo.EqType`; migrate equality-constraint type references to the MuJoCo-scoped enum.
94+
- Deprecate `newton.geometry.MATCH_BROKEN` and `newton.geometry.MATCH_NOT_FOUND` without replacement; do not rely on or import these values.
95+
- Deprecate unsorted integer indices for `ArticulationView.include_joints` and `ArticulationView.include_links`, and reject out-of-range indices; sort indices in ascending order and ensure they are within the articulation's joint or link range.
96+
- Deprecate `State.body_q_prev` without replacement because solvers now manage previous body transforms internally; applications that need pose history should clone `State.body_q` explicitly.
97+
- Deprecate passing option-heavy helper API parameters positionally, including `ModelBuilder.ShapeConfig`, `ModelBuilder.JointDofConfig`, `Contacts`, `ArticulationView`, and selected `ModelBuilder` body, joint, shape, rod, cloth, soft-body, and FEM helpers. Keep stable identifiers such as `body`, `parent`/`child`, capacity counts, and topology indices positional; migrate calls such as `add_shape_box(body, xform, hx=...)` to `add_shape_box(body, xform=xform, hx=...)`.
98+
- Deprecate loading TorchScript (`torch.jit.save`) and dict (`torch.save`) neural-network checkpoints in `ControllerNeuralMLP` and `ControllerNeuralLSTM` in favor of pt2 archives saved via `torch.export.save`.
99+
- Deprecate omitting `body_frame_origin` in `ModelBuilder.add_rod()` and `ModelBuilder.add_rod_graph()`; the implicit behavior still uses the existing start-node body-frame convention during the deprecation window, but the implicit default will change to `body_frame_origin="com"` in a future release. Pass `body_frame_origin="start"` to preserve the legacy frame or `body_frame_origin="com"` to opt into the future COM-centered frame.
100+
- Deprecate mutating `Model.shape_collision_filter_pairs`; modify `ModelBuilder.shape_collision_filter_pairs` before calling `finalize()` and rebuild the model instead, because mutating finalized collision filters does not rebuild `Model.shape_contact_pairs`.
101+
- Deprecate reading legacy vendor-namespaced deformable material attributes (`omniphysics:`, `physxDeformableBody:`) off any bound material in `newton.usd.get_tetmesh()`, `newton.TetMesh.create_from_usd()`, and `ModelBuilder.add_usd()`. They are still read during the deprecation window, with a `DeprecationWarning`; a future release will read only canonical `physics:` attributes from a material applying `PhysicsVolumeDeformableMaterialAPI`. Migrate by authoring the canonical attributes, or keep the old behavior without the warning via `compat_namespaces=newton.usd.DEFORMABLE_LEGACY_NAMESPACES` (`get_tetmesh` / `create_from_usd`) or `schema_resolvers=[..., SchemaResolverPhysx()]` (`add_usd`). `compat_namespaces` is now keyword-only; pass `()` to opt into the canonical-only behavior today.
102+
- Deprecate implicit render-config updates in `SensorTiledCamera.utils.create_default_light()` and `SensorTiledCamera.utils.assign_checkerboard_material()`; set `sensor.default_render_config.enable_shadows` or `sensor.default_render_config.enable_textures` explicitly instead.
103+
- Deprecate `SensorTiledCamera(..., config=...)` in favor of `SensorTiledCamera(..., default_render_config=...)`; migrate constructor calls that pass a render config to the new keyword.
104+
- Deprecate `SensorTiledCamera.render_config` in favor of `SensorTiledCamera.default_render_config`; migrate `sensor.render_config.enable_shadows = True` to `sensor.default_render_config.enable_shadows = True`.
105+
- Deprecate `SensorTiledCamera.utils.compute_pinhole_camera_rays()` in favor of `SensorTiledCamera.utils.compute_camera_rays_pinhole()`.
106+
- Deprecate the legacy DOF-shaped `joint_target_q` layout (`newton.use_coord_layout_targets = False`) for models whose joint coordinate and DOF counts differ (free/ball/distance joints); `ModelBuilder.finalize()` now emits a `DeprecationWarning` for such models. Set `newton.use_coord_layout_targets = True` before building models and index targets via `Model.joint_target_q_start`. A future release will make the coordinate layout the only layout and remove the flag.
107+
108+
### Removed
109+
110+
- Remove the deprecated `joint_target_pos` / `joint_target_vel` aliases from `Model`, `Control`, and `ModelBuilder` (deprecated in 1.3.0); use `joint_target_q` / `joint_target_qd` instead. Reading or assigning the removed names raises `AttributeError` naming the replacement, so a stale `control.joint_target_pos = targets` fails loudly instead of being silently ignored. `Actuator` now always defaults `control_target_pos_attr` / `control_target_vel_attr` to the canonical `joint_target_q` / `joint_target_qd` names; passing `None` explicitly selects the same defaults.
111+
- Remove the deprecated SDF compatibility attributes `Model.shape_sdf_index`, `Model.texture_sdf_data`, `Model.texture_sdf_coarse_textures`, `Model.texture_sdf_subgrid_textures`, `Model.texture_sdf_subgrid_start_slots`, `Model.sdf_block_coords`, `Model.sdf_index2blocks`, and `SDF.texture_block_coords` (deprecated in 1.3.0); the hydroelastic broadphase derives block coordinates arithmetically and the remaining storage is internal.
112+
- Remove the deprecated `newton.geometry.build_bvh_shape()`, `refit_bvh_shape()`, `build_bvh_particle()`, and `refit_bvh_particle()` helpers (deprecated in 1.3.0); use `Model.bvh_build_shapes()`, `Model.bvh_refit_shapes()`, `Model.bvh_build_particles()`, and `Model.bvh_refit_particles()` instead.
113+
- Remove the deprecated `Model.has_heightfields` property (deprecated in 1.3.0); use `Model.heightfield_count`, or `model.heightfield_count > 0` for boolean checks, instead.
114+
- Remove the deprecated `SolverNotifyFlags` enum (deprecated in 1.3.0); use `ModelFlags` instead.
115+
- Remove the deprecated `ls_parallel` parameter of `SolverMuJoCo` (deprecated in 1.3.0); parallel line search was removed from `mujoco_warp` and the option had no effect.
80116

81117
### Fixed
82118

@@ -132,6 +168,7 @@
132168
- Fix masked PID state reset to execute on the integral-state device. (#3447)
133169
- Fix `SolverKamino` to preserve resets for bodies whose center of mass is offset from the body frame. (#3605)
134170
- Fix a spurious `SolverKamino` floating-base reset warning. (#3563)
171+
- Fix `eval_inverse_dynamics_passive()` reading past a DOF-sized scratch buffer under `newton.use_coord_layout_targets = True`, producing intermittent NaNs for models with free, ball, or distance joints.
135172
- Fix MJCF imports ignoring `fromto` transforms and lengths on sites.
136173
- Reject invalid hollow primitive shell thickness before computing inertia.
137174
- Fix convex decomposition of disconnected mesh components so unified multi-part collision meshes preserve separate convex parts. (#3261)

docs/concepts/collisions.rst

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,205 @@ Examples:
143143
See :ref:`Solver Integration` for the full code pattern showing how to configure
144144
this.
145145

146+
.. _Geometry Pair Contact Behavior:
147+
148+
Geometry-Pair Contact Behavior
149+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150+
151+
The two tables below describe contacts generated by Newton's
152+
:class:`~CollisionPipeline` only; they do not apply to contacts generated by the
153+
native MuJoCo CPU or MuJoCo Warp collision pipelines. The values are theoretical
154+
upper bounds per shape pair and collision pass before the shared
155+
``rigid_contact_max`` capacity is applied. Actual counts vary with pose, margin,
156+
and collision settings.
157+
158+
**CollisionPipeline primitive and convex-hull pairs**
159+
160+
.. list-table::
161+
:header-rows: 1
162+
:stub-columns: 1
163+
:widths: 18 9 9 10 11 11 8 9 13
164+
165+
* - Shape A / Shape B
166+
- Plane
167+
- Sphere
168+
- Capsule
169+
- Ellipsoid
170+
- Cylinder
171+
- Box
172+
- Cone
173+
- Convex hull
174+
* - Plane
175+
- 5
176+
- 1
177+
- 2
178+
- 1
179+
- 4
180+
- 4
181+
- 5
182+
- 5
183+
* - Sphere
184+
- 1
185+
- 1
186+
- 1
187+
- 1
188+
- 1
189+
- 1
190+
- 1
191+
- 1
192+
* - Capsule
193+
- 2
194+
- 1
195+
- 2
196+
- 1
197+
- 5
198+
- 5
199+
- 5
200+
- 5
201+
* - Ellipsoid
202+
- 1
203+
- 1
204+
- 1
205+
- 1
206+
- 1
207+
- 1
208+
- 1
209+
- 1
210+
* - Cylinder
211+
- 4
212+
- 1
213+
- 5
214+
- 1
215+
- 5
216+
- 5
217+
- 5
218+
- 5
219+
* - Box
220+
- 4
221+
- 1
222+
- 5
223+
- 1
224+
- 5
225+
- 5
226+
- 5
227+
- 5
228+
* - Cone
229+
- 5
230+
- 1
231+
- 5
232+
- 1
233+
- 5
234+
- 5
235+
- 5
236+
- 5
237+
* - Convex hull
238+
- 5
239+
- 1
240+
- 5
241+
- 1
242+
- 5
243+
- 5
244+
- 5
245+
- 5
246+
247+
The plane--plane upper bound is five when at least one plane is finite. Two
248+
infinite planes produce no contacts.
249+
250+
**CollisionPipeline mesh, heightfield, and SDF routes**
251+
252+
``V`` is a mesh vertex count, ``T_overlap`` is the number of overlapping
253+
triangles, and ``E`` is the number of collision edges. The estimated typical
254+
count is the sizing heuristic used for allocation, not a measured statistical
255+
average or a per-pair limit.
256+
257+
.. list-table::
258+
:header-rows: 1
259+
:widths: 27 18 23 12 20
260+
261+
* - Pair or route
262+
- Reduced maximum (default)
263+
- Unreduced maximum
264+
- Estimated typical count
265+
- Notes
266+
* - Triangle mesh--infinite plane
267+
- 240
268+
- ``V_mesh``
269+
- About 40
270+
- At most one candidate per mesh vertex.
271+
* - Mesh/heightfield--sphere or ellipsoid
272+
- 240
273+
- ``T_overlap``
274+
- About 40
275+
- At most one contact per overlapping triangle.
276+
* - Mesh/heightfield--other primitive or convex hull
277+
- 240
278+
- ``5 * T_overlap``
279+
- About 40
280+
- Each overlapping triangle uses the convex manifold path.
281+
* - Mesh--mesh
282+
- 240
283+
- ``E_A + E_B``
284+
- About 40
285+
- Uses edge-vs-SDF queries, with BVH distance fallback when needed.
286+
* - Heightfield--mesh
287+
- 240
288+
- ``E_heightfield + E_mesh``
289+
- About 40
290+
- Uses the mesh/SDF route with on-the-fly heightfield evaluation.
291+
* - Hydroelastic SDF--SDF
292+
- 240 by default
293+
- Geometry and buffer dependent
294+
- No fixed estimate
295+
- ``anchor_contact=True`` can add contacts beyond the reduced set.
296+
297+
The reduced maximum follows the current 240-slot contact-reduction layout.
298+
Disabling reduction exposes the geometry-dependent candidate bounds shown above.
299+
300+
**Common pair guidance**
301+
302+
.. list-table::
303+
:header-rows: 1
304+
:widths: 16 23 31 30
305+
306+
* - Pair
307+
- Expected behavior
308+
- Backend notes
309+
- Asset guidance
310+
* - Sphere--plane or sphere--box
311+
- A point contact.
312+
- Newton, MuJoCo Warp, and MuJoCo CPU use single-contact primitive paths.
313+
- Use one sphere unless the asset needs a finite support patch; then use
314+
multiple collision shapes or a surface-contact representation.
315+
* - Capsule--plane or capsule--box
316+
- End-on contact is point-like; side-on contact can span the capsule axis.
317+
- Newton and both MuJoCo backends have multi-contact paths for the
318+
line-like side contact.
319+
- A single capsule is normally sufficient. Use a compound only when the
320+
physical profile is not capsule-shaped.
321+
* - Box--plane or box--box
322+
- Face contact forms an area-supporting manifold; edge and corner contacts
323+
use fewer points.
324+
- Newton and both MuJoCo backends generate multi-point face contacts.
325+
- Prefer a single box for box-like parts; it is cheaper and usually more
326+
stable than a tessellated mesh.
327+
* - Cylinder--box
328+
- A cylinder lying across a broad box face should have a manifold spanning
329+
its support region.
330+
- Newton generates a convex manifold. MuJoCo CPU can generate a multi-point
331+
manifold with multi-CCD enabled. MuJoCo Warp currently emits one contact
332+
for this pair even with ``enable_multiccd=True``; contact location can
333+
alternate between the cylinder ends. This is a known discrepancy tracked
334+
in `mujoco_warp#1555
335+
<https://github.com/google-deepmind/mujoco_warp/issues/1555>`__.
336+
- Keep a single cylinder with Newton contacts. While the MuJoCo Warp issue
337+
is open, use ``use_mujoco_contacts=False`` or, if that is not possible,
338+
approximate load-bearing regions with multiple collision shapes.
339+
340+
The MuJoCo Warp cylinder--box behavior above is a known discrepancy, not the intended
341+
single-contact behavior of the geometry pair. For non-convex assets, use a
342+
convex compound or Newton's mesh/SDF paths rather than expecting one primitive
343+
to reproduce the surface. See :ref:`Mesh Collisions` and :ref:`Simulation Tuning`.
344+
146345
.. _Collision Pipeline:
147346

148347
Collision Pipeline

0 commit comments

Comments
 (0)