API Refactor v2#1749
Conversation
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughRenamed ActuatorMode → JointTargetMode; moved/remapped remesh_mesh to Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(200,200,255,0.5)
participant Viewer as Viewer / Test
end
rect rgba(200,255,200,0.5)
participant CP as CollisionPipeline
end
rect rgba(255,200,200,0.5)
participant SDF as HydroelasticSDF
end
Viewer->>CP: request hydroelastic surface (formerly CP.get_hydro_contact_surface)
CP->>SDF: call hydroelastic_sdf.get_contact_surface()
alt hydroelastic_sdf is None
SDF-->>CP: None
CP-->>Viewer: None
else surface present
SDF-->>CP: ContactSurfaceData
CP-->>Viewer: ContactSurfaceData
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
newton/_src/sim/builder.py (1)
3099-3108:⚠️ Potential issue | 🟠 MajorEFFORT mode cannot be inferred with the current
has_driveheuristic.
has_driveis derived only from non‑zero gains, soJointTargetMode.from_gainscan never returnEFFORTwhen gains are zero. That contradicts the URDF/USD docstrings describing direct torque control with zero gains and can silently treat driven joints asNONE. Consider threading an explicit “drive present” flag (e.g., from importers/builders) or otherwise detecting drive presence and passing it through; otherwise clarify the docs thatEFFORTrequires explicitactuator_mode.🛠️ Possible direction (requires adding a drive flag to JointDofConfig)
- has_drive = dim.target_ke != 0.0 or dim.target_kd != 0.0 - mode = int(JointTargetMode.from_gains(dim.target_ke, dim.target_kd, has_drive=has_drive)) + has_drive = dim.target_ke != 0.0 or dim.target_kd != 0.0 + if getattr(dim, "has_drive", None) is not None: + has_drive = dim.has_drive + mode = int(JointTargetMode.from_gains(dim.target_ke, dim.target_kd, has_drive=has_drive))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/sim/builder.py` around lines 3099 - 3108, The current inference uses a gains-based heuristic so EFFORT can never be chosen when gains are zero; add and use an explicit drive-presence flag instead of inferring from gains: add a drive_present (or has_drive) boolean to the joint config (the dim/JointDofConfig object) and have this builder use dim.drive_present when calling JointTargetMode.from_gains (replace the local has_drive heuristic), and ensure importers/builders set that flag appropriately (or fall back to requiring explicit dim.actuator_mode if the flag is unavailable).newton/examples/robot/example_robot_policy.py (1)
40-46:⚠️ Potential issue | 🟠 MajorAvoid importing internal modules in examples.
Line 43 still reaches into
newton._src.*, which is disallowed fornewton/examplesuser code. Please route this toggle through a public API (e.g., expose a viewer-level flag and import fromnewton.vieweror similar) and update the example to use that instead.As per coding guidelines, "newton/examples/**/*.py: User code and examples under newton/examples/ must not import from newton._src".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/examples/robot/example_robot_policy.py` around lines 40 - 46, The example imports an internal module newton._src.viewer.gl.opengl; instead, add a public toggle in the viewer API (e.g., expose a function or flag like disable_cuda_opengl_interop or set_disable_cuda_opengl_interop in newton.viewer) and update example_robot_policy.py to import that public symbol from newton.viewer rather than newton._src.*; modify the viewer package (newton.viewer.__init__ or the viewer initialization code) to map the new public function/flag to the existing internal logic that currently lives in newton._src.viewer.gl.opengl so existing behavior is reused without exposing internal modules.
🧹 Nitpick comments (3)
docs/api/newton_geometry.rst (1)
54-56: Consider removing or rephrasing the_from_modelreference in user-facing docs.The Note on lines 54–56 directs users to
_from_model(a private classmethod, indicated by the leading underscore). Exposing private API paths in user-facing documentation can mislead users into depending on internals. If this is the intended construction path, consider making it public (e.g.,from_model) or removing the note and pointing users to theCollisionPipelinefactory instead.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api/newton_geometry.rst` around lines 54 - 56, The docs reference the private classmethod `_from_model` in user-facing text; update the documentation to avoid exposing internals by either (a) renaming/making the constructor public (e.g., `from_model`) and updating the docs to reference `from_model`, or (b) removing the `_from_model` mention and instead pointing users to the public factory `CollisionPipeline` (or other public API) for constructing the object; modify the text that currently mentions `_from_model` to reference the chosen public API (`from_model` or `CollisionPipeline`) and ensure the docstring and examples align with that public constructor.newton/tests/test_implicit_mpm.py (1)
62-66: Nit: consider renaming local variableoptions→configfor consistency with the new class name.The variable was originally named
optionsto matchSolverImplicitMPM.Options(); now that it holds aConfiginstance,configwould be more consistent.♻️ Suggested rename (both sites)
- options = SolverImplicitMPM.Config() - options.grid_type = "dense" - options.voxel_size = voxel_size - - solver = SolverImplicitMPM(model, options) + config = SolverImplicitMPM.Config() + config.grid_type = "dense" + config.voxel_size = voxel_size + + solver = SolverImplicitMPM(model, config)Also applies to: 165-170
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_implicit_mpm.py` around lines 62 - 66, Rename the local variable options to config where you call SolverImplicitMPM.Config() and where you pass it into SolverImplicitMPM(model, ...); specifically change the assignment options = SolverImplicitMPM.Config() and subsequent options.voxel_size / options.grid_type accesses to config = SolverImplicitMPM.Config() and config.voxel_size / config.grid_type, and update solver = SolverImplicitMPM(model, options) to solver = SolverImplicitMPM(model, config); apply the same rename at the other occurrence that sets up a Config and constructs SolverImplicitMPM so the variable name matches the new class name.newton/_src/solvers/implicit_mpm/solver_implicit_mpm.py (1)
1197-1198:voxel_sizedocstring is missing SI unit annotation[m].Per coding guidelines for
newton/**/*.py, physical quantities must include inline[unit]notation.♻️ Suggested fix
- voxel_size: float = 0.1 - """Size of the grid voxels.""" + voxel_size: float = 0.1 + """Size of the grid voxels [m]."""Based on learnings (newton-physics/newton PR
#1510), avoid a broad docstring sweep in this functional PR and instead track remaining unit annotations in a follow-up issue.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/solvers/implicit_mpm/solver_implicit_mpm.py` around lines 1197 - 1198, The docstring for the physical quantity voxel_size is missing its SI unit; update the inline docstring for the variable/parameter named voxel_size in solver_implicit_mpm.py to include the unit annotation “[m]” (e.g., change "Size of the grid voxels." to include "[m]" so it reads like "Size of the grid voxels [m].") to comply with newton/**/*.py unit notation guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@newton/_src/sim/builder.py`:
- Around line 1789-1794: The docstring for the force_position_velocity_actuation
parameter omits SI units for stiffness and damping; update the text where gains
are described (see force_position_velocity_actuation and
JointTargetMode.from_gains references) to include inline SI units and wording
for angular quantities—e.g., change "stiffness" to "stiffness (torque per
radian) [N·m]" and "damping" to "damping (torque per radian per second) [N·m·s]"
(treat radians as dimensionless and prefer the phrase "torque per radian" per
repo convention); apply the same unit additions to the similar block referenced
around the USD section (the other JointTargetMode/gains docstring).
In `@newton/_src/solvers/implicit_mpm/solver_implicit_mpm.py`:
- Around line 1191-1192: The Config field warmstart_mode is never applied; add
self.warmstart_mode = config.warmstart_mode in the solver __init__ and wire that
attribute into the warm-start logic: have _warmstart_fields and _solve_rheology
inspect self.warmstart_mode and implement the three behaviors ("none" => skip
all warm-starting, "particles" => only warm-start particle state, "grid" => only
warm-start grid state; keep "auto" as the current heuristic or default
behavior). Validate/normalize values (e.g. accept lowercase) and ensure any
early returns or branches explicitly respect "none" so a user setting disables
warm-starting as promised.
In `@newton/_src/solvers/mujoco/solver_mujoco.py`:
- Around line 166-170: Update the docstring lines referencing joint_target_ke
and joint_target_kd to include inline SI unit annotations: after each occurrence
of joint_target_ke add “[N/m or N·m/rad, depending on joint type]” and after
each occurrence of joint_target_kd add “[N·s/m or N·m·s/rad, depending on joint
type]”; ensure this applies to the POSITION and VELOCITY bullet descriptions and
the reference to JointTargetMode.POSITION_VELOCITY and Control so the docstring
clearly states units for stiffness (joint_target_ke) and damping
(joint_target_kd); if you prefer not to change docstrings in this PR, create a
follow-up issue to add Google-style docstrings with SI units for functions in
solver_mujoco.py.
In `@newton/_src/usd/utils.py`:
- Around line 334-335: The branch unconditionally assumes a Gf.Quat-like object
when warp_dtype is wp.quat causing AttributeError; update the condition so the
Gf.Quat path only runs if warp_dtype is wp.quat AND the input actually has
v.real and v.imaginary (e.g., change the OR to an AND check around hasattr(v,
"real") and hasattr(v, "imaginary") for the wp.quat branch in value_to_warp),
and add fallback conversions for other quaternion-compatible inputs: if
warp_dtype is wp.quat and v is a tuple/list of 4 elements or already a wp.quat,
construct wp.quat from (x,y,z,w) (handling order) and normalize, and if v is a
scalar or unsupported type raise a clear error; ensure references to warp_dtype,
wp.quat, v.real, v.imaginary, and value_to_warp are used so reviewers can find
and verify the change.
In `@newton/_src/utils/import_urdf.py`:
- Around line 172-177: The docstring for force_position_velocity_actuation
misstates behavior: code currently always selects JointTargetMode.POSITION (or
POSITION_VELOCITY when force_position_velocity_actuation is True) instead of
using JointTargetMode.from_gains to infer per-joint modes; either update the
docstring to reflect the actual behavior or change the implementation to call
JointTargetMode.from_gains per joint when force_position_velocity_actuation is
False. Specifically, locate the logic that sets the actuator_mode (referenced by
force_position_velocity_actuation and JointTargetMode.POSITION /
JointTargetMode.POSITION_VELOCITY) and replace the unconditional POSITION
selection with a call to JointTargetMode.from_gains(stiffness, damping,
drive_present) to infer modes, or alter the docstring to state that modes
default to POSITION unless force_position_velocity_actuation triggers
POSITION_VELOCITY.
In `@newton/examples/robot/example_robot_panda_hydro.py`:
- Line 289: The comments are misleading because
HydroelasticSDF.set_output_contact_surface() is a documented no-op; update the
comments near the references to this method to state that writing is governed by
the config flag output_contact_surface (when True) and that display toggling is
controlled by the viewer flag viewer.show_hydro_contact_surface, not by
HydroelasticSDF.set_output_contact_surface(); specifically replace the Line 289
comment and the comment around the call to set_output_contact_surface() (lines
~433–435) to mention output_contact_surface and
viewer.show_hydro_contact_surface as the effective controls and note that
HydroelasticSDF.set_output_contact_surface() does nothing.
---
Outside diff comments:
In `@newton/_src/sim/builder.py`:
- Around line 3099-3108: The current inference uses a gains-based heuristic so
EFFORT can never be chosen when gains are zero; add and use an explicit
drive-presence flag instead of inferring from gains: add a drive_present (or
has_drive) boolean to the joint config (the dim/JointDofConfig object) and have
this builder use dim.drive_present when calling JointTargetMode.from_gains
(replace the local has_drive heuristic), and ensure importers/builders set that
flag appropriately (or fall back to requiring explicit dim.actuator_mode if the
flag is unavailable).
In `@newton/examples/robot/example_robot_policy.py`:
- Around line 40-46: The example imports an internal module
newton._src.viewer.gl.opengl; instead, add a public toggle in the viewer API
(e.g., expose a function or flag like disable_cuda_opengl_interop or
set_disable_cuda_opengl_interop in newton.viewer) and update
example_robot_policy.py to import that public symbol from newton.viewer rather
than newton._src.*; modify the viewer package (newton.viewer.__init__ or the
viewer initialization code) to map the new public function/flag to the existing
internal logic that currently lives in newton._src.viewer.gl.opengl so existing
behavior is reused without exposing internal modules.
---
Nitpick comments:
In `@docs/api/newton_geometry.rst`:
- Around line 54-56: The docs reference the private classmethod `_from_model` in
user-facing text; update the documentation to avoid exposing internals by either
(a) renaming/making the constructor public (e.g., `from_model`) and updating the
docs to reference `from_model`, or (b) removing the `_from_model` mention and
instead pointing users to the public factory `CollisionPipeline` (or other
public API) for constructing the object; modify the text that currently mentions
`_from_model` to reference the chosen public API (`from_model` or
`CollisionPipeline`) and ensure the docstring and examples align with that
public constructor.
In `@newton/_src/solvers/implicit_mpm/solver_implicit_mpm.py`:
- Around line 1197-1198: The docstring for the physical quantity voxel_size is
missing its SI unit; update the inline docstring for the variable/parameter
named voxel_size in solver_implicit_mpm.py to include the unit annotation “[m]”
(e.g., change "Size of the grid voxels." to include "[m]" so it reads like "Size
of the grid voxels [m].") to comply with newton/**/*.py unit notation
guidelines.
In `@newton/tests/test_implicit_mpm.py`:
- Around line 62-66: Rename the local variable options to config where you call
SolverImplicitMPM.Config() and where you pass it into SolverImplicitMPM(model,
...); specifically change the assignment options = SolverImplicitMPM.Config()
and subsequent options.voxel_size / options.grid_type accesses to config =
SolverImplicitMPM.Config() and config.voxel_size / config.grid_type, and update
solver = SolverImplicitMPM(model, options) to solver = SolverImplicitMPM(model,
config); apply the same rename at the other occurrence that sets up a Config and
constructs SolverImplicitMPM so the variable name matches the new class name.
ℹ️ Review info
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (45)
docs/api/newton.rstdocs/api/newton_geometry.rstdocs/api/newton_usd.rstdocs/api/newton_utils.rstdocs/generate_api.pynewton/__init__.pynewton/_src/geometry/narrow_phase.pynewton/_src/sim/__init__.pynewton/_src/sim/builder.pynewton/_src/sim/collide.pynewton/_src/sim/joints.pynewton/_src/sim/model.pynewton/_src/solvers/implicit_mpm/implicit_mpm_model.pynewton/_src/solvers/implicit_mpm/solver_implicit_mpm.pynewton/_src/solvers/mujoco/kernels.pynewton/_src/solvers/mujoco/solver_mujoco.pynewton/_src/usd/utils.pynewton/_src/utils/import_mjcf.pynewton/_src/utils/import_urdf.pynewton/_src/utils/import_usd.pynewton/examples/mpm/example_mpm_anymal.pynewton/examples/mpm/example_mpm_grain_rendering.pynewton/examples/mpm/example_mpm_granular.pynewton/examples/mpm/example_mpm_multi_material.pynewton/examples/mpm/example_mpm_twoway_coupling.pynewton/examples/robot/example_robot_allegro_hand.pynewton/examples/robot/example_robot_anymal_d.pynewton/examples/robot/example_robot_g1.pynewton/examples/robot/example_robot_h1.pynewton/examples/robot/example_robot_humanoid.pynewton/examples/robot/example_robot_panda_hydro.pynewton/examples/robot/example_robot_policy.pynewton/examples/robot/example_robot_ur10.pynewton/geometry.pynewton/tests/test_hydroelastic.pynewton/tests/test_implicit_mpm.pynewton/tests/test_import_mjcf.pynewton/tests/test_import_usd.pynewton/tests/test_joint_controllers.pynewton/tests/test_joint_drive.pynewton/tests/test_mujoco_general_actuators.pynewton/tests/test_remesh.pynewton/tests/test_robot_composer.pynewton/usd.pynewton/utils.py
💤 Files with no reviewable changes (4)
- docs/api/newton_usd.rst
- newton/geometry.py
- newton/_src/sim/collide.py
- newton/usd.py
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
…ctor2 Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
There was a problem hiding this comment.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (9)
newton/_src/viewer/viewer_rerun.py (2)
360-364:⚠️ Potential issue | 🟡 MinorGuard against empty
colorsarrays before indexing first element.Line 363 can raise
IndexErrorwhencolorsis provided but empty (e.g., zero instances).Proposed fix
- if colors is not None and not has_texture: - colors_np = self._to_numpy(colors).astype(np.float32) - # Take the first instance's color and apply to all vertices - first_color = colors_np[0] - color_rgb = np.array(first_color * 255, dtype=np.uint8) - num_vertices = len(mesh_data["points"]) - vertex_colors = np.tile(color_rgb, (num_vertices, 1)) + if colors is not None and not has_texture: + colors_np = self._to_numpy(colors).astype(np.float32) + first_color = None + if colors_np.ndim == 2 and len(colors_np) > 0: + first_color = colors_np[0] + elif colors_np.shape == (3,): + first_color = colors_np + + if first_color is not None: + color_rgb = np.array(first_color * 255, dtype=np.uint8) + num_vertices = len(mesh_data["points"]) + vertex_colors = np.tile(color_rgb, (num_vertices, 1))🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_rerun.py` around lines 360 - 364, The code indexes colors_np[0] without checking for an empty array, which can raise IndexError when colors is provided but empty; inside the block guarded by "if colors is not None and not has_texture:" (the logic using self._to_numpy, colors_np, first_color, color_rgb), add a check that colors_np has at least one element (e.g., check colors_np.size or len(colors_np) > 0) and skip the first_color/color_rgb assignment (or return/continue as appropriate) when the array is empty so you never index [0].
518-520:⚠️ Potential issue | 🟠 Major
hidden=Truedoes not actually hide previously logged lines/points.On Line 518 and Line 662, the early return skips new logs but does not clear existing entities, so toggling visibility can leave stale visuals on screen.
Proposed fix
@@ - if hidden: - return # Do not log hidden lines + if hidden: + rr.log(name, rr.Clear(recursive=False)) + return @@ - if hidden: - # Optionally, skip logging hidden points - return + if hidden: + rr.log(name, rr.Clear(recursive=False)) + returnAlso applies to: 662-664
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_rerun.py` around lines 518 - 520, The early-return checks "if hidden: return" skip creating new visuals but do not remove previously created entities, so toggling hidden leaves stale visuals; modify the code paths that contain these checks (the early-return at ~line 518 and the similar check at ~662) to first remove/clear any previously saved visual handles (e.g., call the existing removal/cleanup routine or delete stored scene objects such as self._last_line_handle, self._last_point_handle, or the registry used for plotted entities), then return; ensure you use the same removal logic in both locations and update any relevant handle variables to None after cleanup so repeated hide/show toggles behave correctly.newton/_src/viewer/viewer_viser.py (1)
464-464:⚠️ Potential issue | 🟡 MinorDouble texture processing on every
log_instancescall.
mesh_data["texture"]already stores the output of_prepare_texture(set atlog_meshline 397). Calling_prepare_textureagain here re-runsload_texture+normalize_textureon every frame, which is unnecessary work on a hot path.Proposed fix
- texture_image = self._prepare_texture(mesh_data.get("texture")) + texture_image = mesh_data.get("texture")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_viser.py` at line 464, In log_instances avoid re-running texture preparation: stop calling self._prepare_texture(mesh_data.get("texture")) and instead use the already-prepared value stored in mesh_data["texture"] (set in log_mesh). Remove the duplicate call in the log_instances path so load_texture/normalize_texture (invoked by _prepare_texture) only run once in log_mesh; reference functions/methods involved: log_instances, log_mesh, _prepare_texture, load_texture, normalize_texture, and the mesh_data["texture"] key.newton/_src/viewer/viewer_null.py (1)
103-111:⚠️ Potential issue | 🟡 MinorPreserve base frame-time bookkeeping in
begin_frame().Overriding with
passdropsViewerBase.begin_frame()behavior, soself.timenever advances in this backend.💡 Proposed fix
`@override` def begin_frame(self, time: float): @@ - pass + super().begin_frame(time)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_null.py` around lines 103 - 111, begin_frame currently overrides ViewerBase.begin_frame with a no-op, losing the base class frame-time bookkeeping; replace the pass with a call to the base implementation (e.g., call super().begin_frame(time) or ViewerBase.begin_frame(self, time) if not using super) so self.time and any other base bookkeeping are preserved in viewer_null's begin_frame method.newton/_src/viewer/viewer_file.py (1)
1046-1076:⚠️ Potential issue | 🟠 MajorValidate
save_intervalandmax_history_sizeup front.Current values can trigger runtime failures (
save_interval=0causes modulo-by-zero;max_history_size<=0creates an unusableRingBuffer).💡 Proposed fix
def __init__( self, output_path: str, auto_save: bool = True, save_interval: int = 100, max_history_size: int | None = None, ): @@ super().__init__() + if save_interval <= 0: + raise ValueError("save_interval must be > 0") + if max_history_size is not None and max_history_size <= 0: + raise ValueError("max_history_size must be > 0") + if not output_path: raise ValueError("output_path must be a non-empty path")Also applies to: 1097-1111
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_file.py` around lines 1046 - 1076, In the File viewer __init__ initialize path, add upfront validation so save_interval must be an int > 0 when auto_save is True (raise ValueError if <= 0 or not int) and max_history_size must be either None or an int > 0 (raise ValueError if <= 0 or wrong type) before creating the history storage; then use RingBuffer(max_history_size) only after max_history_size passes validation and keep the existing assignments to self.save_interval and self.history unchanged otherwise.newton/_src/viewer/viewer_usd.py (2)
323-344:⚠️ Potential issue | 🟠 MajorInstance visibility must be updated every call, not only on creation.
hiddenis only applied in the creation branch, so existing instances keep stale visibility state across frames.💡 Proposed fix
if not instance: instance = self.stage.DefinePrim(instance_path) instance.GetReferences().AddInternalReference(self._get_path(mesh)) - - UsdGeom.Imageable(instance).GetVisibilityAttr().Set("inherited" if not hidden else "invisible") _usd_add_xform(instance) + UsdGeom.Imageable(instance).GetVisibilityAttr().Set( + "inherited" if not hidden else "invisible", self._frame_index + )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_usd.py` around lines 323 - 344, The visibility attribute for instances is only set during creation, causing stale visibility across frames; move the UsdGeom.Imageable(instance).GetVisibilityAttr().Set("inherited" if not hidden else "invisible") call out of the creation branch so it runs on every iteration (for each existing or newly defined instance) inside the for loop that creates/updates instance (use the same instance variable created by self.stage.DefinePrim(self._get_path(name)+f"/instance_{i}") or fetched by GetPrimAtPath); keep _usd_add_xform only on creation but always call the visibility Set before calling _usd_set_xform and updating primvars like displayColor.Set so visibility is updated each frame.
347-383:⚠️ Potential issue | 🟠 Major
xforms=Nonepath crashes despite optional type annotation.
num_instances = len(xforms)is unconditional, so passingNoneraisesTypeError.💡 Proposed fix
- num_instances = len(xforms) + num_instances = 0 if xforms is None else len(xforms) @@ - if xforms is not None: + if num_instances > 0: xforms_np = xforms.numpy()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_usd.py` around lines 347 - 383, In log_instances_point_instancer, the code assumes xforms is always provided by calling num_instances = len(xforms), which crashes when xforms is None; change this to compute num_instances defensively: if xforms is not None use len(xforms), else try to infer length from scales, colors, or materials (check each for not None and use their lengths), and if none are provided raise a clear RuntimeError; after determining num_instances, ensure subsequent validation uses that value (and validate that any provided arrays have matching lengths) so the None path no longer raises a TypeError.newton/_src/geometry/inertia.py (1)
572-586:⚠️ Potential issue | 🟠 MajorRename single-letter
Ito resolve Ruff E741.
Iat Line 572 triggers the ambiguous-name lint error; please use a descriptive name.🛠️ Proposed fix
- m, c, I = src.mass, src.com, src.inertia + m, c, inertia_tensor = src.mass, src.com, src.inertia scale = wp.vec3(scale) sx, sy, sz = scale mass_ratio = sx * sy * sz * density m_new = m * mass_ratio c_new = wp.cw_mul(c, scale) - Ixx = I[0, 0] * (sy**2 + sz**2) / 2 * mass_ratio - Iyy = I[1, 1] * (sx**2 + sz**2) / 2 * mass_ratio - Izz = I[2, 2] * (sx**2 + sy**2) / 2 * mass_ratio - Ixy = I[0, 1] * sx * sy * mass_ratio - Ixz = I[0, 2] * sx * sz * mass_ratio - Iyz = I[1, 2] * sy * sz * mass_ratio + Ixx = inertia_tensor[0, 0] * (sy**2 + sz**2) / 2 * mass_ratio + Iyy = inertia_tensor[1, 1] * (sx**2 + sz**2) / 2 * mass_ratio + Izz = inertia_tensor[2, 2] * (sx**2 + sy**2) / 2 * mass_ratio + Ixy = inertia_tensor[0, 1] * sx * sy * mass_ratio + Ixz = inertia_tensor[0, 2] * sx * sz * mass_ratio + Iyz = inertia_tensor[1, 2] * sy * sz * mass_ratio🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/geometry/inertia.py` around lines 572 - 586, The local variable named I in the scaling block (assigned from src.inertia) causes the Ruff E741 ambiguous-name lint; rename it to a descriptive identifier such as inertia, inertia_tensor, or src_inertia and update all subsequent uses in this scope (the assignment m, c, I = src.mass, src.com, src.inertia and all references I[0,0], I[1,1], I[2,2], I[0,1], I[0,2], I[1,2]) to the new name so the code compiles and the lint error is resolved.newton/_src/sim/collide.py (1)
391-408:⚠️ Potential issue | 🟠 MajorReintroduce deprecated
CollisionPipelinehydroelastic helper shims.The public API refactor drops compatibility for legacy helper calls; please keep forwarding methods during the deprecation window.
🧩 Proposed compatibility shim
from __future__ import annotations +import warnings from typing import Literal @@ class CollisionPipeline: @@ def contacts(self) -> Contacts: """ Allocate and return a new :class:`newton.Contacts` object for this pipeline. @@ self.model._add_custom_attributes(contacts, Model.AttributeAssignment.CONTACT, requires_grad=self.requires_grad) return contacts + + def get_hydro_contact_surface(self): + """Deprecated shim for hydroelastic surface access.""" + warnings.warn( + "CollisionPipeline.get_hydro_contact_surface() is deprecated; use " + "collision_pipeline.hydroelastic_sdf.get_contact_surface().", + DeprecationWarning, + stacklevel=2, + ) + if self.hydroelastic_sdf is None: + return None + return self.hydroelastic_sdf.get_contact_surface() + + def set_output_contact_surface(self, enabled: bool) -> None: + """Deprecated shim for hydroelastic contact-surface output toggling.""" + warnings.warn( + "CollisionPipeline.set_output_contact_surface() is deprecated; set " + "collision_pipeline.hydroelastic_sdf.config.output_contact_surface instead.", + DeprecationWarning, + stacklevel=2, + ) + if self.hydroelastic_sdf is not None: + self.hydroelastic_sdf.config.output_contact_surface = bool(enabled)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/sim/collide.py` around lines 391 - 408, Reintroduce the deprecated CollisionPipeline hydroelastic helper shims by adding small forwarding methods on the CollisionPipeline class that delegate to the new API stored on self.narrow_phase and the sdf_hydroelastic_config passed into __init__; specifically implement simple shim methods (marked deprecated) that return the current config and allow setting/updating it by forwarding to self.narrow_phase (or updating self.sdf_hydroelastic_config) so legacy calls still work without changing the new internals (use the symbols __init__, narrow_phase, and sdf_hydroelastic_config to locate where to attach these shims).
♻️ Duplicate comments (1)
newton/_src/sim/builder.py (1)
1790-1795:⚠️ Potential issue | 🟡 MinorAdd SI units to stiffness/damping text in both importer docblocks.
These updated lines describe physical quantities but still omit inline
[unit]notation required fornewton/**/*.py.✏️ Suggested fix pattern
- force_position_velocity_actuation (bool): If True and both position (stiffness) and velocity - (damping) gains are non-zero, joints use :attr:`~newton.JointTargetMode.POSITION_VELOCITY` actuation mode. + force_position_velocity_actuation (bool): If True and both position stiffness [N/m or torque per radian, depending on joint type] + and velocity damping [N·s/m or torque·s per radian, depending on joint type] gains are non-zero, + joints use :attr:`~newton.JointTargetMode.POSITION_VELOCITY` actuation mode.- force_position_velocity_actuation (bool): If True and both stiffness (kp) and damping (kd) - are non-zero, joints use :attr:`~newton.JointTargetMode.POSITION_VELOCITY` actuation mode. + force_position_velocity_actuation (bool): If True and both stiffness [N/m or torque per radian, depending on joint type] + and damping [N·s/m or torque·s per radian, depending on joint type] are non-zero, + joints use :attr:`~newton.JointTargetMode.POSITION_VELOCITY` actuation mode.As per coding guidelines: “State SI units for all physical quantities in docstrings using inline
[unit]notation …”.Also applies to: 1955-1960
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/sim/builder.py` around lines 1790 - 1795, The docstring for the parameter force_position_velocity_actuation (and the related importer docblock near lines 1955-1960) mentions "stiffness" and "damping" but omits SI units; update the docstrings to append inline unit notation for those physical quantities (e.g., "stiffness [N·m/rad]" or "stiffness [N/m]" and "damping [N·m·s/rad]" or "damping [N·s/m]" as appropriate for the joint type) so they conform to the project's "[unit]" convention used across newton/**/*.py; edit the docstrings surrounding the function/parameter names force_position_velocity_actuation and JointTargetMode.from_gains references to include the correct SI unit brackets consistently in both locations.
🧹 Nitpick comments (4)
newton/_src/viewer/viewer_rerun.py (2)
429-430: Add SI units in changed docstrings for physical quantities.Several updated docstrings describe physical values (
time,width,geo_scale,geo_thickness,radii) but omit inline units.As per coding guidelines,
newton/**/*.py: “State SI units for all physical quantities in docstrings using inline[unit]notation (e.g.,[m],[N·m])”.Also applies to: 514-514, 612-614, 658-658
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_rerun.py` around lines 429 - 430, Update the docstrings that mention the physical parameters time, width, geo_scale, geo_thickness, and radii to include their SI units using inline bracket notation (e.g., time [s], width [m], geo_scale [dimensionless or specify unit], geo_thickness [m], radii [m]); locate the docstrings that define these parameters in viewer_rerun (parameters named time, width, geo_scale, geo_thickness, radii) and edit each parameter line to append the correct unit in brackets following the parameter name/type per project style (e.g., "time: The current simulation time [s]."). Ensure units are precise and consistent with the code's physical meanings.
231-231: Make intentionally-unused interface parameters explicit.
backface_cullingandmaterialsare part of the shared viewer API but currently unused in this backend; make that explicit to avoid recurring ARG002 warnings.Proposed fix
@@ def log_mesh(...): - if hidden: + _ = backface_culling # API compatibility: ignored by rerun backend + if hidden: return @@ def log_instances(...): - if hidden: + _ = materials # API compatibility: ignored by rerun backend + if hidden: if name in self._instances:Also applies to: 325-325
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_rerun.py` at line 231, The parameters backface_culling and materials are part of the shared viewer API but unused in this backend; make that explicit to silence ARG002 by either renaming them to _backface_culling and _materials in the function signatures or explicitly referencing them (e.g. _ = backface_culling; _ = materials) inside the functions where they appear (search for occurrences of backface_culling and materials in viewer_rerun.py, e.g. the signatures that include backface_culling: bool = True and the other occurrence around line 325) so the parameters remain in the API but are marked as intentionally unused.newton/_src/sim/__init__.py (1)
23-35: Remove this suggestion; no documented API-cleanup objective or*Typesuffix standard exists.The referenced API-cleanup objective and
*Typesuffix standard are not documented in the codebase, commit messages, issues, or code comments.JointTargetModeis the only enum in use, with no competing variant or migration plan. Adding a compatibility alias preemptively for an unconfirmed future standard introduces maintenance burden without clear benefit. Revisit this suggestion if and when a formal API-cleanup plan is documented and approved.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/sim/__init__.py` around lines 23 - 35, Don't add or keep a preemptive compatibility alias with a "*Type" suffix; revert any changes that introduce symbols like JointTargetType (or similar) and related __all__ entries so the module continues to export only the existing enums (JointTargetMode, JointType) and original API. Locate where the alias or extra __all__ entry was added (referencing JointTargetMode, JointType, and __all__) and remove the alias and its export entry, leaving the original enum names unchanged.newton/_src/viewer/viewer.py (1)
319-323: Add inline SI units in the newly touched physical-quantity docstrings.The updated viewer API docs still omit unit notation for physical fields (e.g., time, angles, widths). I can help open a focused follow-up issue so this stays out of the functional diff.
As per coding guidelines
newton/**/*.py: State SI units for all physical quantities in docstrings using inline[unit]notation.Also applies to: 897-904, 957-959
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer.py` around lines 319 - 323, Update the docstring for the "Begin a new frame." method (the function that accepts the parameter named time) to include the SI unit for time as inline notation (e.g., "time: The current frame time [s]."). Likewise, locate the other touched docstrings mentioned in the review and add inline SI units for physical quantities there—use [rad] for angular quantities (angles) and [m] for length/width fields (widths) so each Args entry explicitly states the unit in square brackets next to the parameter description.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@AGENTS.md`:
- Line 33: The sentence currently uses nested inline code with backticks which
triggers MD038; replace the nested backticks with direct Sphinx-role syntax by
using the roles themselves (e.g. :meth:`log_mesh` and :attr:`model`) so the text
reads with single backtick-free Sphinx role references instead of nested code
spans.
In `@newton/_src/geometry/sdf_hydroelastic.py`:
- Around line 223-226: Update the docstrings for the physical fields
contact_surface_point and contact_surface_depth to include SI unit notation:
change the contact_surface_point docstring to indicate positions are in meters
using "[m]" (e.g., "World-space positions of contact surface triangle vertices
(3 per face) [m].") and change the contact_surface_depth docstring to indicate
penetration depth is in meters using "[m]" (e.g., "Penetration depth at each
face centroid [m]."). Ensure the unit notation is inline and follows the
existing docstring style.
- Around line 459-469: Add a deprecated alias named contact_surface that
forwards to the new get_contact_surface() accessor: implement a new method
contact_surface(self) that issues a DeprecationWarning (or use
warnings.warn(..., DeprecationWarning)) explaining to use get_contact_surface(),
then returns self.get_contact_surface(); keep the same return type
(ContactSurfaceData | None) and preserve brief docstring pointing to
get_contact_surface; reference existing symbols get_contact_surface,
ContactSurfaceData, iso_vertex_point, and self.config.output_contact_surface
when adding the shim.
In `@newton/_src/sim/builder.py`:
- Around line 403-404: Update the docstring for the "mode" actuator/attribute to
remove the misleading phrase "inferred from gains and targets" and state that
when None the actuator mode is inferred from controller gains only; reference
JointTargetMode and the gain-driven inference code path used to determine mode
so callers don't expect target-based inference.
- Line 3196: Add documentation for the new parameter actuator_mode (type
JointTargetMode | None) to the Args: sections of the revolute and prismatic
public APIs in builder.py; in the docstrings for the revolute(...) and
prismatic(...) functions mention what actuator_mode does, its accepted values
(JointTargetMode or None), default behavior when None, and any effect on joint
behavior or control semantics so callers know how to use it.
In `@newton/_src/solvers/solver.py`:
- Around line 261-270: The step method's type annotation is too strict: change
the signature of SolverBase.step (the def step(self, state_in: State, state_out:
State, control: Control, contacts: Contacts, dt: float) -> State | None) to
accept None by using control: Control | None and propagate this change to every
solver subclass that implements/overrides step (e.g., SemiImplicitSolver.step
and any other solver classes in the repo) so annotations match the
docstring/implementation; also update any type imports or mypy stubs if
necessary to ensure Control | None is valid everywhere and adjust callers only
if they rely on non-None without checking.
In `@newton/_src/viewer/viewer_gl.py`:
- Around line 667-677: The log_lines function currently ignores the hidden
parameter for existing batches because LinesGL.hidden is never updated; when
reusing an existing LinesGL instance set its hidden attribute to the incoming
hidden value (i.e., batch.hidden = hidden) and then trigger whatever viewer
refresh/update path already used for other visibility changes (e.g., request a
redraw / update GPU state or call the view's existing batch-update helper) so
the GL draw state reflects the new visibility; apply the same change in the
other lines-handling block (lines ~689-725) where existing line batches are
reused.
In `@newton/_src/viewer/viewer.py`:
- Around line 486-487: The comment for contact normals says "Use red color for
contact normals" but the colors tuple assigned to colors in viewer.py is (0.0,
1.0, 0.0) (green); change the tuple used by the contact-normal rendering
variable (colors) to the red RGB tuple (1.0, 0.0, 0.0) or update the comment to
match the intended color, ensuring the symbol name colors in the contact normal
rendering code is updated consistently.
---
Outside diff comments:
In `@newton/_src/geometry/inertia.py`:
- Around line 572-586: The local variable named I in the scaling block (assigned
from src.inertia) causes the Ruff E741 ambiguous-name lint; rename it to a
descriptive identifier such as inertia, inertia_tensor, or src_inertia and
update all subsequent uses in this scope (the assignment m, c, I = src.mass,
src.com, src.inertia and all references I[0,0], I[1,1], I[2,2], I[0,1], I[0,2],
I[1,2]) to the new name so the code compiles and the lint error is resolved.
In `@newton/_src/sim/collide.py`:
- Around line 391-408: Reintroduce the deprecated CollisionPipeline hydroelastic
helper shims by adding small forwarding methods on the CollisionPipeline class
that delegate to the new API stored on self.narrow_phase and the
sdf_hydroelastic_config passed into __init__; specifically implement simple shim
methods (marked deprecated) that return the current config and allow
setting/updating it by forwarding to self.narrow_phase (or updating
self.sdf_hydroelastic_config) so legacy calls still work without changing the
new internals (use the symbols __init__, narrow_phase, and
sdf_hydroelastic_config to locate where to attach these shims).
In `@newton/_src/viewer/viewer_file.py`:
- Around line 1046-1076: In the File viewer __init__ initialize path, add
upfront validation so save_interval must be an int > 0 when auto_save is True
(raise ValueError if <= 0 or not int) and max_history_size must be either None
or an int > 0 (raise ValueError if <= 0 or wrong type) before creating the
history storage; then use RingBuffer(max_history_size) only after
max_history_size passes validation and keep the existing assignments to
self.save_interval and self.history unchanged otherwise.
In `@newton/_src/viewer/viewer_null.py`:
- Around line 103-111: begin_frame currently overrides ViewerBase.begin_frame
with a no-op, losing the base class frame-time bookkeeping; replace the pass
with a call to the base implementation (e.g., call super().begin_frame(time) or
ViewerBase.begin_frame(self, time) if not using super) so self.time and any
other base bookkeeping are preserved in viewer_null's begin_frame method.
In `@newton/_src/viewer/viewer_rerun.py`:
- Around line 360-364: The code indexes colors_np[0] without checking for an
empty array, which can raise IndexError when colors is provided but empty;
inside the block guarded by "if colors is not None and not has_texture:" (the
logic using self._to_numpy, colors_np, first_color, color_rgb), add a check that
colors_np has at least one element (e.g., check colors_np.size or len(colors_np)
> 0) and skip the first_color/color_rgb assignment (or return/continue as
appropriate) when the array is empty so you never index [0].
- Around line 518-520: The early-return checks "if hidden: return" skip creating
new visuals but do not remove previously created entities, so toggling hidden
leaves stale visuals; modify the code paths that contain these checks (the
early-return at ~line 518 and the similar check at ~662) to first remove/clear
any previously saved visual handles (e.g., call the existing removal/cleanup
routine or delete stored scene objects such as self._last_line_handle,
self._last_point_handle, or the registry used for plotted entities), then
return; ensure you use the same removal logic in both locations and update any
relevant handle variables to None after cleanup so repeated hide/show toggles
behave correctly.
In `@newton/_src/viewer/viewer_usd.py`:
- Around line 323-344: The visibility attribute for instances is only set during
creation, causing stale visibility across frames; move the
UsdGeom.Imageable(instance).GetVisibilityAttr().Set("inherited" if not hidden
else "invisible") call out of the creation branch so it runs on every iteration
(for each existing or newly defined instance) inside the for loop that
creates/updates instance (use the same instance variable created by
self.stage.DefinePrim(self._get_path(name)+f"/instance_{i}") or fetched by
GetPrimAtPath); keep _usd_add_xform only on creation but always call the
visibility Set before calling _usd_set_xform and updating primvars like
displayColor.Set so visibility is updated each frame.
- Around line 347-383: In log_instances_point_instancer, the code assumes xforms
is always provided by calling num_instances = len(xforms), which crashes when
xforms is None; change this to compute num_instances defensively: if xforms is
not None use len(xforms), else try to infer length from scales, colors, or
materials (check each for not None and use their lengths), and if none are
provided raise a clear RuntimeError; after determining num_instances, ensure
subsequent validation uses that value (and validate that any provided arrays
have matching lengths) so the None path no longer raises a TypeError.
In `@newton/_src/viewer/viewer_viser.py`:
- Line 464: In log_instances avoid re-running texture preparation: stop calling
self._prepare_texture(mesh_data.get("texture")) and instead use the
already-prepared value stored in mesh_data["texture"] (set in log_mesh). Remove
the duplicate call in the log_instances path so load_texture/normalize_texture
(invoked by _prepare_texture) only run once in log_mesh; reference
functions/methods involved: log_instances, log_mesh, _prepare_texture,
load_texture, normalize_texture, and the mesh_data["texture"] key.
---
Duplicate comments:
In `@newton/_src/sim/builder.py`:
- Around line 1790-1795: The docstring for the parameter
force_position_velocity_actuation (and the related importer docblock near lines
1955-1960) mentions "stiffness" and "damping" but omits SI units; update the
docstrings to append inline unit notation for those physical quantities (e.g.,
"stiffness [N·m/rad]" or "stiffness [N/m]" and "damping [N·m·s/rad]" or "damping
[N·s/m]" as appropriate for the joint type) so they conform to the project's
"[unit]" convention used across newton/**/*.py; edit the docstrings surrounding
the function/parameter names force_position_velocity_actuation and
JointTargetMode.from_gains references to include the correct SI unit brackets
consistently in both locations.
---
Nitpick comments:
In `@newton/_src/sim/__init__.py`:
- Around line 23-35: Don't add or keep a preemptive compatibility alias with a
"*Type" suffix; revert any changes that introduce symbols like JointTargetType
(or similar) and related __all__ entries so the module continues to export only
the existing enums (JointTargetMode, JointType) and original API. Locate where
the alias or extra __all__ entry was added (referencing JointTargetMode,
JointType, and __all__) and remove the alias and its export entry, leaving the
original enum names unchanged.
In `@newton/_src/viewer/viewer_rerun.py`:
- Around line 429-430: Update the docstrings that mention the physical
parameters time, width, geo_scale, geo_thickness, and radii to include their SI
units using inline bracket notation (e.g., time [s], width [m], geo_scale
[dimensionless or specify unit], geo_thickness [m], radii [m]); locate the
docstrings that define these parameters in viewer_rerun (parameters named time,
width, geo_scale, geo_thickness, radii) and edit each parameter line to append
the correct unit in brackets following the parameter name/type per project style
(e.g., "time: The current simulation time [s]."). Ensure units are precise and
consistent with the code's physical meanings.
- Line 231: The parameters backface_culling and materials are part of the shared
viewer API but unused in this backend; make that explicit to silence ARG002 by
either renaming them to _backface_culling and _materials in the function
signatures or explicitly referencing them (e.g. _ = backface_culling; _ =
materials) inside the functions where they appear (search for occurrences of
backface_culling and materials in viewer_rerun.py, e.g. the signatures that
include backface_culling: bool = True and the other occurrence around line 325)
so the parameters remain in the API but are marked as intentionally unused.
In `@newton/_src/viewer/viewer.py`:
- Around line 319-323: Update the docstring for the "Begin a new frame." method
(the function that accepts the parameter named time) to include the SI unit for
time as inline notation (e.g., "time: The current frame time [s]."). Likewise,
locate the other touched docstrings mentioned in the review and add inline SI
units for physical quantities there—use [rad] for angular quantities (angles)
and [m] for length/width fields (widths) so each Args entry explicitly states
the unit in square brackets next to the parameter description.
ℹ️ Review info
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (21)
AGENTS.mddocs/api/newton.rstnewton/__init__.pynewton/_src/geometry/inertia.pynewton/_src/geometry/sdf_hydroelastic.pynewton/_src/geometry/types.pynewton/_src/geometry/utils.pynewton/_src/sim/__init__.pynewton/_src/sim/builder.pynewton/_src/sim/collide.pynewton/_src/solvers/solver.pynewton/_src/viewer/viewer.pynewton/_src/viewer/viewer_file.pynewton/_src/viewer/viewer_gl.pynewton/_src/viewer/viewer_null.pynewton/_src/viewer/viewer_rerun.pynewton/_src/viewer/viewer_usd.pynewton/_src/viewer/viewer_viser.pynewton/examples/robot/example_robot_panda_hydro.pynewton/tests/test_hydroelastic.pynewton/tests/test_viewer_usd.py
🚧 Files skipped from review as they are similar to previous changes (3)
- newton/examples/robot/example_robot_panda_hydro.py
- docs/api/newton.rst
- newton/init.py
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
newton/_src/viewer/viewer_viser.py (1)
852-862:⚠️ Potential issue | 🟡 Minor
log_pointsunconditionally scales colors by 255, inconsistent withlog_lines.
log_linesuses_rgb_to_uint8_arraywhich detects whether values are in[0, 1]or[0, 255]before scaling.log_pointsalways multiplies by 255, so colors already in the[0, 255]range (a valid caller input per the declared union type) will clip to white. Apply the same helper for consistency.🐛 Proposed fix
if colors is not None: cols = self._to_numpy(colors) + def _rgb_to_uint8(arr: np.ndarray) -> np.ndarray: + arr = np.asarray(arr, dtype=np.float32) + if arr.size > 0 and float(np.max(arr)) > 1.0: + return np.clip(arr, 0, 255).astype(np.uint8) + return np.clip(arr * 255.0, 0, 255).astype(np.uint8) if cols.shape == (n_points, 3): - colors_val = (cols * 255).astype(np.uint8) + colors_val = _rgb_to_uint8(cols) elif cols.shape == (3,): - colors_val = np.tile((cols * 255).astype(np.uint8), (n_points, 1)) + colors_val = np.tile(_rgb_to_uint8(cols), (n_points, 1)) else: colors_val = np.full((n_points, 3), 255, dtype=np.uint8)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_viser.py` around lines 852 - 862, In log_points, the code currently multiplies colors by 255 unconditionally; instead call the existing helper _rgb_to_uint8_array to normalize/scale colors (it handles inputs in [0,1] or [0,255])—convert input via self._to_numpy(colors) as you already do, then pass that array and n_points into _rgb_to_uint8_array to produce colors_val (and keep the fallback to white using np.full((n_points,3),255,dtype=np.uint8) when colors is None or invalid); update references to cols, colors_val and remove the direct (cols * 255).astype(...) logic so behavior matches log_lines.
♻️ Duplicate comments (7)
newton/_src/solvers/mujoco/solver_mujoco.py (1)
167-170: SI-unit docstring concern for this block is already reported in prior review feedback.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/solvers/mujoco/solver_mujoco.py` around lines 167 - 170, The docstring block describing joint target mappings lacks explicit SI-unit annotations; update the text for Control.joint_target_ke, Control.joint_target_kd, and Control.joint_target_vel (and any mentions of joint targets in JointTargetMode.POSITION and JointTargetMode.POSITION_VELOCITY and the VELOCITY entry) to include consistent SI units (e.g., velocities in m/s or rad/s as appropriate, proportional gains in N·m/rad or N/m, damping in N·m·s/rad or N·s/m) and use a uniform unit formatting style across entries so readers can unambiguously interpret values.newton/_src/geometry/sdf_hydroelastic.py (2)
223-225:⚠️ Potential issue | 🟡 MinorAdd SI units to physical field docstrings.
Line 223 and Line 225 still describe physical quantities without inline unit tags.
✍️ Proposed docstring fix
- """World-space positions of contact surface triangle vertices (3 per face).""" + """World-space positions [m] of contact surface triangle vertices (3 per face).""" @@ - """Penetration depth at each face centroid.""" + """Penetration depth [m] at each face centroid."""As per coding guidelines, "State SI units for all physical quantities in docstrings using inline
[unit]notation (e.g.,[m],[N·m])".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/geometry/sdf_hydroelastic.py` around lines 223 - 225, The docstrings for the physical fields contact_surface_positions and contact_surface_depth are missing SI unit annotations; update the inline docstrings to state units using [m] (e.g., "World-space positions of contact surface triangle vertices (3 per face) [m]" for contact_surface_positions and "Penetration depth at each face centroid [m]" for contact_surface_depth) so each physical quantity includes the required `[unit]` notation.
459-474:⚠️ Potential issue | 🟠 MajorKeep a deprecated alias for the renamed contact-surface accessor.
Removing the old accessor path without a shim introduces avoidable API breakage for downstream users.
🧩 Proposed compatibility shim
def get_contact_surface(self) -> ContactSurfaceData | None: """Get hydroelastic :class:`ContactSurfaceData` for visualization. @@ return self.ContactSurfaceData( contact_surface_point=self.iso_vertex_point, contact_surface_depth=self.iso_vertex_depth, contact_surface_shape_pair=self.iso_vertex_shape_pair, face_contact_count=self.contact_reduction.contact_count, max_num_face_contacts=self.max_num_face_contacts, ) + + def get_hydro_contact_surface(self) -> ContactSurfaceData | None: + """Deprecated alias for :meth:`get_contact_surface`.""" + warnings.warn( + "HydroelasticSDF.get_hydro_contact_surface() is deprecated; " + "use get_contact_surface() instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.get_contact_surface()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/geometry/sdf_hydroelastic.py` around lines 459 - 474, Add a deprecated shim named get_contact_surface_data that simply calls the new get_contact_surface and returns its ContactSurfaceData; have the shim emit a DeprecationWarning (via warnings.warn) or use the module logger to note the old accessor is deprecated and point users to get_contact_surface, and ensure the returned type matches ContactSurfaceData so callers using the old name continue to work.newton/_src/sim/builder.py (3)
3352-3352:⚠️ Potential issue | 🟡 MinorDocument
actuator_modein revolute/prismaticArgs:sections.Both signatures expose a public parameter but the parameter is still missing from the corresponding doc entries.
As per coding guidelines: “Use Google-style docstrings with clear, concise explanations of what the function does, its parameters, and return values.”✏️ Suggested doc additions
friction: Friction coefficient for the joint axis. If None, the default value from :attr:`default_joint_cfg.friction` is used. + actuator_mode: Actuation mode for the joint DOF. If None, mode is inferred from gains. label: The label of the joint.Also applies to: 3445-3445
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/sim/builder.py` at line 3352, The docstrings for the revolute and prismatic builder functions are missing documentation for the public parameter actuator_mode (type JointTargetMode | None); update both functions' Google-style Args: sections to add a concise line describing actuator_mode (what it controls, accepted values or None behavior, and default), referencing the parameter name exactly as actuator_mode and the type JointTargetMode so readers know its purpose and expected values; ensure both signatures (the two occurrences around the revolute and prismatic definitions) receive the same doc entry and keep wording consistent with existing param descriptions.
417-418:⚠️ Potential issue | 🟡 MinorDocstring overstates mode inference inputs.
The inference path in
add_joint()is gain-driven; “targets” are not part of the inference decision.As per coding guidelines: “Use Google-style docstrings with clear, concise explanations of what the function does, its parameters, and return values.”✏️ Suggested doc tweak
- """Actuator mode for this DOF. Determines which actuators are installed (see :class:`JointTargetMode`). - If None, the mode is inferred from gains and targets.""" + """Actuator mode for this DOF. Determines which actuators are installed (see :class:`JointTargetMode`). + If None, the mode is inferred from drive gains."""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/sim/builder.py` around lines 417 - 418, The docstring for the actuator mode parameter overstates how mode is inferred; update the docstring in add_joint() to say inference is gain-driven (based on gains) and remove mention of “targets”, following Google-style docstring conventions; reference JointTargetMode for context and clearly state that if mode is None it will be inferred from gains only.
1930-1934:⚠️ Potential issue | 🟡 MinorAdd SI units for stiffness/damping in these updated docstrings.
These blocks describe physical gains but omit inline
[unit]notation required in this repo.As per coding guidelines: “State SI units for all physical quantities in docstrings using inline [unit] notation (e.g., [m], [N·m])...”. Based on learnings: “In newton/_src/sim/builder.py, follow VBD conventions: treat radians as dimensionless. Prefer wording 'torque per radian'...”.✏️ Suggested wording pattern
- force_position_velocity_actuation (bool): If True and both position (stiffness) and velocity - (damping) gains are non-zero, joints use ... + force_position_velocity_actuation (bool): If True and both position stiffness [N/m or torque per radian, depending on joint type] + and velocity damping [N·s/m or torque·s per radian, depending on joint type] are non-zero, joints use ...Also applies to: 2095-2099
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/sim/builder.py` around lines 1930 - 1934, Update the docstring text around the JointTargetMode description to include SI units for stiffness and damping: add "[N·m/rad]" (torque per radian) for stiffness and "[N·m·s/rad]" (torque·second per radian) for damping where those gains are mentioned in the paragraph that references newton.JointTargetMode.POSITION_VELOCITY and newton.JointTargetMode.from_gains (and the repeated block at the later location around lines ~2095–2099); keep radians treated as dimensionless per project convention but show the preferred wording "torque per radian" or the inline unit notation, and also annotate any reference to direct torque/effort with "[N·m]" for clarity.newton/_src/viewer/viewer.py (1)
486-487:⚠️ Potential issue | 🟡 MinorContact normal color constant still conflicts with the comment.
The comment says red but the assigned tuple
(0.0, 1.0, 0.0)is green. This was flagged in a previous review and remains unaddressed.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer.py` around lines 486 - 487, The comment "Use red color for contact normals" disagrees with the assigned color tuple; update the colors variable in viewer.py (the colors assignment used for contact normals) to match the comment by setting it to red (1.0, 0.0, 0.0), or alternatively change the comment to reflect the current green value—preferably set colors = (1.0, 0.0, 0.0) so the comment and the colors variable are consistent.
🧹 Nitpick comments (8)
newton/examples/robot/example_robot_h1.py (1)
72-72: Redundantint()cast —JointTargetModeis already anIntEnum.Since
JointTargetModeis anIntEnum(inherits fromint), the explicitint()conversion is unnecessary. The value can be assigned directly.♻️ Proposed simplification
- h1.joint_target_mode[i] = int(JointTargetMode.POSITION) + h1.joint_target_mode[i] = JointTargetMode.POSITION🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/examples/robot/example_robot_h1.py` at line 72, The assignment uses an unnecessary int() cast because JointTargetMode is an IntEnum; replace the expression in the assignment (h1.joint_target_mode[i] = int(JointTargetMode.POSITION)) with a direct assignment of the enum value (h1.joint_target_mode[i] = JointTargetMode.POSITION) so the IntEnum is used directly without casting.newton/tests/test_implicit_mpm.py (1)
62-66: Nit: renameoptions→configto match the new type name.Both test functions instantiate
SolverImplicitMPM.Config()but store the result in a variable still calledoptions, a leftover from theOptionsera.✏️ Suggested rename (both sites)
- options = SolverImplicitMPM.Config() - options.grid_type = "dense" - options.voxel_size = voxel_size - solver = SolverImplicitMPM(model, options) + config = SolverImplicitMPM.Config() + config.grid_type = "dense" + config.voxel_size = voxel_size + solver = SolverImplicitMPM(model, config)- options = SolverImplicitMPM.Config() - options.voxel_size = voxel_size - options.grid_type = "dense" - options.collider_velocity_mode = velocity_mode - solver = SolverImplicitMPM(model, options) + config = SolverImplicitMPM.Config() + config.voxel_size = voxel_size + config.grid_type = "dense" + config.collider_velocity_mode = velocity_mode + solver = SolverImplicitMPM(model, config)Also applies to: 165-170
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/tests/test_implicit_mpm.py` around lines 62 - 66, Rename the local variable currently named options to config where you call SolverImplicitMPM.Config() (e.g., in the test functions that create options = SolverImplicitMPM.Config()), updating the assignments and any subsequent references (like options.grid_type, options.voxel_size, and the SolverImplicitMPM(model, options) call) to use config instead; apply this rename at both occurrences around the SolverImplicitMPM.Config() usages (the blocks at lines shown in the review) so the variable name matches the Config type.newton/_src/solvers/implicit_mpm/implicit_mpm_model.py (1)
245-254: Nit: parameter nameoptionsand attribute_optionsare stale; update docstring description to match.With the rename from
ImplicitMPMOptionstoSolverImplicitMPM.Config, the parameter nameoptions/ stored attributeself._optionsand theArgsdescription "Options controlling…" are inconsistent with the newConfigterminology.✏️ Suggested rename
Args: model: The base Newton model to augment. - options: Options controlling particle and collider defaults. + config: Configuration controlling particle and collider defaults. """ - def __init__(self, model: newton.Model, options: "SolverImplicitMPM.Config"): + def __init__(self, model: newton.Model, config: "SolverImplicitMPM.Config"): self.model = model - self._options = options + self._config = config - # Global options from SolverImplicitMPM.Config - self.voxel_size = float(options.voxel_size) + # Global config from SolverImplicitMPM.Config + self.voxel_size = float(config.voxel_size)(All downstream
options.*/self._options.*reads in this file would need the same rename.)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/solvers/implicit_mpm/implicit_mpm_model.py` around lines 245 - 254, The docstring and constructor parameter/attribute use the stale name "options" and "self._options" after renaming to SolverImplicitMPM.Config; update the Args section to refer to "config" (or "cfg") and rename the __init__ parameter from options to config and the stored attribute from self._options to self._config, then update all downstream reads in this file that reference options.* or self._options.* to use config.* or self._config.* (ensure references to the type use SolverImplicitMPM.Config in the signature and docstring).newton/_src/viewer/viewer.py (2)
80-82: Attribute docstring placement is fragile for tools other than Sphinx.The string literal on line 81 is an informal "attribute docstring" (placed after the attribute assignment). While Sphinx's
autodocpicks this up, other documentation tools and IDEs typically do not. The more portable pattern is a#:comment before the assignment, which Sphinx also recognizes.+#: Whether to show the hydroelastic contact surface wireframe. self.show_hydro_contact_surface = False # show hydroelastic contact surface wireframe -"""Whether to show the hydroelastic contact surface wireframe."""🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer.py` around lines 80 - 82, The attribute docstring for show_hydro_contact_surface is currently a string literal placed after the assignment (fragile for non-Sphinx tools); change it to a preceding inline doc comment using the Sphinx-recognized "#:" style immediately above the assignment (replace the trailing triple-quoted string with "#: Whether to show the hydroelastic contact surface wireframe.") so IDEs and other doc tools will pick it up; update the same pattern if any similar post-assignment string literals exist (e.g., checking picking_enabled) in viewer.py.
210-218: Suppress unused-argument warnings forset_cameraandis_key_downbase no-ops.Ruff ARG002 fires on
pos,pitch,yaw(Line 210) andkey(Line 123) because the base implementations are intentional no-ops kept for interface compatibility. Add# noqa: ARG002or rename parameters to_pos,_pitch,_yaw, and_key.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer.py` around lines 210 - 218, Ruff ARG002 flags unused parameters in the base no-op methods set_camera and is_key_down; fix by either adding inline suppression comments (e.g., append "# noqa: ARG002" to the parameter lists in the definitions of set_camera and is_key_down) or by renaming the parameters to underscore-prefixed names (_pos, _pitch, _yaw, _key) in the methods set_camera and is_key_down so the linter recognizes them as intentionally unused while keeping the interface intact.newton/_src/viewer/viewer_viser.py (3)
438-439: Suppressmaterialsunused-argument warning (ARG002).Same situation as
normalsinlog_mesh; suppress or rename to_materials.♻️ Proposed fix
- materials: wp.array(dtype=wp.vec4) | None, + materials: wp.array(dtype=wp.vec4) | None, # noqa: ARG002🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_viser.py` around lines 438 - 439, The unused-argument warning for the parameter materials should be suppressed by renaming it to _materials (or prefixing with an underscore) in the function signature where it appears (same pattern used for normals in log_mesh) so the linter recognizes it as intentionally unused; update the signature that currently declares colors and materials (change materials to _materials) and adjust any internal references accordingly (or leave unused) to eliminate ARG002.
340-342: Suppressnormalsunused-argument warning (ARG002).The parameter must be kept to satisfy the
ViewerBaseinterface. Rename to_normalsor add# noqa: ARG002to suppress the lint warning.♻️ Proposed fix
- normals: wp.array(dtype=wp.vec3) | None = None, + normals: wp.array(dtype=wp.vec3) | None = None, # noqa: ARG002🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_viser.py` around lines 340 - 342, The method signature includes the parameter "normals" to satisfy the ViewerBase interface but currently triggers an unused-argument lint (ARG002); to suppress it, rename the parameter to "_normals" in the function definition (i.e., change "normals: wp.array(dtype=wp.vec3) | None = None" to "_normals: ...") or add an inline noqa comment ("# noqa: ARG002") to that parameter, and update any internal references (if any) to use the new name so the signature still matches ViewerBase while eliminating the lint warning.
464-465: Avoid re-processing already-normalized texture data.
log_meshstorestexture_image(already the result of_prepare_texture) inself._meshes[name]["texture"]. Callingself._prepare_texture(...)on it again every timelog_instancesruns re-runsload_texture+normalize_textureunnecessarily.♻️ Proposed fix
- texture_image = self._prepare_texture(mesh_data.get("texture")) + texture_image = mesh_data.get("texture")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@newton/_src/viewer/viewer_viser.py` around lines 464 - 465, log_instances is re-processing textures because it always calls self._prepare_texture on mesh_data.get("texture") even though log_mesh already stores the prepared result in self._meshes[name]["texture"]. Fix by detecting prepared textures and skipping re-normalization: in log_instances (where texture_image is set) use the value from mesh_data.get("texture") directly if it matches the prepared texture type/marker that _prepare_texture returns (or add/check a small flag/property), otherwise call self._prepare_texture; update any code that sets self._meshes[name]["texture"] in log_mesh to ensure it stores the prepared texture object/marker used for this detection.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@newton/_src/geometry/narrow_phase.py`:
- Line 1463: The public alias HydroelasticSDF = _HydroelasticSDF in
narrow_phase.py is causing duplicate autodoc entries; update the docs
autosummary/indexing so only the canonical path (the original class
_HydroelasticSDF) is indexed and the alias HydroelasticSDF is not. Concretely,
remove or replace any autosummary entry that lists HydroelasticSDF with the
canonical fully-qualified _HydroelasticSDF (or delete the alias entry), and
adjust any cross-references to point to _HydroelasticSDF so the alias remains in
code but is excluded from autosummary indexing.
In `@newton/_src/sim/collide.py`:
- Around line 419-423: Update the docstring entry for the parameter
soft_contact_margin to include SI units in inline [unit] notation (e.g., "[m]")
so it reads something like "soft_contact_margin: Margin for soft contact
generation [m]. Defaults to 0.01." Locate the parameter description in the
collide.py docstring where soft_contact_margin is defined and add the bracketed
SI unit, following the project guideline for newton/**/*.py.
In `@newton/_src/viewer/viewer_viser.py`:
- Around line 207-213: The helper _is_client_camera_ready currently catches all
Exceptions; replace the broad except with a narrow catch for the expected
failure modes (e.g., except (AttributeError, RuntimeError): return False) so
only missing/uninitialized camera properties are swallowed, and allow other
unexpected exceptions to propagate; update the try/except in
_is_client_camera_ready accordingly.
---
Outside diff comments:
In `@newton/_src/viewer/viewer_viser.py`:
- Around line 852-862: In log_points, the code currently multiplies colors by
255 unconditionally; instead call the existing helper _rgb_to_uint8_array to
normalize/scale colors (it handles inputs in [0,1] or [0,255])—convert input via
self._to_numpy(colors) as you already do, then pass that array and n_points into
_rgb_to_uint8_array to produce colors_val (and keep the fallback to white using
np.full((n_points,3),255,dtype=np.uint8) when colors is None or invalid); update
references to cols, colors_val and remove the direct (cols * 255).astype(...)
logic so behavior matches log_lines.
---
Duplicate comments:
In `@newton/_src/geometry/sdf_hydroelastic.py`:
- Around line 223-225: The docstrings for the physical fields
contact_surface_positions and contact_surface_depth are missing SI unit
annotations; update the inline docstrings to state units using [m] (e.g.,
"World-space positions of contact surface triangle vertices (3 per face) [m]"
for contact_surface_positions and "Penetration depth at each face centroid [m]"
for contact_surface_depth) so each physical quantity includes the required
`[unit]` notation.
- Around line 459-474: Add a deprecated shim named get_contact_surface_data that
simply calls the new get_contact_surface and returns its ContactSurfaceData;
have the shim emit a DeprecationWarning (via warnings.warn) or use the module
logger to note the old accessor is deprecated and point users to
get_contact_surface, and ensure the returned type matches ContactSurfaceData so
callers using the old name continue to work.
In `@newton/_src/sim/builder.py`:
- Line 3352: The docstrings for the revolute and prismatic builder functions are
missing documentation for the public parameter actuator_mode (type
JointTargetMode | None); update both functions' Google-style Args: sections to
add a concise line describing actuator_mode (what it controls, accepted values
or None behavior, and default), referencing the parameter name exactly as
actuator_mode and the type JointTargetMode so readers know its purpose and
expected values; ensure both signatures (the two occurrences around the revolute
and prismatic definitions) receive the same doc entry and keep wording
consistent with existing param descriptions.
- Around line 417-418: The docstring for the actuator mode parameter overstates
how mode is inferred; update the docstring in add_joint() to say inference is
gain-driven (based on gains) and remove mention of “targets”, following
Google-style docstring conventions; reference JointTargetMode for context and
clearly state that if mode is None it will be inferred from gains only.
- Around line 1930-1934: Update the docstring text around the JointTargetMode
description to include SI units for stiffness and damping: add "[N·m/rad]"
(torque per radian) for stiffness and "[N·m·s/rad]" (torque·second per radian)
for damping where those gains are mentioned in the paragraph that references
newton.JointTargetMode.POSITION_VELOCITY and newton.JointTargetMode.from_gains
(and the repeated block at the later location around lines ~2095–2099); keep
radians treated as dimensionless per project convention but show the preferred
wording "torque per radian" or the inline unit notation, and also annotate any
reference to direct torque/effort with "[N·m]" for clarity.
In `@newton/_src/solvers/mujoco/solver_mujoco.py`:
- Around line 167-170: The docstring block describing joint target mappings
lacks explicit SI-unit annotations; update the text for Control.joint_target_ke,
Control.joint_target_kd, and Control.joint_target_vel (and any mentions of joint
targets in JointTargetMode.POSITION and JointTargetMode.POSITION_VELOCITY and
the VELOCITY entry) to include consistent SI units (e.g., velocities in m/s or
rad/s as appropriate, proportional gains in N·m/rad or N/m, damping in N·m·s/rad
or N·s/m) and use a uniform unit formatting style across entries so readers can
unambiguously interpret values.
In `@newton/_src/viewer/viewer.py`:
- Around line 486-487: The comment "Use red color for contact normals" disagrees
with the assigned color tuple; update the colors variable in viewer.py (the
colors assignment used for contact normals) to match the comment by setting it
to red (1.0, 0.0, 0.0), or alternatively change the comment to reflect the
current green value—preferably set colors = (1.0, 0.0, 0.0) so the comment and
the colors variable are consistent.
---
Nitpick comments:
In `@newton/_src/solvers/implicit_mpm/implicit_mpm_model.py`:
- Around line 245-254: The docstring and constructor parameter/attribute use the
stale name "options" and "self._options" after renaming to
SolverImplicitMPM.Config; update the Args section to refer to "config" (or
"cfg") and rename the __init__ parameter from options to config and the stored
attribute from self._options to self._config, then update all downstream reads
in this file that reference options.* or self._options.* to use config.* or
self._config.* (ensure references to the type use SolverImplicitMPM.Config in
the signature and docstring).
In `@newton/_src/viewer/viewer_viser.py`:
- Around line 438-439: The unused-argument warning for the parameter materials
should be suppressed by renaming it to _materials (or prefixing with an
underscore) in the function signature where it appears (same pattern used for
normals in log_mesh) so the linter recognizes it as intentionally unused; update
the signature that currently declares colors and materials (change materials to
_materials) and adjust any internal references accordingly (or leave unused) to
eliminate ARG002.
- Around line 340-342: The method signature includes the parameter "normals" to
satisfy the ViewerBase interface but currently triggers an unused-argument lint
(ARG002); to suppress it, rename the parameter to "_normals" in the function
definition (i.e., change "normals: wp.array(dtype=wp.vec3) | None = None" to
"_normals: ...") or add an inline noqa comment ("# noqa: ARG002") to that
parameter, and update any internal references (if any) to use the new name so
the signature still matches ViewerBase while eliminating the lint warning.
- Around line 464-465: log_instances is re-processing textures because it always
calls self._prepare_texture on mesh_data.get("texture") even though log_mesh
already stores the prepared result in self._meshes[name]["texture"]. Fix by
detecting prepared textures and skipping re-normalization: in log_instances
(where texture_image is set) use the value from mesh_data.get("texture")
directly if it matches the prepared texture type/marker that _prepare_texture
returns (or add/check a small flag/property), otherwise call
self._prepare_texture; update any code that sets self._meshes[name]["texture"]
in log_mesh to ensure it stores the prepared texture object/marker used for this
detection.
In `@newton/_src/viewer/viewer.py`:
- Around line 80-82: The attribute docstring for show_hydro_contact_surface is
currently a string literal placed after the assignment (fragile for non-Sphinx
tools); change it to a preceding inline doc comment using the Sphinx-recognized
"#:" style immediately above the assignment (replace the trailing triple-quoted
string with "#: Whether to show the hydroelastic contact surface wireframe.") so
IDEs and other doc tools will pick it up; update the same pattern if any similar
post-assignment string literals exist (e.g., checking picking_enabled) in
viewer.py.
- Around line 210-218: Ruff ARG002 flags unused parameters in the base no-op
methods set_camera and is_key_down; fix by either adding inline suppression
comments (e.g., append "# noqa: ARG002" to the parameter lists in the
definitions of set_camera and is_key_down) or by renaming the parameters to
underscore-prefixed names (_pos, _pitch, _yaw, _key) in the methods set_camera
and is_key_down so the linter recognizes them as intentionally unused while
keeping the interface intact.
In `@newton/examples/robot/example_robot_h1.py`:
- Line 72: The assignment uses an unnecessary int() cast because JointTargetMode
is an IntEnum; replace the expression in the assignment (h1.joint_target_mode[i]
= int(JointTargetMode.POSITION)) with a direct assignment of the enum value
(h1.joint_target_mode[i] = JointTargetMode.POSITION) so the IntEnum is used
directly without casting.
In `@newton/tests/test_implicit_mpm.py`:
- Around line 62-66: Rename the local variable currently named options to config
where you call SolverImplicitMPM.Config() (e.g., in the test functions that
create options = SolverImplicitMPM.Config()), updating the assignments and any
subsequent references (like options.grid_type, options.voxel_size, and the
SolverImplicitMPM(model, options) call) to use config instead; apply this rename
at both occurrences around the SolverImplicitMPM.Config() usages (the blocks at
lines shown in the review) so the variable name matches the Config type.
ℹ️ Review info
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (29)
docs/api/newton_usd.rstnewton/_src/geometry/narrow_phase.pynewton/_src/geometry/sdf_hydroelastic.pynewton/_src/sim/builder.pynewton/_src/sim/collide.pynewton/_src/sim/model.pynewton/_src/solvers/implicit_mpm/implicit_mpm_model.pynewton/_src/solvers/mujoco/kernels.pynewton/_src/solvers/mujoco/solver_mujoco.pynewton/_src/usd/utils.pynewton/_src/utils/import_mjcf.pynewton/_src/utils/import_usd.pynewton/_src/viewer/viewer.pynewton/_src/viewer/viewer_viser.pynewton/examples/robot/example_robot_allegro_hand.pynewton/examples/robot/example_robot_anymal_d.pynewton/examples/robot/example_robot_g1.pynewton/examples/robot/example_robot_h1.pynewton/examples/robot/example_robot_humanoid.pynewton/examples/robot/example_robot_panda_hydro.pynewton/examples/robot/example_robot_policy.pynewton/examples/robot/example_robot_ur10.pynewton/tests/test_hydroelastic.pynewton/tests/test_implicit_mpm.pynewton/tests/test_import_mjcf.pynewton/tests/test_import_usd.pynewton/tests/test_mujoco_general_actuators.pynewton/tests/test_robot_composer.pynewton/usd.py
💤 Files with no reviewable changes (2)
- docs/api/newton_usd.rst
- newton/usd.py
🚧 Files skipped from review as they are similar to previous changes (5)
- newton/_src/sim/model.py
- newton/_src/usd/utils.py
- newton/tests/test_hydroelastic.py
- newton/examples/robot/example_robot_anymal_d.py
- newton/examples/robot/example_robot_humanoid.py
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
- Removed nested class alias for HydroelasticSDF in documentation. - Updated references to HydroelasticSDF in the narrow phase and collision pipeline code. - Improved formatting of constants in API documentation. Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
* [Warp Raytrace] Added device parameter (newton-physics#1544) * [Warp Raytrace] Added device parameter to previously overlooked call (newton-physics#1545) * SolverMuJoCo: Fix tolerance clamping in update_solver_options_kernel (newton-physics#1546) * Change default shape_ke to align with MuJoCo, parse geom solref from MJCF for contact stiffness/damping (newton-physics#1491) Signed-off-by: Alain Denzler <adenzler@nvidia.com> * Fix log_shapes broadcasting for length-1 warp arrays (newton-physics#1550) * Fix XPBD restitution particle index (newton-physics#1557) * Out-of-Bound memory read in example_diffsim_bear newton-physics#1386 (newton-physics#1533) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add versioned documentation deployment to GitHub Pages (newton-physics#1560) * Fix broken documentation links after versioned docs deployment (newton-physics#1566) * VBD New Features (newton-physics#1479) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Add banners to membership verification workflow steps (newton-physics#1569) * Support cable junctions (newton-physics#1519) Signed-off-by: JC <jumyungc@nvidia.com> * Rename parameter I to inertia newton-physics#1543 (newton-physics#1551) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix example_robot_anymal_c_walk.py (newton-physics#1574) * Change everywhere linesearch to iterative (newton-physics#1573) * Remove standard collision pipeline (newton-physics#1538) * USD Plumbing MJC solver attributes through resolver and custom attribute framework (newton-physics#1463) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix child shape filtering (newton-physics#1559) * Fix ViewerRerun ignoring hidden parameter in log_mesh and log_instances (newton-physics#1555) * Make NxN and SAP broad phase respect filtered pairs (newton-physics#1554) * Add --quiet flag to examples to suppress Warp messages (newton-physics#1585) * Defer resolution of MESH_MAXHULLVERT default in importers (newton-physics#1587) * Fix TypeError when finalizing SDF geometry with device kwarg (newton-physics#1586) * Make MESH_MAXHULLVERT a static class attribute Mesh.MAX_HULL_VERTICES. (newton-physics#1598) * Significant non-determinism in unified collision pipeline for anymal_c_walking example newton-physics#1505 (newton-physics#1588) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add test for non-contiguous case (newton-physics#1549) * Fix nightly Warp CI to resolve pre-release builds (newton-physics#1606) * Verify default class and value handling (newton-physics#1556) * SolverMuJoCo: Expand geom_margin to avoid OOB read with heterogeneous worlds (newton-physics#1607) * Fix bug in control clear method (newton-physics#1602) * Enable Use of Newton IK in Lab newton-physics#662 (newton-physics#1539) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix import of non-articulated joints (newton-physics#1535) * Deduplicate _process_joint_custom_attributes frequency handling (newton-physics#1584) * Add CI check for stale API docs and fix local build warnings (newton-physics#1570) * Update Pillow 12.0.0 to 12.1.1 (newton-physics#1612) * Prepare handling of mimic constraints in Newton (newton-physics#1523) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support floating, base_joint and parent_body arguments for importers (newton-physics#1498) * Fix contact buffer memory overestimation (newton-physics#1614) * Configure banned-module-level-imports for ruff (newton-physics#1583) * Explicit `Contacts` instantiation with `Model.contacts()` and `CollisionPipeline.contacts()` (newton-physics#1445) * Fix the quadruped benchmark regression (newton-physics#1615) * Change default ignore_inertial_definitions from True to False (newton-physics#1537) * Finalize the Recording API (newton-physics#1600) * SolverMuJoCo: Fix ccd_iterations default (newton-physics#1631) * update gitignore to ignore Claude Code sandbox files (newton-physics#1628) * Add mimic joint support to SolverMuJoCo (newton-physics#1627) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add --no-cache-clear flag to test runner (newton-physics#1629) * Update MuJoCo and MuJoCo Warp to 3.5.0 release (newton-physics#1633) * Improve inertia parsing from USD (newton-physics#1605) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Remove standalone .typos.toml in favor of pyproject.toml config (newton-physics#1642) * Heightfield support newton-physics#1189 (newton-physics#1547) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Example_robot_policy: Replace ValueError with clean error for missing PhysX policy (newton-physics#1636) Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Avoid unnecessary inflation of the contact reduction voxel aabb (newton-physics#1650) * Rename num_worlds to world_count (newton-physics#1634) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support parsing autolimits from MJCF (newton-physics#1651) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix particle-shape restitution ignoring body velocity (newton-physics#1273) (newton-physics#1580) * Add overflow warnings for narrow-phase collision buffers (newton-physics#1643) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Documentation: add units to model/state docstrings (newton-physics#1649) * fix(viewer): add missing JointType.BALL support to contact line kernel (newton-physics#1640) * Make terrain mesh visual-only in anymal C walking example (newton-physics#1660) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Fix initialization of collider state in MPM finite difference mode (newton-physics#1652) * docs: document ModelBuilder.default_shape_cfg (newton-physics#1662) * Finalize the collision API (newton-physics#1581) * Remove hardcoded subnet ID from AWS workflow (newton-physics#1664) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Attempt to fix AWS config (newton-physics#1666) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Update AWS workflows to g7e.2xlarge with multi-AZ failover (newton-physics#1669) * fix(viewer-usd): disambiguate log_points colors for N=3 warp arrays (newton-physics#1661) * Viewer gl optimizations (newton-physics#1656) Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> * docs: add articulation workflow guidance and regression check (newton-physics#1663) * fix(examples): propagate IK solution to model state in Franka example (newton-physics#1637) * fix(deps,docs): bump nbconvert to 7.17.0 and fix ArticulationView doctest (newton-physics#1670) * Cleanup and improve some example (newton-physics#1625) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Handle zero-mass bodies and flip ensure_nonstatic_links default (newton-physics#1635) * Additional testing for ArticulationView (newton-physics#1527) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Update warp-lang nightly to 1.12.0.dev20260217 (newton-physics#1677) * Change default friction coefficients to match MuJoCo (newton-physics#1681) * Refactor mesh creation functions (newton-physics#1654) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Parse joint frictionloss from MJCF (newton-physics#1680) * Fix free joint body_pos and add ref/qpos0 support for MuJoCo solver (newton-physics#1645) * Fix root shapes in ArticulationView with fixed base (newton-physics#1639) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use model collision methods and remove `create_collision_pipeline` from examples (newton-physics#1648) Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> * Fix XPBD apply_joint_forces ignoring child joint transform (newton-physics#1582) * Adjust SDF API (newton-physics#1644) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Optimize test suite runtime (~18% faster) (newton-physics#1689) * Remove ensure_nonstatic_links option from importers (newton-physics#1682) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> * SolverMuJoCo: Add geom_margin support, align thickness default with MuJoCo and schemas (newton-physics#1653) * refactor: privatize non-public solver internals (newton-physics#1683) * Fix option parsing with multiple <option> elements from includes (newton-physics#1692) * Bump warp-lang nightly and newton-usd-schemas (newton-physics#1693) * Get rid of tkinter dependency (newton-physics#1676) * Fix SDF example contact buffer overflow (newton-physics#1695) * Fix implicit biastype for position/velocity actuator shortcuts (newton-physics#1678) * Fix include processor to respect meshdir/texturedir (newton-physics#1685) * Reduce cold-cache Warp compile time for geometry modules (newton-physics#1618) Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix xyzw-to-wxyz quaternion conversion in body inertia kernel (newton-physics#1694) * Rename key to label and add hierarchical labels (newton-physics#1592) (newton-physics#1632) * Expose geometry SDF helpers on public API (newton-physics#1684) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Improve custom frequency handling from USD, parse MuJoCo actuators and tendons (newton-physics#1510) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Collapse fixed joints with non articulated bodies (newton-physics#1608) * Fix renaming joint_key -> joint_label (newton-physics#1700) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Bump .python-version from 3.11 to 3.12 (newton-physics#1702) * Replace CITATION.md with CITATION.cff (newton-physics#1706) * Respect MJCF contype=conaffinity=0 via collision_group=0 (newton-physics#1703) * Make ViewerUSD reuse existing USD layers for the same output path (newton-physics#1704) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove dead up-axis conversion from MuJoCo solver (newton-physics#1707) * Skip IK cube stacking example test (newton-physics#1713) * Fix global pairs (world=-1) not exported to MuJoCo spec (newton-physics#1705) * Reduce the memory consumption of hydroelastic contacts (newton-physics#1609) * Fix flakiness cube stacking (newton-physics#1714) * Fix collision shapes not toggleable in viewer UI (newton-physics#1715) * Fix softbody examples table layout in README (newton-physics#1716) * Standardize sensor APIs: label matching, keyword args, and update() method naming (newton-physics#1665) * Fix intermittent crash in parallel test runner from Manager proxy race (newton-physics#1721) * Clean up inertia.py function arguments to match Mesh.create_* API (newton-physics#1719) * Reduce default test runner verbosity (newton-physics#1723) * Add menagerie comparison tests for SolverMuJoCo (newton-physics#1720) Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Add spatial tendon support for MuJoCo solver (newton-physics#1687) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Expose qfrc_actuator from mujoco (newton-physics#1698) * Skip non-MODEL custom attributes in finalize validation (newton-physics#1734) * Resolve inheritrange for position actuators in MJCF parser (newton-physics#1727) * Support dampratio for position/velocity actuator shortcuts (newton-physics#1722) * Limit concurrency to 1 (newton-physics#1736) * Add a helper method for checking applied usd (newton-physics#1731) * Enhance playback URL handling in ViewerViser (newton-physics#1742) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Removed RenderShapeType (newton-physics#1748) * Override only MassAPI attributes that have been authored (newton-physics#1688) * Integration of newton-actuators (newton-physics#1342) Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> * Fix ArticulationView crash with fixed-joint-only articulations (newton-physics#1726) * Improve retrieval of Jupyter base URL in ViewerViser (newton-physics#1750) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Disable dynamics testing for UR5e and Apollo tests to avoid CI flakiness (newton-physics#1755) * Margin and Gap rename (newton-physics#1732) * Vbd Demos Fixing (newton-physics#1740) * Fix ViewerViser.log_lines method (newton-physics#1764) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Update warp-lang dependency to 1.12.0rc1 (newton-physics#1763) * Fix fromto capsule/cylinder orientation in MJCF parser (newton-physics#1741) * fix: multi-world particle BVH indexing (newton-physics#1641) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Clean up unused and internal-only kwargs in SolverMuJoCo (newton-physics#1766) * Parsing of the mimic joint and contact gap/margin from newton schemas (newton-physics#1690) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> * API Refactor v2 (newton-physics#1749) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Support explicit geom mass attributes in MJCF (newton-physics#1744) * Bump flask and werkzeug in lockfile for security (newton-physics#1769) Co-authored-by: Cursor <cursoragent@cursor.com> * Split MJCF worldbody root bodies into separate articulations (newton-physics#1754) * Expose VBD rigid contact forces for solver coupling (newton-physics#1745) Signed-off-by: JC <jumyungc@nvidia.com> * Add MJCF ellipsoid geom import and regression test (newton-physics#1772) Co-authored-by: Cursor <cursoragent@cursor.com> * Weld equality constraints parsed from mjcf are given Nan as the default value of torquescale. The correct default should be 1.0 (newton-physics#1760) * Improve picking accuracy and stability (newton-physics#1712) * Franka cloth demo improvement (newton-physics#1765) * Support computing sensing object transforms & API cleanup (newton-physics#1759) * Remove threading workaround (newton-physics#1751) * [Warp Raytrace] Consolidated ray intersect functions, renamed Options to Config (newton-physics#1767) * Improve README example gallery for PyPI compatibility (newton-physics#1776) * Fix issue with mesh in rerun viewer (newton-physics#1768) * Add PhysxMimicJointAPI parsing to USD importer (newton-physics#1735) * Move some math functions to Warp (newton-physics#1717) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Add test to ensure MJCF xform argument is relative (newton-physics#1777) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Emit diaginertia instead of fullinertia for diagonal body inertia (newton-physics#1780) * Change default joint armature from 0.01 to 0 (newton-physics#1782) * Fix default kp/kv for position and velocity actuators (newton-physics#1786) * Lock body inertia after explicit MJCF <inertial> element (newton-physics#1784) * Fix for MJCF actuator custom attributes (newton-physics#1783) * Bump version to 0.2.3 Prepare the package metadata for the v0.2.3 release tag. * Fix ViewerRerun rendering of instances from hidden meshes (newton-physics#1788) * API cleanup (newton-physics#1789) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * BODY actuator target name bypasses body name de-duplication in SolverMuJoCo (newton-physics#1729) * Use default density for visual geoms in MJCF import (newton-physics#1781) * Fix GL viewer crash on Wayland (newton-physics#1793) * Make USD xform parameter control absolute articulation placement (newton-physics#1771) * Fix CUDA context corruption in SDF implementation (newton-physics#1792) * Bump mujoco-warp dependency to 3.5.0.2 (newton-physics#1779) * Fix MuJoCo margin/gap conversion (newton-physics#1785) * Bump version to 1.1.0.dev0 (newton-physics#1798) * Missing unittest.main added back to test_import_mjcf.py. Helps with F5 debugging in VS Code. (newton-physics#1796) * Improve H1 example (newton-physics#1801) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Fix ViewerViser.set_camera() (newton-physics#1805) * Rename examples to follow prefix-first naming convention (newton-physics#1802) * Improve MuJoCo actuator domain randomization (newton-physics#1773) * Restore in_cup test in hydro example (newton-physics#1775) * Fix `newton.geometry` imports and change of Mesh maxhullverts global constant * Adapt to having both margin and gap arrays for each geom/shape * Fix for newton.geometry API changes in primitive/narrowphase.py * Fix removal of `BroadPhaseMode` IntEnum and revert to newton-sytle string literals * WIP: Adapt geometry/unified.py to fix breaking changes to `newton.geometry` API * First pass of API adjustments * Patch more gaps (with respect to margin and gap renaming) * GeoType.SDF was removed - reflect that in Kamino * Introduce CoM position offsets w.r.t body frame and operations to convert between body CoM state and generic local body-fixed reference frames. * Add caching of per-entity labels/names/keys in the Model subcontainers * Remove SDF shape wrapper since it's now internal to mesh handling in CD pipelines * Fix USD test assets * Add Newton <--> Kamino joint type conversion operations and per-space default limit constants * Add some cleanup to geometry and unified CD + UTs * Add Newton <--> Kamino shape type conversion operations * Apply new default joint coord limit constants to limits.py * Adapt foubrar model builder and USD asset to produce the same result in sim example * Purge "physical" goems and collapse all into a single group, and purge geometry "layers" * Disable allocation per-joint wrenches by default and make them optional * Make `Model` a dataclass * Separate ModelData* containers into own `core/data.py` module * Fix imports of ModelData * Rename `Model` as `ModelKamino` * Rename `ModelData` as `DataKamino` * Rename `State` as `StateKamino` * Rename `Control` as `ControlKamino` * Rename `Limits` as `LimitsKamino` * Rename `Contacts` as `ContactsKamino` * Rename `ModelBuilder` as `ModelBuilderKamino` * Make imports in test utilities relative * Revise CD meta-data attributes and their computation in GeometryModel and ModelBuilderKamino * Revise primitive CD pipeline * Revise unified CD pipeline * Revise CD front-end interfaces * Fix UTs and relevant utils for interface changes to CD * Change to `wp.DeviceLike` to account for upcoming deprecation of `Devicelike` * Depracate legacy HDF5 data io (will be replaced in the future) * Fix banned imports at module level * Modify USD importer to detect articulations and order geoms and joints similarly to how the Newton `parse_usd` function does. * Add conversion operation from `newton.Model` to `ModelKamino` * Add data, state and control container conversions * Add SolverKamino wrapper that fullfils newton integration interface * Add newton integration examples * Add SolverKamino to newton solver module imports * WIP: fix problem with lambda_j being allocated for only kinematic constraints and failing on array copying * Fix banned git import in benchmark * Rename *Settings to *Config (#213) * Rename SolverKaminoSettings -> SolverKaminoConfig * Rename DualProblemSettings -> DualProblemConfig * Rename CollisionDetectorSettings -> CollisionDetectorConfig * Rename PADMMSettings -> PADMMConfig * Rename ForwardKinematicsSolverSettings -> ForwardKinematicsSolverConfig * Rename SimulatorSettings -> SimulatorConfig * Add check for model compatibility in SolverKamino (#209) * Fix device assignment in sparse CG test on CPU (#216) * Replace Enum-type config attributes with Literal (#215) * Replace warmstart mode config param with literal * Replace contact warmstart mode config param with literal * Replace rotation correction config param with literal * Replace penalty update config param with literal * Replace FK preconditioner option config param with literal * Add post-init checks for dual/PADMM configs * Rename FKPreconditionerOptions to FKPreconditionerType * Remove WorldDescriptor from ModelKamino (#219) * Add geom index offset array to model info * Replace access to world description in model * Remove world descriptor from model * Fix computation of kinematics residual with sparse Jacobian (#220) * Migrates `ModelKaminoSize` to it's own module to avoid circular dependency between core/model.py and core/state.py and rename it as `SizeKamino`. * WIP: Fix SolverKamino wrapper * Fix circular dependency in conversions.py * Fix some broken unit tests and WIP to fix fourbar contact conversions and rendering * Make some conversions @staticmethods instead, because they dont need common class attributes * Fix declaration of custom state attributes and their conversion to/from newton and kamino * WIP: Debug model conversion and newton sim examples * Rename and cleanup start index array of per-world geoms * Model conversion and newton sim examples now work. * Make gravity conversion operation re-usable * Migrates boxes_fourbar builder using newton.ModelBuilder to it's own module to prepare for migration. * Use gravity conversion utility func in SolverKamino * Add reusable joint-parameterization conversion utility * Remove world-descriptor from model converter * Rename helper converter that handles entity-local transforms * Add some cleanup to DR Legs, ANYmal D and basic four-bar examples * Fix module-level imports of additional kamino-specific development dependencies * Fix module-level imports of additional kamino-specific development dependencies * Fix erroneous merge conflict. --------- Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Signed-off-by: JC <jumyungc@nvidia.com> Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: Daniela Hase <116915287+daniela-hase@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> Co-authored-by: Eric Shi <97630937+shi-eric@users.noreply.github.com> Co-authored-by: Anka Chen <AnkaChan@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: JC-nvidia <116605903+jumyungc@users.noreply.github.com> Co-authored-by: Kenny Vilella <kvilella@nvidia.com> Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> Co-authored-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Lennart Röstel <65088822+lenroe@users.noreply.github.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: camevor <camevor@nvidia.com> Co-authored-by: mzamoramora-nvidia <mzamoramora@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alessandro Roncone <alecive87@gmail.com> Co-authored-by: gdaviet <57617656+gdaviet@users.noreply.github.com> Co-authored-by: Miles Macklin <mmacklin@nvidia.com> Co-authored-by: Gordon Yeoman <gyeomannvidia@users.noreply.github.com> Co-authored-by: Lukasz Wawrzyniak <lwawrzyniak@nvidia.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Lorenzo Terenzi <lorenzoterenzi96@gmail.com> Co-authored-by: smollerNV <164020096+smollerNV@users.noreply.github.com> Co-authored-by: twidmer <twidmer@nvidia.com> Co-authored-by: Christian Schumacher <christian.schumacher@disney.com> Co-authored-by: Guirec-Maloisel <25688871+Guirec-Maloisel@users.noreply.github.com>
* [Warp Raytrace] Added device parameter (newton-physics#1544) * [Warp Raytrace] Added device parameter to previously overlooked call (newton-physics#1545) * SolverMuJoCo: Fix tolerance clamping in update_solver_options_kernel (newton-physics#1546) * Change default shape_ke to align with MuJoCo, parse geom solref from MJCF for contact stiffness/damping (newton-physics#1491) Signed-off-by: Alain Denzler <adenzler@nvidia.com> * Fix log_shapes broadcasting for length-1 warp arrays (newton-physics#1550) * Fix XPBD restitution particle index (newton-physics#1557) * Out-of-Bound memory read in example_diffsim_bear newton-physics#1386 (newton-physics#1533) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add versioned documentation deployment to GitHub Pages (newton-physics#1560) * Fix broken documentation links after versioned docs deployment (newton-physics#1566) * VBD New Features (newton-physics#1479) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Add banners to membership verification workflow steps (newton-physics#1569) * Support cable junctions (newton-physics#1519) Signed-off-by: JC <jumyungc@nvidia.com> * Rename parameter I to inertia newton-physics#1543 (newton-physics#1551) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix example_robot_anymal_c_walk.py (newton-physics#1574) * Change everywhere linesearch to iterative (newton-physics#1573) * Remove standard collision pipeline (newton-physics#1538) * USD Plumbing MJC solver attributes through resolver and custom attribute framework (newton-physics#1463) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix child shape filtering (newton-physics#1559) * Fix ViewerRerun ignoring hidden parameter in log_mesh and log_instances (newton-physics#1555) * Make NxN and SAP broad phase respect filtered pairs (newton-physics#1554) * Add --quiet flag to examples to suppress Warp messages (newton-physics#1585) * Defer resolution of MESH_MAXHULLVERT default in importers (newton-physics#1587) * Fix TypeError when finalizing SDF geometry with device kwarg (newton-physics#1586) * Make MESH_MAXHULLVERT a static class attribute Mesh.MAX_HULL_VERTICES. (newton-physics#1598) * Significant non-determinism in unified collision pipeline for anymal_c_walking example newton-physics#1505 (newton-physics#1588) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add test for non-contiguous case (newton-physics#1549) * Fix nightly Warp CI to resolve pre-release builds (newton-physics#1606) * Verify default class and value handling (newton-physics#1556) * SolverMuJoCo: Expand geom_margin to avoid OOB read with heterogeneous worlds (newton-physics#1607) * Fix bug in control clear method (newton-physics#1602) * Enable Use of Newton IK in Lab newton-physics#662 (newton-physics#1539) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix import of non-articulated joints (newton-physics#1535) * Deduplicate _process_joint_custom_attributes frequency handling (newton-physics#1584) * Add CI check for stale API docs and fix local build warnings (newton-physics#1570) * Update Pillow 12.0.0 to 12.1.1 (newton-physics#1612) * Prepare handling of mimic constraints in Newton (newton-physics#1523) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support floating, base_joint and parent_body arguments for importers (newton-physics#1498) * Fix contact buffer memory overestimation (newton-physics#1614) * Configure banned-module-level-imports for ruff (newton-physics#1583) * Explicit `Contacts` instantiation with `Model.contacts()` and `CollisionPipeline.contacts()` (newton-physics#1445) * Fix the quadruped benchmark regression (newton-physics#1615) * Change default ignore_inertial_definitions from True to False (newton-physics#1537) * Finalize the Recording API (newton-physics#1600) * SolverMuJoCo: Fix ccd_iterations default (newton-physics#1631) * update gitignore to ignore Claude Code sandbox files (newton-physics#1628) * Add mimic joint support to SolverMuJoCo (newton-physics#1627) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add --no-cache-clear flag to test runner (newton-physics#1629) * Update MuJoCo and MuJoCo Warp to 3.5.0 release (newton-physics#1633) * Improve inertia parsing from USD (newton-physics#1605) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Remove standalone .typos.toml in favor of pyproject.toml config (newton-physics#1642) * Heightfield support newton-physics#1189 (newton-physics#1547) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Example_robot_policy: Replace ValueError with clean error for missing PhysX policy (newton-physics#1636) Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Avoid unnecessary inflation of the contact reduction voxel aabb (newton-physics#1650) * Rename num_worlds to world_count (newton-physics#1634) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support parsing autolimits from MJCF (newton-physics#1651) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix particle-shape restitution ignoring body velocity (newton-physics#1273) (newton-physics#1580) * Add overflow warnings for narrow-phase collision buffers (newton-physics#1643) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Documentation: add units to model/state docstrings (newton-physics#1649) * fix(viewer): add missing JointType.BALL support to contact line kernel (newton-physics#1640) * Make terrain mesh visual-only in anymal C walking example (newton-physics#1660) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Fix initialization of collider state in MPM finite difference mode (newton-physics#1652) * docs: document ModelBuilder.default_shape_cfg (newton-physics#1662) * Finalize the collision API (newton-physics#1581) * Remove hardcoded subnet ID from AWS workflow (newton-physics#1664) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Attempt to fix AWS config (newton-physics#1666) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Update AWS workflows to g7e.2xlarge with multi-AZ failover (newton-physics#1669) * fix(viewer-usd): disambiguate log_points colors for N=3 warp arrays (newton-physics#1661) * Viewer gl optimizations (newton-physics#1656) Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> * docs: add articulation workflow guidance and regression check (newton-physics#1663) * fix(examples): propagate IK solution to model state in Franka example (newton-physics#1637) * fix(deps,docs): bump nbconvert to 7.17.0 and fix ArticulationView doctest (newton-physics#1670) * Cleanup and improve some example (newton-physics#1625) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Handle zero-mass bodies and flip ensure_nonstatic_links default (newton-physics#1635) * Additional testing for ArticulationView (newton-physics#1527) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Update warp-lang nightly to 1.12.0.dev20260217 (newton-physics#1677) * Change default friction coefficients to match MuJoCo (newton-physics#1681) * Refactor mesh creation functions (newton-physics#1654) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Parse joint frictionloss from MJCF (newton-physics#1680) * Fix free joint body_pos and add ref/qpos0 support for MuJoCo solver (newton-physics#1645) * Fix root shapes in ArticulationView with fixed base (newton-physics#1639) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use model collision methods and remove `create_collision_pipeline` from examples (newton-physics#1648) Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> * Fix XPBD apply_joint_forces ignoring child joint transform (newton-physics#1582) * Adjust SDF API (newton-physics#1644) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Optimize test suite runtime (~18% faster) (newton-physics#1689) * Remove ensure_nonstatic_links option from importers (newton-physics#1682) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> * SolverMuJoCo: Add geom_margin support, align thickness default with MuJoCo and schemas (newton-physics#1653) * refactor: privatize non-public solver internals (newton-physics#1683) * Fix option parsing with multiple <option> elements from includes (newton-physics#1692) * Bump warp-lang nightly and newton-usd-schemas (newton-physics#1693) * Get rid of tkinter dependency (newton-physics#1676) * Fix SDF example contact buffer overflow (newton-physics#1695) * Fix implicit biastype for position/velocity actuator shortcuts (newton-physics#1678) * Fix include processor to respect meshdir/texturedir (newton-physics#1685) * Reduce cold-cache Warp compile time for geometry modules (newton-physics#1618) Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix xyzw-to-wxyz quaternion conversion in body inertia kernel (newton-physics#1694) * Rename key to label and add hierarchical labels (newton-physics#1592) (newton-physics#1632) * Expose geometry SDF helpers on public API (newton-physics#1684) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Improve custom frequency handling from USD, parse MuJoCo actuators and tendons (newton-physics#1510) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Collapse fixed joints with non articulated bodies (newton-physics#1608) * Fix renaming joint_key -> joint_label (newton-physics#1700) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Bump .python-version from 3.11 to 3.12 (newton-physics#1702) * Replace CITATION.md with CITATION.cff (newton-physics#1706) * Respect MJCF contype=conaffinity=0 via collision_group=0 (newton-physics#1703) * Make ViewerUSD reuse existing USD layers for the same output path (newton-physics#1704) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove dead up-axis conversion from MuJoCo solver (newton-physics#1707) * Skip IK cube stacking example test (newton-physics#1713) * Fix global pairs (world=-1) not exported to MuJoCo spec (newton-physics#1705) * Reduce the memory consumption of hydroelastic contacts (newton-physics#1609) * Fix flakiness cube stacking (newton-physics#1714) * Fix collision shapes not toggleable in viewer UI (newton-physics#1715) * Fix softbody examples table layout in README (newton-physics#1716) * Standardize sensor APIs: label matching, keyword args, and update() method naming (newton-physics#1665) * Fix intermittent crash in parallel test runner from Manager proxy race (newton-physics#1721) * Clean up inertia.py function arguments to match Mesh.create_* API (newton-physics#1719) * Reduce default test runner verbosity (newton-physics#1723) * Add menagerie comparison tests for SolverMuJoCo (newton-physics#1720) Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Add spatial tendon support for MuJoCo solver (newton-physics#1687) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Expose qfrc_actuator from mujoco (newton-physics#1698) * Skip non-MODEL custom attributes in finalize validation (newton-physics#1734) * Resolve inheritrange for position actuators in MJCF parser (newton-physics#1727) * Support dampratio for position/velocity actuator shortcuts (newton-physics#1722) * Limit concurrency to 1 (newton-physics#1736) * Add a helper method for checking applied usd (newton-physics#1731) * Enhance playback URL handling in ViewerViser (newton-physics#1742) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Removed RenderShapeType (newton-physics#1748) * Override only MassAPI attributes that have been authored (newton-physics#1688) * Integration of newton-actuators (newton-physics#1342) Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> * Fix ArticulationView crash with fixed-joint-only articulations (newton-physics#1726) * Improve retrieval of Jupyter base URL in ViewerViser (newton-physics#1750) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Disable dynamics testing for UR5e and Apollo tests to avoid CI flakiness (newton-physics#1755) * Margin and Gap rename (newton-physics#1732) * Vbd Demos Fixing (newton-physics#1740) * Fix ViewerViser.log_lines method (newton-physics#1764) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Update warp-lang dependency to 1.12.0rc1 (newton-physics#1763) * Fix fromto capsule/cylinder orientation in MJCF parser (newton-physics#1741) * fix: multi-world particle BVH indexing (newton-physics#1641) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Clean up unused and internal-only kwargs in SolverMuJoCo (newton-physics#1766) * Parsing of the mimic joint and contact gap/margin from newton schemas (newton-physics#1690) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> * API Refactor v2 (newton-physics#1749) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Support explicit geom mass attributes in MJCF (newton-physics#1744) * Bump flask and werkzeug in lockfile for security (newton-physics#1769) Co-authored-by: Cursor <cursoragent@cursor.com> * Split MJCF worldbody root bodies into separate articulations (newton-physics#1754) * Expose VBD rigid contact forces for solver coupling (newton-physics#1745) Signed-off-by: JC <jumyungc@nvidia.com> * Add MJCF ellipsoid geom import and regression test (newton-physics#1772) Co-authored-by: Cursor <cursoragent@cursor.com> * Weld equality constraints parsed from mjcf are given Nan as the default value of torquescale. The correct default should be 1.0 (newton-physics#1760) * Improve picking accuracy and stability (newton-physics#1712) * Franka cloth demo improvement (newton-physics#1765) * Support computing sensing object transforms & API cleanup (newton-physics#1759) * Remove threading workaround (newton-physics#1751) * [Warp Raytrace] Consolidated ray intersect functions, renamed Options to Config (newton-physics#1767) * Improve README example gallery for PyPI compatibility (newton-physics#1776) * Fix issue with mesh in rerun viewer (newton-physics#1768) * Add PhysxMimicJointAPI parsing to USD importer (newton-physics#1735) * Move some math functions to Warp (newton-physics#1717) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Add test to ensure MJCF xform argument is relative (newton-physics#1777) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Emit diaginertia instead of fullinertia for diagonal body inertia (newton-physics#1780) * Change default joint armature from 0.01 to 0 (newton-physics#1782) * Fix default kp/kv for position and velocity actuators (newton-physics#1786) * Lock body inertia after explicit MJCF <inertial> element (newton-physics#1784) * Fix for MJCF actuator custom attributes (newton-physics#1783) * Bump version to 0.2.3 Prepare the package metadata for the v0.2.3 release tag. * Fix ViewerRerun rendering of instances from hidden meshes (newton-physics#1788) * API cleanup (newton-physics#1789) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * BODY actuator target name bypasses body name de-duplication in SolverMuJoCo (newton-physics#1729) * Use default density for visual geoms in MJCF import (newton-physics#1781) * Fix GL viewer crash on Wayland (newton-physics#1793) * Make USD xform parameter control absolute articulation placement (newton-physics#1771) * Fix CUDA context corruption in SDF implementation (newton-physics#1792) * Bump mujoco-warp dependency to 3.5.0.2 (newton-physics#1779) * Fix MuJoCo margin/gap conversion (newton-physics#1785) * Bump version to 1.1.0.dev0 (newton-physics#1798) * Missing unittest.main added back to test_import_mjcf.py. Helps with F5 debugging in VS Code. (newton-physics#1796) * Improve H1 example (newton-physics#1801) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Fix ViewerViser.set_camera() (newton-physics#1805) * Rename examples to follow prefix-first naming convention (newton-physics#1802) * Improve MuJoCo actuator domain randomization (newton-physics#1773) * Restore in_cup test in hydro example (newton-physics#1775) * Fix `newton.geometry` imports and change of Mesh maxhullverts global constant * Adapt to having both margin and gap arrays for each geom/shape * Fix for newton.geometry API changes in primitive/narrowphase.py * Fix removal of `BroadPhaseMode` IntEnum and revert to newton-sytle string literals * WIP: Adapt geometry/unified.py to fix breaking changes to `newton.geometry` API * First pass of API adjustments * Patch more gaps (with respect to margin and gap renaming) * GeoType.SDF was removed - reflect that in Kamino * Introduce CoM position offsets w.r.t body frame and operations to convert between body CoM state and generic local body-fixed reference frames. * Add caching of per-entity labels/names/keys in the Model subcontainers * Remove SDF shape wrapper since it's now internal to mesh handling in CD pipelines * Fix USD test assets * Add Newton <--> Kamino joint type conversion operations and per-space default limit constants * Add some cleanup to geometry and unified CD + UTs * Add Newton <--> Kamino shape type conversion operations * Apply new default joint coord limit constants to limits.py * Adapt foubrar model builder and USD asset to produce the same result in sim example * Purge "physical" goems and collapse all into a single group, and purge geometry "layers" * Disable allocation per-joint wrenches by default and make them optional * Make `Model` a dataclass * Separate ModelData* containers into own `core/data.py` module * Fix imports of ModelData * Rename `Model` as `ModelKamino` * Rename `ModelData` as `DataKamino` * Rename `State` as `StateKamino` * Rename `Control` as `ControlKamino` * Rename `Limits` as `LimitsKamino` * Rename `Contacts` as `ContactsKamino` * Rename `ModelBuilder` as `ModelBuilderKamino` * Make imports in test utilities relative * Revise CD meta-data attributes and their computation in GeometryModel and ModelBuilderKamino * Revise primitive CD pipeline * Revise unified CD pipeline * Revise CD front-end interfaces * Fix UTs and relevant utils for interface changes to CD * Change to `wp.DeviceLike` to account for upcoming deprecation of `Devicelike` * Depracate legacy HDF5 data io (will be replaced in the future) * Fix banned imports at module level * Modify USD importer to detect articulations and order geoms and joints similarly to how the Newton `parse_usd` function does. * Add conversion operation from `newton.Model` to `ModelKamino` * Add data, state and control container conversions * Add SolverKamino wrapper that fullfils newton integration interface * Add newton integration examples * Add SolverKamino to newton solver module imports * WIP: fix problem with lambda_j being allocated for only kinematic constraints and failing on array copying * Fix banned git import in benchmark * Rename *Settings to *Config (#213) * Rename SolverKaminoSettings -> SolverKaminoConfig * Rename DualProblemSettings -> DualProblemConfig * Rename CollisionDetectorSettings -> CollisionDetectorConfig * Rename PADMMSettings -> PADMMConfig * Rename ForwardKinematicsSolverSettings -> ForwardKinematicsSolverConfig * Rename SimulatorSettings -> SimulatorConfig * Add check for model compatibility in SolverKamino (#209) * Fix device assignment in sparse CG test on CPU (#216) * Replace Enum-type config attributes with Literal (#215) * Replace warmstart mode config param with literal * Replace contact warmstart mode config param with literal * Replace rotation correction config param with literal * Replace penalty update config param with literal * Replace FK preconditioner option config param with literal * Add post-init checks for dual/PADMM configs * Rename FKPreconditionerOptions to FKPreconditionerType * Remove WorldDescriptor from ModelKamino (#219) * Add geom index offset array to model info * Replace access to world description in model * Remove world descriptor from model * Fix computation of kinematics residual with sparse Jacobian (#220) * Migrates `ModelKaminoSize` to it's own module to avoid circular dependency between core/model.py and core/state.py and rename it as `SizeKamino`. * WIP: Fix SolverKamino wrapper * Fix circular dependency in conversions.py * Fix some broken unit tests and WIP to fix fourbar contact conversions and rendering * Make some conversions @staticmethods instead, because they dont need common class attributes * Fix declaration of custom state attributes and their conversion to/from newton and kamino * WIP: Debug model conversion and newton sim examples * Rename and cleanup start index array of per-world geoms * Model conversion and newton sim examples now work. * Make gravity conversion operation re-usable * Migrates boxes_fourbar builder using newton.ModelBuilder to it's own module to prepare for migration. * Use gravity conversion utility func in SolverKamino * Add reusable joint-parameterization conversion utility * Remove world-descriptor from model converter * Rename helper converter that handles entity-local transforms * Add some cleanup to DR Legs, ANYmal D and basic four-bar examples * Fix module-level imports of additional kamino-specific development dependencies * Fix module-level imports of additional kamino-specific development dependencies * Fix erroneous merge conflict. --------- Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Signed-off-by: JC <jumyungc@nvidia.com> Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: Daniela Hase <116915287+daniela-hase@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> Co-authored-by: Eric Shi <97630937+shi-eric@users.noreply.github.com> Co-authored-by: Anka Chen <AnkaChan@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: JC-nvidia <116605903+jumyungc@users.noreply.github.com> Co-authored-by: Kenny Vilella <kvilella@nvidia.com> Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> Co-authored-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Lennart Röstel <65088822+lenroe@users.noreply.github.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: camevor <camevor@nvidia.com> Co-authored-by: mzamoramora-nvidia <mzamoramora@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alessandro Roncone <alecive87@gmail.com> Co-authored-by: gdaviet <57617656+gdaviet@users.noreply.github.com> Co-authored-by: Miles Macklin <mmacklin@nvidia.com> Co-authored-by: Gordon Yeoman <gyeomannvidia@users.noreply.github.com> Co-authored-by: Lukasz Wawrzyniak <lwawrzyniak@nvidia.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Lorenzo Terenzi <lorenzoterenzi96@gmail.com> Co-authored-by: smollerNV <164020096+smollerNV@users.noreply.github.com> Co-authored-by: twidmer <twidmer@nvidia.com> Co-authored-by: Christian Schumacher <christian.schumacher@disney.com> Co-authored-by: Guirec-Maloisel <25688871+Guirec-Maloisel@users.noreply.github.com>
* [Warp Raytrace] Added device parameter (newton-physics#1544) * [Warp Raytrace] Added device parameter to previously overlooked call (newton-physics#1545) * SolverMuJoCo: Fix tolerance clamping in update_solver_options_kernel (newton-physics#1546) * Change default shape_ke to align with MuJoCo, parse geom solref from MJCF for contact stiffness/damping (newton-physics#1491) Signed-off-by: Alain Denzler <adenzler@nvidia.com> * Fix log_shapes broadcasting for length-1 warp arrays (newton-physics#1550) * Fix XPBD restitution particle index (newton-physics#1557) * Out-of-Bound memory read in example_diffsim_bear newton-physics#1386 (newton-physics#1533) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add versioned documentation deployment to GitHub Pages (newton-physics#1560) * Fix broken documentation links after versioned docs deployment (newton-physics#1566) * VBD New Features (newton-physics#1479) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Add banners to membership verification workflow steps (newton-physics#1569) * Support cable junctions (newton-physics#1519) Signed-off-by: JC <jumyungc@nvidia.com> * Rename parameter I to inertia newton-physics#1543 (newton-physics#1551) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix example_robot_anymal_c_walk.py (newton-physics#1574) * Change everywhere linesearch to iterative (newton-physics#1573) * Remove standard collision pipeline (newton-physics#1538) * USD Plumbing MJC solver attributes through resolver and custom attribute framework (newton-physics#1463) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix child shape filtering (newton-physics#1559) * Fix ViewerRerun ignoring hidden parameter in log_mesh and log_instances (newton-physics#1555) * Make NxN and SAP broad phase respect filtered pairs (newton-physics#1554) * Add --quiet flag to examples to suppress Warp messages (newton-physics#1585) * Defer resolution of MESH_MAXHULLVERT default in importers (newton-physics#1587) * Fix TypeError when finalizing SDF geometry with device kwarg (newton-physics#1586) * Make MESH_MAXHULLVERT a static class attribute Mesh.MAX_HULL_VERTICES. (newton-physics#1598) * Significant non-determinism in unified collision pipeline for anymal_c_walking example newton-physics#1505 (newton-physics#1588) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add test for non-contiguous case (newton-physics#1549) * Fix nightly Warp CI to resolve pre-release builds (newton-physics#1606) * Verify default class and value handling (newton-physics#1556) * SolverMuJoCo: Expand geom_margin to avoid OOB read with heterogeneous worlds (newton-physics#1607) * Fix bug in control clear method (newton-physics#1602) * Enable Use of Newton IK in Lab newton-physics#662 (newton-physics#1539) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix import of non-articulated joints (newton-physics#1535) * Deduplicate _process_joint_custom_attributes frequency handling (newton-physics#1584) * Add CI check for stale API docs and fix local build warnings (newton-physics#1570) * Update Pillow 12.0.0 to 12.1.1 (newton-physics#1612) * Prepare handling of mimic constraints in Newton (newton-physics#1523) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support floating, base_joint and parent_body arguments for importers (newton-physics#1498) * Fix contact buffer memory overestimation (newton-physics#1614) * Configure banned-module-level-imports for ruff (newton-physics#1583) * Explicit `Contacts` instantiation with `Model.contacts()` and `CollisionPipeline.contacts()` (newton-physics#1445) * Fix the quadruped benchmark regression (newton-physics#1615) * Change default ignore_inertial_definitions from True to False (newton-physics#1537) * Finalize the Recording API (newton-physics#1600) * SolverMuJoCo: Fix ccd_iterations default (newton-physics#1631) * update gitignore to ignore Claude Code sandbox files (newton-physics#1628) * Add mimic joint support to SolverMuJoCo (newton-physics#1627) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Add --no-cache-clear flag to test runner (newton-physics#1629) * Update MuJoCo and MuJoCo Warp to 3.5.0 release (newton-physics#1633) * Improve inertia parsing from USD (newton-physics#1605) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Remove standalone .typos.toml in favor of pyproject.toml config (newton-physics#1642) * Heightfield support newton-physics#1189 (newton-physics#1547) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Example_robot_policy: Replace ValueError with clean error for missing PhysX policy (newton-physics#1636) Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Avoid unnecessary inflation of the contact reduction voxel aabb (newton-physics#1650) * Rename num_worlds to world_count (newton-physics#1634) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Support parsing autolimits from MJCF (newton-physics#1651) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Fix particle-shape restitution ignoring body velocity (newton-physics#1273) (newton-physics#1580) * Add overflow warnings for narrow-phase collision buffers (newton-physics#1643) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Documentation: add units to model/state docstrings (newton-physics#1649) * fix(viewer): add missing JointType.BALL support to contact line kernel (newton-physics#1640) * Make terrain mesh visual-only in anymal C walking example (newton-physics#1660) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Fix initialization of collider state in MPM finite difference mode (newton-physics#1652) * docs: document ModelBuilder.default_shape_cfg (newton-physics#1662) * Finalize the collision API (newton-physics#1581) * Remove hardcoded subnet ID from AWS workflow (newton-physics#1664) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Attempt to fix AWS config (newton-physics#1666) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Update AWS workflows to g7e.2xlarge with multi-AZ failover (newton-physics#1669) * fix(viewer-usd): disambiguate log_points colors for N=3 warp arrays (newton-physics#1661) * Viewer gl optimizations (newton-physics#1656) Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> * docs: add articulation workflow guidance and regression check (newton-physics#1663) * fix(examples): propagate IK solution to model state in Franka example (newton-physics#1637) * fix(deps,docs): bump nbconvert to 7.17.0 and fix ArticulationView doctest (newton-physics#1670) * Cleanup and improve some example (newton-physics#1625) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Handle zero-mass bodies and flip ensure_nonstatic_links default (newton-physics#1635) * Additional testing for ArticulationView (newton-physics#1527) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Update warp-lang nightly to 1.12.0.dev20260217 (newton-physics#1677) * Change default friction coefficients to match MuJoCo (newton-physics#1681) * Refactor mesh creation functions (newton-physics#1654) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Parse joint frictionloss from MJCF (newton-physics#1680) * Fix free joint body_pos and add ref/qpos0 support for MuJoCo solver (newton-physics#1645) * Fix root shapes in ArticulationView with fixed base (newton-physics#1639) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Use model collision methods and remove `create_collision_pipeline` from examples (newton-physics#1648) Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> * Fix XPBD apply_joint_forces ignoring child joint transform (newton-physics#1582) * Adjust SDF API (newton-physics#1644) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Optimize test suite runtime (~18% faster) (newton-physics#1689) * Remove ensure_nonstatic_links option from importers (newton-physics#1682) Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> * SolverMuJoCo: Add geom_margin support, align thickness default with MuJoCo and schemas (newton-physics#1653) * refactor: privatize non-public solver internals (newton-physics#1683) * Fix option parsing with multiple <option> elements from includes (newton-physics#1692) * Bump warp-lang nightly and newton-usd-schemas (newton-physics#1693) * Get rid of tkinter dependency (newton-physics#1676) * Fix SDF example contact buffer overflow (newton-physics#1695) * Fix implicit biastype for position/velocity actuator shortcuts (newton-physics#1678) * Fix include processor to respect meshdir/texturedir (newton-physics#1685) * Reduce cold-cache Warp compile time for geometry modules (newton-physics#1618) Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> * Fix xyzw-to-wxyz quaternion conversion in body inertia kernel (newton-physics#1694) * Rename key to label and add hierarchical labels (newton-physics#1592) (newton-physics#1632) * Expose geometry SDF helpers on public API (newton-physics#1684) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Improve custom frequency handling from USD, parse MuJoCo actuators and tendons (newton-physics#1510) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Collapse fixed joints with non articulated bodies (newton-physics#1608) * Fix renaming joint_key -> joint_label (newton-physics#1700) Signed-off-by: Eric Heiden <eheiden@nvidia.com> * Bump .python-version from 3.11 to 3.12 (newton-physics#1702) * Replace CITATION.md with CITATION.cff (newton-physics#1706) * Respect MJCF contype=conaffinity=0 via collision_group=0 (newton-physics#1703) * Make ViewerUSD reuse existing USD layers for the same output path (newton-physics#1704) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove dead up-axis conversion from MuJoCo solver (newton-physics#1707) * Skip IK cube stacking example test (newton-physics#1713) * Fix global pairs (world=-1) not exported to MuJoCo spec (newton-physics#1705) * Reduce the memory consumption of hydroelastic contacts (newton-physics#1609) * Fix flakiness cube stacking (newton-physics#1714) * Fix collision shapes not toggleable in viewer UI (newton-physics#1715) * Fix softbody examples table layout in README (newton-physics#1716) * Standardize sensor APIs: label matching, keyword args, and update() method naming (newton-physics#1665) * Fix intermittent crash in parallel test runner from Manager proxy race (newton-physics#1721) * Clean up inertia.py function arguments to match Mesh.create_* API (newton-physics#1719) * Reduce default test runner verbosity (newton-physics#1723) * Add menagerie comparison tests for SolverMuJoCo (newton-physics#1720) Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> * Add spatial tendon support for MuJoCo solver (newton-physics#1687) Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> * Expose qfrc_actuator from mujoco (newton-physics#1698) * Skip non-MODEL custom attributes in finalize validation (newton-physics#1734) * Resolve inheritrange for position actuators in MJCF parser (newton-physics#1727) * Support dampratio for position/velocity actuator shortcuts (newton-physics#1722) * Limit concurrency to 1 (newton-physics#1736) * Add a helper method for checking applied usd (newton-physics#1731) * Enhance playback URL handling in ViewerViser (newton-physics#1742) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Removed RenderShapeType (newton-physics#1748) * Override only MassAPI attributes that have been authored (newton-physics#1688) * Integration of newton-actuators (newton-physics#1342) Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> * Fix ArticulationView crash with fixed-joint-only articulations (newton-physics#1726) * Improve retrieval of Jupyter base URL in ViewerViser (newton-physics#1750) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Disable dynamics testing for UR5e and Apollo tests to avoid CI flakiness (newton-physics#1755) * Margin and Gap rename (newton-physics#1732) * Vbd Demos Fixing (newton-physics#1740) * Fix ViewerViser.log_lines method (newton-physics#1764) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Update warp-lang dependency to 1.12.0rc1 (newton-physics#1763) * Fix fromto capsule/cylinder orientation in MJCF parser (newton-physics#1741) * fix: multi-world particle BVH indexing (newton-physics#1641) Co-authored-by: Eric Heiden <eheiden@nvidia.com> * Clean up unused and internal-only kwargs in SolverMuJoCo (newton-physics#1766) * Parsing of the mimic joint and contact gap/margin from newton schemas (newton-physics#1690) Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> * API Refactor v2 (newton-physics#1749) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Support explicit geom mass attributes in MJCF (newton-physics#1744) * Bump flask and werkzeug in lockfile for security (newton-physics#1769) Co-authored-by: Cursor <cursoragent@cursor.com> * Split MJCF worldbody root bodies into separate articulations (newton-physics#1754) * Expose VBD rigid contact forces for solver coupling (newton-physics#1745) Signed-off-by: JC <jumyungc@nvidia.com> * Add MJCF ellipsoid geom import and regression test (newton-physics#1772) Co-authored-by: Cursor <cursoragent@cursor.com> * Weld equality constraints parsed from mjcf are given Nan as the default value of torquescale. The correct default should be 1.0 (newton-physics#1760) * Improve picking accuracy and stability (newton-physics#1712) * Franka cloth demo improvement (newton-physics#1765) * Support computing sensing object transforms & API cleanup (newton-physics#1759) * Remove threading workaround (newton-physics#1751) * [Warp Raytrace] Consolidated ray intersect functions, renamed Options to Config (newton-physics#1767) * Improve README example gallery for PyPI compatibility (newton-physics#1776) * Fix issue with mesh in rerun viewer (newton-physics#1768) * Add PhysxMimicJointAPI parsing to USD importer (newton-physics#1735) * Move some math functions to Warp (newton-physics#1717) Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Add test to ensure MJCF xform argument is relative (newton-physics#1777) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Emit diaginertia instead of fullinertia for diagonal body inertia (newton-physics#1780) * Change default joint armature from 0.01 to 0 (newton-physics#1782) * Fix default kp/kv for position and velocity actuators (newton-physics#1786) * Lock body inertia after explicit MJCF <inertial> element (newton-physics#1784) * Fix for MJCF actuator custom attributes (newton-physics#1783) * Bump version to 0.2.3 Prepare the package metadata for the v0.2.3 release tag. * Fix ViewerRerun rendering of instances from hidden meshes (newton-physics#1788) * API cleanup (newton-physics#1789) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * BODY actuator target name bypasses body name de-duplication in SolverMuJoCo (newton-physics#1729) * Use default density for visual geoms in MJCF import (newton-physics#1781) * Fix GL viewer crash on Wayland (newton-physics#1793) * Make USD xform parameter control absolute articulation placement (newton-physics#1771) * Fix CUDA context corruption in SDF implementation (newton-physics#1792) * Bump mujoco-warp dependency to 3.5.0.2 (newton-physics#1779) * Fix MuJoCo margin/gap conversion (newton-physics#1785) * Bump version to 1.1.0.dev0 (newton-physics#1798) * Missing unittest.main added back to test_import_mjcf.py. Helps with F5 debugging in VS Code. (newton-physics#1796) * Improve H1 example (newton-physics#1801) Signed-off-by: Eric Heiden <eric-heiden@outlook.com> * Fix ViewerViser.set_camera() (newton-physics#1805) * Rename examples to follow prefix-first naming convention (newton-physics#1802) * Improve MuJoCo actuator domain randomization (newton-physics#1773) * Restore in_cup test in hydro example (newton-physics#1775) * Fix `newton.geometry` imports and change of Mesh maxhullverts global constant * Adapt to having both margin and gap arrays for each geom/shape * Fix for newton.geometry API changes in primitive/narrowphase.py * Fix removal of `BroadPhaseMode` IntEnum and revert to newton-sytle string literals * WIP: Adapt geometry/unified.py to fix breaking changes to `newton.geometry` API * First pass of API adjustments * Patch more gaps (with respect to margin and gap renaming) * GeoType.SDF was removed - reflect that in Kamino * Introduce CoM position offsets w.r.t body frame and operations to convert between body CoM state and generic local body-fixed reference frames. * Add caching of per-entity labels/names/keys in the Model subcontainers * Remove SDF shape wrapper since it's now internal to mesh handling in CD pipelines * Fix USD test assets * Add Newton <--> Kamino joint type conversion operations and per-space default limit constants * Add some cleanup to geometry and unified CD + UTs * Add Newton <--> Kamino shape type conversion operations * Apply new default joint coord limit constants to limits.py * Adapt foubrar model builder and USD asset to produce the same result in sim example * Purge "physical" goems and collapse all into a single group, and purge geometry "layers" * Disable allocation per-joint wrenches by default and make them optional * Make `Model` a dataclass * Separate ModelData* containers into own `core/data.py` module * Fix imports of ModelData * Rename `Model` as `ModelKamino` * Rename `ModelData` as `DataKamino` * Rename `State` as `StateKamino` * Rename `Control` as `ControlKamino` * Rename `Limits` as `LimitsKamino` * Rename `Contacts` as `ContactsKamino` * Rename `ModelBuilder` as `ModelBuilderKamino` * Make imports in test utilities relative * Revise CD meta-data attributes and their computation in GeometryModel and ModelBuilderKamino * Revise primitive CD pipeline * Revise unified CD pipeline * Revise CD front-end interfaces * Fix UTs and relevant utils for interface changes to CD * Change to `wp.DeviceLike` to account for upcoming deprecation of `Devicelike` * Depracate legacy HDF5 data io (will be replaced in the future) * Fix banned imports at module level * Modify USD importer to detect articulations and order geoms and joints similarly to how the Newton `parse_usd` function does. * Add conversion operation from `newton.Model` to `ModelKamino` * Add data, state and control container conversions * Add SolverKamino wrapper that fullfils newton integration interface * Add newton integration examples * Add SolverKamino to newton solver module imports * WIP: fix problem with lambda_j being allocated for only kinematic constraints and failing on array copying * Fix banned git import in benchmark * Rename *Settings to *Config (#213) * Rename SolverKaminoSettings -> SolverKaminoConfig * Rename DualProblemSettings -> DualProblemConfig * Rename CollisionDetectorSettings -> CollisionDetectorConfig * Rename PADMMSettings -> PADMMConfig * Rename ForwardKinematicsSolverSettings -> ForwardKinematicsSolverConfig * Rename SimulatorSettings -> SimulatorConfig * Add check for model compatibility in SolverKamino (#209) * Fix device assignment in sparse CG test on CPU (#216) * Replace Enum-type config attributes with Literal (#215) * Replace warmstart mode config param with literal * Replace contact warmstart mode config param with literal * Replace rotation correction config param with literal * Replace penalty update config param with literal * Replace FK preconditioner option config param with literal * Add post-init checks for dual/PADMM configs * Rename FKPreconditionerOptions to FKPreconditionerType * Remove WorldDescriptor from ModelKamino (#219) * Add geom index offset array to model info * Replace access to world description in model * Remove world descriptor from model * Fix computation of kinematics residual with sparse Jacobian (#220) * Migrates `ModelKaminoSize` to it's own module to avoid circular dependency between core/model.py and core/state.py and rename it as `SizeKamino`. * WIP: Fix SolverKamino wrapper * Fix circular dependency in conversions.py * Fix some broken unit tests and WIP to fix fourbar contact conversions and rendering * Make some conversions @staticmethods instead, because they dont need common class attributes * Fix declaration of custom state attributes and their conversion to/from newton and kamino * WIP: Debug model conversion and newton sim examples * Rename and cleanup start index array of per-world geoms * Model conversion and newton sim examples now work. * Make gravity conversion operation re-usable * Migrates boxes_fourbar builder using newton.ModelBuilder to it's own module to prepare for migration. * Use gravity conversion utility func in SolverKamino * Add reusable joint-parameterization conversion utility * Remove world-descriptor from model converter * Rename helper converter that handles entity-local transforms * Add some cleanup to DR Legs, ANYmal D and basic four-bar examples * Fix module-level imports of additional kamino-specific development dependencies * Fix module-level imports of additional kamino-specific development dependencies * Fix erroneous merge conflict. --------- Signed-off-by: Alain Denzler <adenzler@nvidia.com> Signed-off-by: Viktor Reutskyy <vreutskyy@nvidia.com> Signed-off-by: JC <jumyungc@nvidia.com> Signed-off-by: Milad Rakhsha <mrakhsha@nvidia.com> Signed-off-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Signed-off-by: Eric Heiden <eric-heiden@outlook.com> Signed-off-by: Eric Heiden <eheiden@nvidia.com> Signed-off-by: Miles Macklin <mmacklin@nvidia.com> Signed-off-by: adenzler-nvidia <adenzler@nvidia.com> Signed-off-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: Daniela Hase <116915287+daniela-hase@users.noreply.github.com> Co-authored-by: adenzler-nvidia <adenzler@nvidia.com> Co-authored-by: Viktor Reutskyy <33062116+vreutskyy@users.noreply.github.com> Co-authored-by: Eric Shi <97630937+shi-eric@users.noreply.github.com> Co-authored-by: Anka Chen <AnkaChan@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: JC-nvidia <116605903+jumyungc@users.noreply.github.com> Co-authored-by: Kenny Vilella <kvilella@nvidia.com> Co-authored-by: nvtw <110816143+nvtw@users.noreply.github.com> Co-authored-by: Milad-Rakhsha-NV <167464435+Milad-Rakhsha-NV@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Lennart Röstel <65088822+lenroe@users.noreply.github.com> Co-authored-by: Eric Heiden <eheiden@nvidia.com> Co-authored-by: jvonmuralt <jvonmuralt@nvidia.com> Co-authored-by: camevor <camevor@nvidia.com> Co-authored-by: mzamoramora-nvidia <mzamoramora@nvidia.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alessandro Roncone <alecive87@gmail.com> Co-authored-by: gdaviet <57617656+gdaviet@users.noreply.github.com> Co-authored-by: Miles Macklin <mmacklin@nvidia.com> Co-authored-by: Gordon Yeoman <gyeomannvidia@users.noreply.github.com> Co-authored-by: Lukasz Wawrzyniak <lwawrzyniak@nvidia.com> Co-authored-by: Eric Heiden <eric-heiden@outlook.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Viktor Reutskyy <vreutskyy@nvidia.com> Co-authored-by: Lorenzo Terenzi <lorenzoterenzi96@gmail.com> Co-authored-by: smollerNV <164020096+smollerNV@users.noreply.github.com> Co-authored-by: twidmer <twidmer@nvidia.com> Co-authored-by: Christian Schumacher <christian.schumacher@disney.com> Co-authored-by: Guirec-Maloisel <25688871+Guirec-Maloisel@users.noreply.github.com>
Signed-off-by: Eric Heiden <eric-heiden@outlook.com>
Fixes #1737.
Summary by CodeRabbit
Breaking Changes
API Updates
Documentation