Support floating, base_joint and parent_body arguments for importers#1498
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds hierarchical root-attachment support to URDF, MJCF, and USD importers by introducing Changes
Sequence DiagramsequenceDiagram
participant User
participant ModelBuilder
participant Importer as URDF/MJCF/USD
participant Validator
participant Articulation
User->>ModelBuilder: add_urdf/add_mjcf/add_usd(source, parent_body, floating, base_joint, ...)
ModelBuilder->>Validator: _validate_base_joint_params(floating, base_joint, parent_body)
Validator-->>ModelBuilder: ok / raise
alt parent_body specified
ModelBuilder->>Validator: _validate_parent_body(parent_body, child)
Validator-->>ModelBuilder: ok / raise
ModelBuilder->>ModelBuilder: _find_articulation_for_body(parent_body)
end
ModelBuilder->>Importer: parse_...(source, parent_body, floating, base_joint, ...)
Importer->>Importer: parse bodies, joints, frames
alt base joint required
Importer->>ModelBuilder: _add_base_joint(child, floating, base_joint, parent=parent_body, parent_xform, child_xform)
ModelBuilder->>Articulation: add_joint (base joint)
Articulation-->>ModelBuilder: joint_id
end
Importer->>ModelBuilder: _finalize_imported_articulation(joint_indices, parent_body, ...)
ModelBuilder->>Articulation: create_or_attach_articulation(...)
Articulation-->>ModelBuilder: articulation_id
ModelBuilder-->>User: imported body_ids / articulation info
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 6124-6162: The method add_base_joints_to_floating_bodies currently
returns immediately when new_bodies is None, causing the default behavior to
no-op; change it so that when new_bodies is None it defaults to all body indices
(e.g., new_bodies = range(len(self.body_mass)) or
set(range(len(self.body_mass)))) before computing floating_bodies =
set(new_bodies) - set(self.joint_child); keep the rest of the logic (calling
add_base_joint and add_articulation using self.body_key and checking
self.body_mass) unchanged so all eligible floating bodies get base joints by
default.
- Around line 6018-6122: Validate the child index before referencing self.body_q
and move the parent_xform defaulting after that validation; also ensure free
joints respect provided frames by not calling add_joint_free(child, key=...)
unconditionally — instead create the world-to-body free joint using add_joint
(or extend add_joint_free) with parent=-1, child=child,
parent_xform=parent_xform and child_xform=child_xform (and key) so supplied
frames are honored; update references in add_base_joint to use the corrected
order and to call add_joint (or the updated add_joint_free) when parent == -1
and floating is True/None.
In `@newton/_src/utils/import_mjcf.py`:
- Around line 1059-1087: The parent-frame transforms passed to
builder.add_base_joint are currently in world space; when parent_body is not
None you must convert _xform (and world_xform) into the parent body frame by
premultiplying with the inverse of the parent body's world transform. Locate
where base_parent_xform and the fixed-base parent_xform are created and, if
parent_body is set, compute parent_world_xform = <parent body's world xform from
the body transforms array>, parent_inv = transform_inverse(parent_world_xform),
then replace base_parent_xform = transform_mul(parent_inv, <current
base_parent_xform computed from _xform>) and parent_xform =
transform_mul(parent_inv, world_xform) before calling builder.add_base_joint so
the anchors are in the parent-body frame.
- Around line 1733-1759: The code directly mutates builder.joint_articulation
for existing articulations which leaves builder.articulation_start and
builder.articulation_key out of sync and will break finalize()'s
contiguous-range assumptions; fix by either calling builder.add_articulation
with the full extended joint list for that articulation (so add_articulation
updates all metadata atomically) or, if you must mutate in-place, update
builder.articulation_start and builder.articulation_key to reflect the new
contiguous range(s) and ensure contiguity before returning (make the same
updates that add_articulation would perform so finalize() sees consistent
joint_articulation, articulation_start, and articulation_key).
In `@newton/_src/utils/import_usd.py`:
- Around line 63-65: The docstring for the import_usd function is missing an
Args entry for the parent_body parameter; update the Google-style docstring for
import_usd to include a line for parent_body describing it as an int that, if
specified, attaches imported bodies to this existing body using the provided
base_joint type (enabling hierarchical composition), e.g., add the proposed
sentence under Args next to floating, base_joint, etc., referencing the
parent_body symbol.
🧹 Nitpick comments (2)
newton/_src/utils/import_urdf.py (1)
640-644: Misleading comment on articulation search.The comment on Line 641 says "Parent body might be the child of a joint" but the code checks
if parent == parent_body. The comment should be corrected to reflect what the code actually does.📝 Suggested fix for comment clarity
if parent_articulation is None: - # Parent body might be the child of a joint + # Parent body might be the parent (not child) of some joint for joint_idx, parent in enumerate(builder.joint_parent): if parent == parent_body: parent_articulation = builder.joint_articulation[joint_idx] breaknewton/_src/utils/import_usd.py (1)
39-56: Silent no-op when parent articulation cannot be found.If
parent_bodyis not the child or parent of any existing joint,parent_articulationremainsNoneand the function silently returns without attaching the joints. This could lead to subtle bugs where joints are expected to be attached to an articulation but are not.Consider either:
- Logging a warning when no articulation is found, or
- Documenting this behavior explicitly in the docstring.
💡 Proposed improvement to add warning
def _attach_joints_to_parent_articulation(builder: ModelBuilder, joint_indices: list[int], parent_body: int): - """Helper function to attach joints to an existing articulation containing parent_body.""" + """Helper function to attach joints to an existing articulation containing parent_body. + + If parent_body is not part of any existing articulation, no attachment is made + and a warning is issued. + """ parent_articulation = None for joint_idx, child in enumerate(builder.joint_child): if child == parent_body: parent_articulation = builder.joint_articulation[joint_idx] break if parent_articulation is None: # Parent body might be the parent of a joint for joint_idx, parent in enumerate(builder.joint_parent): if parent == parent_body: parent_articulation = builder.joint_articulation[joint_idx] break if parent_articulation is not None and parent_articulation >= 0: # Mark all new joints as belonging to the parent's articulation for joint_idx in joint_indices: builder.joint_articulation[joint_idx] = parent_articulation + elif joint_indices: + import warnings + warnings.warn( + f"Could not find articulation for parent_body {parent_body}. " + f"Joints {joint_indices} were not attached to any articulation.", + stacklevel=3, + )
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 6035-6038: The docstring for the function that takes parameters
(child, floating, base_joint, parent) is misleading: it claims
floating=True/None creates a free joint but the implementation falls back to a
fixed joint when parent != -1; either implement parent-relative free joints or
document the fallback. Update the function's docstring to explicitly state that
when parent != -1 the code will create a fixed joint regardless of floating (or,
if you prefer implementing support, modify the attachment logic to create a free
joint relative to the parent when floating is True/None), and apply the same
clarification to the other occurrence that documents the same parameters (the
block around lines 6113-6119). Reference the parameter names floating, parent,
and base_joint when making the docstring change so readers know the exact
behavior.
In `@newton/_src/utils/import_urdf.py`:
- Around line 630-670: When reusing an existing articulation (when
parent_articulation is set and >= 0) you must update the articulation
bookkeeping beyond setting builder.joint_articulation: extend the articulation
range in builder.articulation_start so finalize() will include the newly
appended joint_indices (e.g., increment the appropriate
builder.articulation_start entry or adjust subsequent starts to account for
len(joint_indices)), or instead invoke builder.add_articulation(...) for those
joint_indices so both builder.joint_articulation and builder.articulation_start
stay consistent; make this change in the branch that currently only assigns
builder.joint_articulation for joint_idx in joint_indices.
🧹 Nitpick comments (3)
newton/_src/utils/import_mjcf.py (1)
1733-1759: Consider extracting shared articulation attachment logic.The articulation attachment logic (lines 1735-1751) is duplicated between
import_mjcf.pyandimport_usd.py(the_attach_joints_to_parent_articulationhelper). Consider extracting this into a shared utility to maintain consistency and reduce duplication.♻️ Suggested refactor to use the shared helper
You could import and reuse the helper from
import_usd.pyor move it to a shared location likeimport_utils.py:+from .import_usd import _attach_joints_to_parent_articulation + # In the articulation creation section: if joint_indices: if parent_body is not None: - # Find the articulation that contains the parent_body - parent_articulation = None - for joint_idx, child in enumerate(builder.joint_child): - if child == parent_body: - parent_articulation = builder.joint_articulation[joint_idx] - break - if parent_articulation is None: - # Parent body might be the child of a joint - for joint_idx, parent in enumerate(builder.joint_parent): - if parent == parent_body: - parent_articulation = builder.joint_articulation[joint_idx] - break - if parent_articulation is not None and parent_articulation >= 0: - # Mark all new joints as belonging to the parent's articulation - for joint_idx in joint_indices: - builder.joint_articulation[joint_idx] = parent_articulation - else: - # Parent body is not in any articulation, create a new one - articulation_key = root.attrib.get("model") - builder.add_articulation(joints=joint_indices, key=articulation_key) + _attach_joints_to_parent_articulation(builder, joint_indices, parent_body) + # If parent wasn't in an articulation, create a new one + if all(builder.joint_articulation[j] < 0 for j in joint_indices): + articulation_key = root.attrib.get("model") + builder.add_articulation(joints=joint_indices, key=articulation_key) else: articulation_key = root.attrib.get("model") builder.add_articulation(joints=joint_indices, key=articulation_key)newton/tests/test_import_usd.py (1)
3648-3668: Remove unusednoqadirectives.The static analysis tool correctly flags that
# noqa: PLC0415directives are unused becausePLC0415is not an enabled rule. While this pattern exists elsewhere in the file, cleaning up these directives would improve code hygiene.🔧 Suggested fix (applies to all new test methods)
`@unittest.skipUnless`(USD_AVAILABLE, "Requires usd-core") def test_floating_true_creates_free_joint(self): """Test that floating=True creates a free joint for the root body.""" - from pxr import Usd, UsdGeom, UsdPhysics # noqa: PLC0415 + from pxr import Usd, UsdGeom, UsdPhysicsApply the same change to lines 3672, 3693, 3714, 3741, 3763, and 3840.
newton/_src/sim/builder.py (1)
6153-6161: Preserve deterministic ordering for base joints.
setdifference drops ordering, so joint/articulation order can vary across runs. Iteratingnew_bodiesin input order avoids that and still skips connected bodies.♻️ Suggested ordered filtering
- floating_bodies = set(new_bodies) - set(self.joint_child) - for body_id in floating_bodies: + joint_children = set(self.joint_child) + seen: set[int] = set() + for body_id in new_bodies: + if body_id in joint_children or body_id in seen: + continue + seen.add(body_id) if self.body_mass[body_id] <= 0: continue
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
newton/_src/utils/import_urdf.py (1)
509-561:⚠️ Potential issue | 🟠 MajorConvert base-joint transforms into the parent-body frame when
parent_bodyis set.
add_base_jointexpectsparent_xformin the parent body’s frame. Passing the world-spacexformwill mis-anchor the joint if the parent body isn’t identity.🛠️ Proposed fix
- base_parent = parent_body if parent_body is not None else -1 + base_parent = parent_body if parent_body is not None else -1 + base_xform = xform + if base_parent != -1: + parent_world = builder.body_q[base_parent] + base_xform = wp.transform_inverse(parent_world) * xform @@ - base_parent_xform = wp.transform(xform.p, wp.quat_identity()) - base_child_xform = wp.transform((0.0, 0.0, 0.0), wp.quat_inverse(xform.q)) + base_parent_xform = wp.transform(base_xform.p, wp.quat_identity()) + base_child_xform = wp.transform((0.0, 0.0, 0.0), wp.quat_inverse(base_xform.q)) @@ - parent_xform=xform, + parent_xform=base_xform,
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 6163-6236: The method _reorder_joints_by_articulation accesses
optional attributes joint_linear_compliance and joint_angular_compliance without
guarding them, which can raise AttributeError; update this method to treat them
like the other optional arrays by wrapping their _reorder_list_by_mapping calls
in hasattr checks (similar to joint_cts_start/joint_axis_start/joint_axis_dim)
or alternatively ensure these lists are initialized in __init__ so they always
exist; modify either _reorder_joints_by_articulation or the class initializer
accordingly and keep use of _reorder_list_by_mapping and articulation_start
logic unchanged.
- Around line 6288-6358: The add_base_joint method ignores
allow_expensive_reordering; after validating the parent (after
self._validate_parent_body(parent, child)) and before creating the joint (before
the base_joint handling), call the existing helpers to enforce/documented
behavior: invoke self._check_sequential_composition(parent, child,
allow_expensive_reordering) (which should raise ValueError when non‑sequential
composition is disallowed) and—if that helper indicates reordering is needed and
allow_expensive_reordering is True—call
self._reorder_joints_by_articulation(parent, child) to perform the O(n²)
reordering; ensure these calls occur before any joint creation in add_base_joint
so the flag actually gates non‑sequential composition.
In `@newton/_src/utils/import_usd.py`:
- Around line 39-66: The function currently raises when
builder._check_sequential_composition returns parent_articulation is None;
instead handle the no-articulation case by creating a new articulation for
parent_body (or returning a sentinel) and attaching the joints to it.
Specifically, inside _attach_joints_to_parent_articulation, if
parent_articulation is None: try to call a builder helper like
builder._create_articulation_for_body(parent_body) (or
builder.create_articulation / builder._new_articulation if present); if no
helper exists, allocate a new articulation id (e.g., next index from
builder.articulation_start or a builder.num_articulations counter), set
builder.body_articulation[parent_body] = new_id and set
builder.joint_articulation[joint_idx] = new_id for each joint_idx; only call
builder._reorder_joints_by_articulation() if needs_reordering is True; do not
raise a RuntimeError—either return the new articulation id or nothing per the
existing call sites so callers can proceed.
- Around line 1256-1287: When parent_body is provided you must compute and pass
parent_xform to builder.add_base_joint so the child pose is preserved; currently
add_base_joint is called with default parent_xform (identity) which drops the
authored parent→child offset. For both call sites (the loop over body_ids using
body_data[i] and the loop over art_bodies), compute parent_xform =
parent_world_xform.inverse() * child_world_xform (using the existing world
transforms available in body_data[i] or art_bodies entries) and pass
parent_xform=parent_xform into builder.add_base_joint; keep the existing
floating/base_joint/parent/allow_expensive_reordering args and ensure the same
parent_xform logic is applied before calling
_attach_joints_to_parent_articulation or builder.add_articulation.
🧹 Nitpick comments (1)
newton/_src/utils/import_usd.py (1)
39-66: Use a Google-style docstring for the new helper.Add
Args:andReturns:blocks for_attach_joints_to_parent_articulation.As per coding guidelines: Use Google-style docstrings with clear explanations of what the function does, its parameters, and return values.
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/utils/import_urdf.py (1)
509-561:⚠️ Potential issue | 🟠 MajorConvert base-joint transforms into the parent-body frame.
Whenparent_bodyis set,xformis still world-space.ModelBuilder.add_base_jointexpects parent-frame transforms, so anchors will be offset if the parent body isn’t identity. Convertxforminto the parent frame before buildingbase_parent_xformor fixed-baseparent_xform.🛠️ Proposed fix
# Determine the parent for the base joint (-1 for world, or an existing body index) base_parent = parent_body if parent_body is not None else -1 + parent_frame_xform = xform + if base_parent != -1: + parent_body_xform = builder.body_q[base_parent] + parent_frame_xform = wp.transform_inverse(parent_body_xform) * xform if base_joint is not None: # in case of a given base joint, the position is applied first, the rotation only # after the base joint itself to not rotate its axis - base_parent_xform = wp.transform(xform.p, wp.quat_identity()) - base_child_xform = wp.transform((0.0, 0.0, 0.0), wp.quat_inverse(xform.q)) + base_parent_xform = wp.transform(parent_frame_xform.p, wp.quat_identity()) + base_child_xform = wp.transform((0.0, 0.0, 0.0), wp.quat_inverse(parent_frame_xform.q)) base_joint_id = builder.add_base_joint( child=root, base_joint=base_joint, key="base_joint", parent_xform=base_parent_xform, child_xform=base_child_xform, parent=base_parent, allow_expensive_reordering=allow_expensive_reordering, ) ... else: # Fixed joint to world or to parent_body joint_indices.append( builder.add_base_joint( child=root, floating=False, key="fixed_base", - parent_xform=xform, + parent_xform=parent_frame_xform, parent=base_parent, allow_expensive_reordering=allow_expensive_reordering, ) )
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 6163-6221: _reorder_joints_by_articulation currently applies a
joint-index mapping to arrays that are sized per-DOF/coord (e.g. joint_axis,
joint_target_ke/kd, joint_limit_*, joint_armature, joint_q_start/joint_qd_start
segments), which corrupts or mismatches those arrays; instead, iterate the new
joint order (derived from joint_articulation -> old_to_new), and rebuild all
per-DOF/per-coord arrays by concatenating each joint's original slices using the
existing joint_dof_dim and joint_q_start/joint_qd_start to locate slices, then
recompute and overwrite joint_q_start, joint_qd_start and joint_dof_dim to match
the new concatenation; only call _reorder_list_by_mapping for true per-joint
lists (length == number of joints) such as joint_type, joint_enabled,
joint_parent, joint_child, joint_world, joint_key, joint_articulation, etc., and
remove or skip calls that treat per-DOF arrays as per-joint.
In `@newton/_src/utils/import_usd.py`:
- Around line 1254-1299: The imported articulation pose is lost when parent_body
is set because builder.add_base_joint is called without an explicit parent_xform
(so it defaults to identity); update every add_base_joint call that passes
parent=parent_body to compute and pass parent_xform equal to the parent's
world-to-local transform for that parent_body (derived from the parent and child
world transforms available in body_data/body_q or art_bodies/body_keys) so the
child joint stays at the imported pose; search for add_base_joint usages in this
file (the blocks around add_base_joint inside the len(joint_edges)==0 branch and
the similar blocks referenced at the other locations) and add the computed
parent_xform argument before calling _attach_joints_to_parent_articulation or
builder.add_articulation.
🧹 Nitpick comments (1)
newton/_src/utils/import_usd.py (1)
39-67: Add Google-style Args/Returns to the new helper docstring.
This helper is new and should document parameters/return value explicitly.📝 Suggested docstring shape
"""Attach joints to an existing articulation containing parent_body. Args: builder: ModelBuilder instance to update. joint_indices: Joint indices to attach. parent_body: Existing body index that must belong to an articulation. allow_expensive_reordering: Whether to allow O(n²) reordering. Returns: None """As per coding guidelines, "Use Google-style docstrings with clear explanations of what the function does, its parameters, and return values."
d56c0ec to
80d9119
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
newton/_src/utils/import_mjcf.py (1)
1475-1518:⚠️ Potential issue | 🟠 MajorApply
effective_xformto worldbody geoms/sites/frames whenparent_bodyis set.
xformis documented as parent‑relative in this mode, but worldbody geoms and frames still use the raw value, so they end up in the wrong world pose when the parent isn’t identity.🛠️ Proposed fix
@@ - parse_shapes( + static_xform = effective_xform if parent_body is not None else xform + parse_shapes( defaults=world_defaults, body_name="world", link=-1, geoms=world.findall("geom"), density=default_shape_density, - incoming_xform=xform, + incoming_xform=static_xform, ) @@ if parse_sites: _parse_sites_impl( defaults=world_defaults, body_name="world", link=-1, sites=world.findall("site"), - incoming_xform=xform, + incoming_xform=static_xform, ) @@ process_frames( world.findall("frame"), parent_body=-1, defaults=world_defaults, childclass=None, - world_xform=xform, + world_xform=static_xform, body_relative_xform=None, # Static geoms use world coords )newton/_src/utils/import_urdf.py (1)
517-568:⚠️ Potential issue | 🟡 MinorWarn when
floating=Trueis ignored due toparent_body.Right now this silently falls back to a fixed base. A warning makes the behavior explicit and avoids confusion.
🔧 Proposed warning
@@ - elif floating and base_parent == -1: + if floating and base_parent != -1: + warnings.warn( + "floating=True is only supported when parent_body is None; falling back to fixed_base.", + UserWarning, + stacklevel=2, + ) + elif floating and base_parent == -1: # floating=True only makes sense when connecting to world floating_joint_id = builder.add_base_joint( child=root, floating=True, key="floating_base",
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 6432-6473: In _create_joint_from_base_joint_spec validate the type
of base_joint up front and raise TypeError if it's not str or dict; when
base_joint is a str, parse axes_spec but explicitly validate each token
(non-empty, first char in {"l","p","a","r"} and last char in {"x","y","z"}) and
raise a ValueError with a clear message for invalid axis tokens instead of
allowing a KeyError; then map safe-axis chars to axes_vec and call add_joint_d6
with ModelBuilder.JointDofConfig(axis=...) for linear_axes and angular_axes as
before; keep the dict branch using add_joint unchanged.
In `@newton/_src/utils/import_mjcf.py`:
- Around line 1067-1119: The code silently treats floating=True with parent_body
by falling back to a fixed base; add an explicit warning when that occurs so
users are informed. In the block handling base_joint/floating/parent_body (the
if branch that computes base_parent and then the floating check), detect the
case where floating is True and parent_body is not None and emit a warning
(e.g., using warnings.warn or logging.warning) saying that floating bases with a
specified parent_body are unsupported and will be treated as a fixed base; then
proceed with the existing fallback (calling builder.add_base_joint with
floating=False or the fixed-base branch). Reference the variables/base
functions: floating, parent_body, base_parent, and builder.add_base_joint when
inserting the warning.
- Around line 1951-1968: When deciding to call
builder._reorder_joints_by_articulation() after assigning
builder.joint_articulation for joint_indices, add a safety check to detect
whether tendon/actuator/joint-equality parsing has already recorded joint
indices or qd_start values (the structures filled when parsing tendons,
actuators, or joint-equality constraints); if any such parsed attributes exist,
do not call _reorder_joints_by_articulation and instead raise an exception
(fail-fast) with a clear message referencing the conflict, or alternatively
remap those stored indices to the new ordering; implement this check in the
block that follows builder._check_sequential_composition (the code that
currently branches to call _reorder_joints_by_articulation) so reordering is
prevented when tendon/actuator/joint-equality state is present.
In `@newton/_src/utils/import_usd.py`:
- Around line 1416-1422: The parent_xform is being incorrectly computed for
world-parented bodies: when base_parent == -1 you should not multiply
articulation_incoming_xform with builder.body_q[child_body_id] (that
double-applies the articulation transform); instead set parent_xform to the
child's world transform (use builder.body_q[child_body_id] directly) so the
child is attached to world consistently with other base_parent == -1 code paths;
modify the block that assigns parent_xform (references: parent_xform,
base_parent, articulation_incoming_xform, builder.body_q[child_body_id]) to omit
the multiplication for the world-parent case.
🧹 Nitpick comments (3)
newton/_src/utils/import_usd.py (1)
64-67: Optional: Extract long error message to improve readability.Static analysis flags TRY003 for the long exception message. Consider extracting to a variable for clarity, though this is a minor style preference.
♻️ Optional refactor
else: + msg = ( + f"_attach_joints_to_parent_articulation called with parent_body {parent_body} " + f"which is not in any articulation. This is likely a bug." + ) - raise RuntimeError( - f"_attach_joints_to_parent_articulation called with parent_body {parent_body} " - f"which is not in any articulation. This is likely a bug." - ) + raise RuntimeError(msg)newton/tests/test_import_mjcf.py (1)
3933-3972: Consider asserting transforms via finalized model state.Using
builder.body_qcouples the test to ModelBuilder internals. Amodel = builder.finalize()+eval_fkcheck would make this test more resilient to builder implementation changes.newton/_src/sim/builder.py (1)
6474-6487: Remember to regenerate API docs for new public builder methods.As per coding guidelines: Keep documentation up-to-date by running docs/generate_api.py when adding new files or public API symbols.
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/utils/import_mjcf.py (1)
1475-1519:⚠️ Potential issue | 🟠 MajorUse
effective_xformfor worldbody statics whenparent_bodyis set.The code states
xformis interpreted relative to the parent body, but worldbody geoms/sites/frames still usexforminstead ofeffective_xform, so statics are placed as if the parent were at identity. This will misplace worldbody statics when attaching to a parent.🛠️ Proposed fix
- parse_shapes( + parse_shapes( defaults=world_defaults, body_name="world", link=-1, geoms=world.findall("geom"), density=default_shape_density, - incoming_xform=xform, + incoming_xform=effective_xform, ) if parse_sites: _parse_sites_impl( defaults=world_defaults, body_name="world", link=-1, sites=world.findall("site"), - incoming_xform=xform, + incoming_xform=effective_xform, ) # ----------------- # process frame elements at worldbody level process_frames( world.findall("frame"), parent_body=-1, defaults=world_defaults, childclass=None, - world_xform=xform, + world_xform=effective_xform, body_relative_xform=None, # Static geoms use world coords )
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 6219-6431: The reordering currently leaves self.custom_attributes
tied to old joint indices; update _reorder_joints_by_articulation to remap
custom attributes according to the same mappings and slice logic or refuse/raise
when expensive remapping is requested. Specifically, for any custom attribute
keyed by JOINT frequency, rebuild its list by applying old_to_new (use the same
_reorder_list_by_mapping approach as used for joint_* lists); for JOINT_DOF,
JOINT_COORD, and JOINT_CONSTRAINT frequencies rebuild by concatenating per-joint
slices using orig_joint_qd_start / get_dof_slice_orig, orig_joint_q_start /
get_coord_slice_orig, and orig_joint_cts_start / get_cts_slice (or the
get_cts_slice logic shown) respectively; then replace the attribute values in
self.custom_attributes with the rebuilt arrays so their ordering matches the new
joint order (alternatively raise an explicit error if you choose to block
reordering when custom attributes exist and allow_expensive_reordering is
False).
In `@newton/_src/utils/import_usd.py`:
- Around line 1405-1431: The parent_xform calculation is wrong when overriding
the USD root joint with a world parent (base_parent == -1);
builder.body_q[child_body_id] is already a world-space transform and should be
used directly instead of multiplying by articulation_incoming_xform. In the
block that computes parent_xform, keep the existing inverse-multiplication for
base_parent != -1 (parent_xform =
wp.transform_inverse(builder.body_q[base_parent]) *
builder.body_q[child_body_id]) but change the else branch to set parent_xform =
builder.body_q[child_body_id] (remove the articulation_incoming_xform
multiplication) before calling builder.add_base_joint (symbols: base_parent,
parent_xform, articulation_incoming_xform, builder.body_q[child_body_id],
builder.add_base_joint).
🧹 Nitpick comments (1)
newton/tests/test_import_usd.py (1)
3854-3854: Consider removing unusednoqadirectives.Ruff reports that
# noqa: PLC0415directives are unused since thePLC0415rule is not enabled. These appear on lines 3854, 3875, 3896, 3917, 3944, 3966, 4043, 4088, and 4134.If these are only for Ruff and not other linters like pylint, they can be safely removed.
Example fix (apply to all affected lines)
- from pxr import Usd, UsdGeom, UsdPhysics # noqa: PLC0415 + from pxr import Usd, UsdGeom, UsdPhysicsAlso applies to: 3875-3875, 3896-3896, 3917-3917, 3944-3944, 3966-3966, 4043-4043, 4088-4088, 4134-4134
ca2c57c to
7f46565
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
newton/_src/utils/import_urdf.py (1)
519-570:⚠️ Potential issue | 🟡 MinorGuard against
floating=Truebeing silently ignored when attaching to a parent.
Withparent_body != -1andbase_jointunset, the code falls through to the fixed-base path, sofloating=Trueis ignored. That can mask misconfiguration. Consider raising aValueError(or explicitly supporting a free joint to the parent) and documenting the behavior.Proposed guard to avoid silent override
- if base_joint is not None: + if floating and base_parent != -1 and base_joint is None: + raise ValueError( + "floating=True is only supported when parent_body == -1; " + "use base_joint to attach to an existing parent." + ) + if base_joint is not None:
🧹 Nitpick comments (2)
newton/_src/utils/import_usd.py (1)
42-50: Use Google-style Args/Returns in the helper docstring.♻️ Suggested docstring polish
def _attach_joints_to_parent_articulation( builder: ModelBuilder, joint_indices: list[int], parent_body: int, allow_expensive_reordering: bool = False ): """Helper function to attach joints to an existing articulation containing parent_body. This function handles the bookkeeping required when adding joints to an existing articulation. Since articulation_start assumes contiguous joint indices, we reorder joints by articulation when necessary to maintain this invariant. + + Args: + builder: The ModelBuilder to update. + joint_indices: Newly created joint indices to attach. + parent_body: Parent body id that already belongs to an articulation. + allow_expensive_reordering: Whether O(n²) reordering is permitted. + + Returns: + None. """As per coding guidelines: Use Google-style docstrings with clear explanations of what the function does, its parameters, and return values.
newton/tests/test_import_usd.py (1)
3851-3962: Consider removing unusednoqadirectives.Static analysis indicates
# noqa: PLC0415directives are unused since PLC0415 is not enabled in Ruff. While this pattern is consistent with existing tests in the file, you could optionally clean them up.♻️ Optional cleanup for lines 3854, 3875, 3896, 3917, 3944
def test_floating_true_creates_free_joint(self): """Test that floating=True creates a free joint for the root body.""" - from pxr import Usd, UsdGeom, UsdPhysics # noqa: PLC0415 + from pxr import Usd, UsdGeom, UsdPhysicsApply similar change to other affected test methods.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 6664-6668: The docstring for the base_joint parameter contradicts
the mutual-exclusion enforced by _validate_base_joint_params: it currently says
base_joint "takes precedence" over floating but the validator forbids specifying
both. Update the docstring for base_joint (and mention floating) to state they
are mutually exclusive and that _validate_base_joint_params will raise if both
are provided (or, alternatively, change _validate_base_joint_params to implement
precedence if you want base_joint to override floating); reference
ModelBuilder.add_joint for dict form and keep the examples (e.g. "px,py,rz")
unchanged.
In `@newton/_src/utils/import_mjcf.py`:
- Around line 1097-1151: The current logic uses has_override_params = base_joint
is not None or floating is not None or parent != -1 which causes nested FREE
joints (joint_type == JointType.FREE) to be treated as having override params
when parent != -1; change has_override_params to only reflect explicit override
intent (e.g., base_joint is not None or floating is not None or an explicit
caller-provided parent_body/override flag) and stop using the local parent index
(parent) in that check so non-root FREE joints follow the normal FREE-joint
path; update the computation that sets is_free_joint_with_override and the
conditional (if (is_mjcf_root and has_override_params) or
is_free_joint_with_override) to use the new has_override_params/or explicit
parent_body flag (or is_mjcf_root) so only MJCF roots or explicitly overridden
joints enter the base-joint branch (refer to has_override_params, parent,
base_joint, floating, is_mjcf_root, is_free_joint_with_override).
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 6458-6466: After you directly update self.joint_articulation
inside the attachment branch (the for loop that sets
self.joint_articulation[joint_idx] = parent_articulation), invalidate the
articulation lookup cache used by _find_articulation_for_body() so subsequent
calls don't return stale None; either call the existing cache invalidator method
(e.g. self._clear_articulation_cache() or self._invalidate_articulation_cache())
or reset the cached structure (e.g. self._articulation_cache = None or {}),
placing that invalidation immediately after the loop that mutates
joint_articulation.
🧹 Nitpick comments (1)
newton/_src/sim/builder.py (1)
6564-6574: Regenerate public API docs for new ModelBuilder methods.
add_base_joint/add_base_joints_to_floating_bodiesare new public API; ensuredocs/generate_api.pyis run so API docs stay current.
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 (2)
newton/_src/utils/import_urdf.py (1)
66-194:⚠️ Potential issue | 🟡 MinorFix the parameter interaction table (it currently implies all combos are invalid).
The row*any* / *any* / *any* → errorreads as if every combination is invalid. Tighten it to explicitly describe the mutual exclusivity betweenfloatingandbase_joint.✏️ Suggested docstring tweak
- * - ``True`` - - *any* - - *any* - - ❌ Error: mutually exclusive - * - *any* - - *any* - - *any* - - ❌ Error: mutually exclusive + * - ``True``/``False`` + - ``"px,py,rz"`` or dict + - *any* + - ❌ Error: ``floating`` and ``base_joint`` are mutually exclusivenewton/_src/utils/import_mjcf.py (1)
1576-1620:⚠️ Potential issue | 🟠 MajorCompose worldbody static transforms with
effective_xformwhenparent_bodyis set.
xformis documented as relative toparent_body, but static worldbody geoms/sites/frames still use rawxform. That places them in the wrong world position when the parent is not identity. Useeffective_xformso all worldbody elements respect the parent attachment consistently.🧭 Proposed fix
- parse_shapes( + parse_shapes( defaults=world_defaults, body_name="world", link=-1, geoms=world.findall("geom"), density=default_shape_density, - incoming_xform=xform, + incoming_xform=effective_xform, ) if parse_sites: _parse_sites_impl( defaults=world_defaults, body_name="world", link=-1, sites=world.findall("site"), - incoming_xform=xform, + incoming_xform=effective_xform, ) process_frames( world.findall("frame"), parent_body=-1, defaults=world_defaults, childclass=None, - world_xform=xform, + world_xform=effective_xform, body_relative_xform=None, # Static geoms use world coords )
🤖 Fix all issues with AI agents
In `@newton/_src/sim/builder.py`:
- Around line 1457-1531: The parameter interaction table for floating,
base_joint, and parent_body is incorrect: remove the two broad "mutually
exclusive" rows and replace them with a single explicit error row that flags
only the true invalid combinations—(1) floating is not None and base_joint is
not None (i.e., floating and base_joint used together), and (2) floating == True
with parent_body != -1 (FREE joints must attach to world). Update the table
entries describing valid cases so floating=True with base_joint=None and
parent_body==-1 remains valid, and ensure the row text references the existing
parameter names (floating, base_joint, parent_body) so readers can locate the
rules easily.
In `@newton/_src/utils/import_mjcf.py`:
- Around line 200-248: The parameter-interaction table incorrectly flags broad
combinations as mutually exclusive; update the table in import_mjcf.py so only
the case where both floating and base_joint are explicitly set is marked
invalid—i.e., change the two rows that currently say "*any*" to a single row
that documents the ❌ error for floating AND base_joint both provided (keep
existing valid rows for floating=True/False/None and base_joint values as-is),
and add a final row clarifying that floating=True with a non-None parent_body is
invalid (FREE joints require world frame) so the only prohibited combination is
floating and base_joint both set (and floating=True with parent_body != -1)
instead of the blanket “any” entries.
In `@newton/_src/utils/import_usd.py`:
- Around line 109-155: The parameter-interaction table in the import_usd docs
mislabels many valid combos as "mutually exclusive"; update the table rows so
the mutual-exclusion error only appears when both floating and base_joint are
explicitly set (i.e., floating is not None and base_joint is not None), and
correct the final error row to state that floating==True with parent_body!= -1
is invalid because FREE joints require the world frame; reference the parameter
names floating, base_joint, and parent_body in the table so the erroneous "any"
rows are replaced with the specific condition (both set) and the last row
clarifies floating=True + parent_body != -1 => error.
🧹 Nitpick comments (1)
newton/tests/test_import_usd.py (1)
3116-3116: Redundant import:mathis already imported at file level.The
mathmodule is imported at line 16. This local import is unnecessary.Suggested fix
- import math # noqa: PLC0415 - - angular_gain_unit_scale = math.degrees(1.0) + angular_gain_unit_scale = math.degrees(1.0)
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@newton/_src/utils/import_mjcf.py`:
- Around line 1574-1586: Bodies inside world <frame> elements are still parsed
with parent_body=-1 and only xform, so they aren't attached to the intended
parent; update the loop so frames are handled like direct body children: when
iterating world.findall("frame") compute the frame's transform, compose it with
effective_xform, and call parse_body for bodies under the frame using
root_parent (not -1) and incoming_xform equal to the composed transform (i.e.,
combine frame xform with effective_xform) so bodies within frames inherit the
specified parent_body and correct world transform; refer to symbols root_parent,
parent_body, effective_xform, parse_body, and
world.findall("body")/world.findall("frame") to locate the changes.
In `@newton/_src/utils/import_usd.py`:
- Around line 228-233: The code currently treats only None for schema_resolvers
as a signal to add the default resolver, so an empty list skips default
behavior; update parse_usd to treat empty lists the same as None by replacing
the check with a falsy check (e.g., if not schema_resolvers) so that
SchemaResolverNewton is appended when schema_resolvers is None or []. Locate the
schema_resolvers handling in parse_usd (the block that sets schema_resolvers =
[SchemaResolverNewton()] and compute collect_schema_attrs) and change the
condition to use a falsy test so get_value and related logic always have at
least the default resolver.
🧹 Nitpick comments (1)
newton/tests/test_import_mjcf.py (1)
3952-4013: Prefer validating attachment xforms via finalized state.
Usingbuilder.body_qbefore finalize couples the test to builder internals; validating viamodel+eval_fkmakes this more robust.♻️ Suggested refactor
- ee_body_idx = builder.body_key.index("end_effector") - ee_world_pos = builder.body_q[ee_body_idx].p + ee_body_idx = builder.body_key.index("end_effector") builder.add_mjcf(gripper_mjcf, parent_body=ee_body_idx, xform=wp.transform((0.0, 0.0, 0.1), wp.quat_identity())) - gripper_body_idx = builder.body_key.index("gripper_base") - gripper_world_pos = builder.body_q[gripper_body_idx].p + model = builder.finalize() + state = model.state() + newton.eval_fk(model, model.joint_q, model.joint_qd, state) + ee_body_idx = model.body_key.index("end_effector") + gripper_body_idx = model.body_key.index("gripper_base") + ee_world_pos = state.body_q.numpy()[ee_body_idx][:3] + gripper_world_pos = state.body_q.numpy()[gripper_body_idx][:3]
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Fix all issues with AI agents
In `@newton/examples/robot/example_robot_composer.py`:
- Line 44: The example imports download_git_folder from the private module
newton._src.utils.download_assets which violates guidelines; update the example
to import download_git_folder from the public API (newton.utils) and if
download_git_folder is not re-exported there, add a public wrapper or re-export
in newton.utils (e.g., import from newton._src.utils.download_assets within the
package and export it from newton.utils) so example_robot_composer.py uses
newton.utils.download_git_folder instead of newton._src.
- Around line 110-165: _download_assets sets robot asset attributes (e.g.,
self.franka_urdf, self.ur5e_path, self.leap_path, self.allegro_path,
self.ur10_usd) to None on failure, but _build_scene calls build routines
unconditionally causing confusing "None" paths; either make _download_assets
raise a clear RuntimeError if a required asset download fails, or modify
_build_scene to check each attribute before calling its build method (e.g., if
not self.franka_urdf: raise/Error or skip and log, and likewise for
self.ur5e_path and self.ur10_usd), and include informative error messages naming
the missing assets so downstream code doesn't receive string "None" paths.
- Around line 349-351: The test_final method is currently a no-op; implement it
to verify the composed model's final simulation state against the initial pose
stored in self.initial_joint_q. In the ExampleRobotComposer (or whichever class
defines test_final), fetch the simulated joint positions/state after the example
run (e.g., via the same API used in the example to query joint q or robot
state), compare them to self.initial_joint_q with an appropriate tolerance
(assert differences are within tolerance), and include clear assertion messages;
ensure test_final raises assertion failures on mismatch so CI enforces the
example correctness.
- Line 48: Add the new robot_composer example to the project README and make the
example module discoverable: in README.md add an entry under the examples
section with a screenshot image and the invocation command "uv run -m
newton.examples robot_composer"; then export/import the example in the examples
package (follow pattern used by robot_cartpole/robot_humanoid) so
newton.examples discovers it—e.g., add an import or entry for
newton.examples.robot_composer and ensure the Example class in that module is
exposed by the package __init__/registry.
🧹 Nitpick comments (2)
newton/examples/robot/example_robot_composer.py (2)
360-360: Hardcodeduse_mujoco_contacts = Trueoverrides any CLI argument.If the
--use-mujoco-contactsflag is intended to be user-configurable, this assignment will silently override user input. If MuJoCo contacts are required for this example to work correctly, consider documenting this in the example header or removing the CLI option inheritance.
58-58: No public API available to set pause state initially.The viewer only exposes
is_paused()for reading the pause state; there is no public method to set it (e.g.,viewer.pause()). Directly accessing the private_pausedattribute is currently the only way to initialize the pause state before the simulation loop begins. This is acceptable for examples, but consider filing an enhancement request to add a public pause setter API.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@newton/examples/robot/example_robot_composer.py`:
- Around line 96-99: The contacts are currently computed once in __init__
(self.contacts = self.model.collide(self.state_0,
collision_pipeline=self.collision_pipeline)) and never refreshed; move that
collision computation into the start of simulate() so contacts are recomputed
once per frame (use the current frame state) and then reused for all substeps
within that frame; update code in __init__ to remove or avoid stale
self.contacts initialization and in simulate() compute self.contacts =
self.model.collide(current_state, collision_pipeline=self.collision_pipeline)
immediately before the substep loop so the same contacts are passed to substep
logic.
There was a problem hiding this comment.
I think this adds a lot of complexity to the ModelBuilder.
I don't see if we really need to have this add_base_joint (add_base_joints_to_floating_bodies) and the other related methods. It just converts these arguments, does some validation regarding attaching to the last articulation, and then calls the add_joint method.
I think it is better to have just one utility function that takes the base joint settings as a dictionary (no string handling like "px,py,rz" - I don't think it's a good idea), the floating flag, and the parent_body. Then, given the builder, it does the conversion, but only calls the generic method builder.add_joint().
If we can reduce the entire logic to this one utility function, it could be a private method on ModelBuilder. Otherwise we may need another sim/utils.py file I think. This function also shouldn't be exposed on the public Newton API, from my understanding it is only needed for the importers?
11aee77 to
7d02ea5
Compare
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Fix all issues with AI agents
In `@newton/_src/utils/import_urdf.py`:
- Around line 96-164: The parameter docs in newton/_src/utils/import_urdf.py
incorrectly include two broad "mutually exclusive" rows that claim any
combination is invalid; update the list-table under the
floating/base_joint/parent_body docs to remove those two broad rows and instead
add a single row that flags as invalid only when both floating and base_joint
are explicitly provided (i.e., "floating" set and "base_joint" set → ❌ Error:
mutually exclusive), while preserving the existing row that errors when
floating=True and parent_body != -1 (FREE joints require world). Reference the
parameter names floating, base_joint, parent_body and the import_urdf.py
docstring when making the change.
In `@newton/examples/robot/example_robot_composer.py`:
- Around line 236-237: Fix the typo "illustative" to "illustrative" in the
inline comments where ee_xform and gripper_quat are used in
newton/examples/robot/example_robot_composer.py; update the three comment
occurrences (the one immediately above ee_xform = wp.transform((0.00, 0.1, 0.0),
gripper_quat) and the similar comments around the other ee_xform usages) so all
comments read "illustrative".
- Line 483: The line args.use_mujoco_contacts = True unconditionally overrides
the user's CLI choice; either remove that hardcoded assignment or move the
default into the argument parser so users can override it (e.g., set
default=True in the parser.add_argument call that defines use_mujoco_contacts or
only set it when missing after parse_args()); alternatively, if it must be
forced for the example, add a short explanatory comment above the assignment
referencing args.use_mujoco_contacts and why it cannot be changed.
In `@newton/tests/test_import_usd.py`:
- Around line 2181-2182: The docstring for
test__add_base_joints_to_floating_bodies_base_joint_string is incorrect: it
claims a "base_joint string" while the test passes a dict; update the docstring
to accurately describe the behavior (e.g., "Test
_add_base_joints_to_floating_bodies with base_joint dict creates D6 joints" or
similar), referencing the test name
test__add_base_joints_to_floating_bodies_base_joint_string and the target method
_add_base_joints_to_floating_bodies so readers know the test uses a dict
configuration for base_joint.
- Around line 4556-4558: Rename the test method
test_base_joint_valid_string_variations to a name that reflects it checks dict
variations (e.g., test_base_joint_valid_dict_variations or
test_base_joint_valid_axis_dict_variations); update the function definition and
any references to that symbol so test discovery and any callers use the new
name, keeping the `@unittest.skipUnless`(USD_AVAILABLE, "Requires usd-core")
decorator and the existing docstring intact.
- Around line 2294-2295: The test_add_base_joint_string docstring is inaccurate:
it claims a "base_joint string creates a D6 joint" although the test calls
add_base_joint with a dict; update the docstring in the
test_add_base_joint_string function to accurately describe that the test passes
a dict parameter to add_base_joint and verifies it creates a D6 joint (or
otherwise reflect the actual input used).
🧹 Nitpick comments (2)
newton/examples/robot/example_robot_composer.py (2)
58-58: Accessing private viewer attribute_paused.Using
self.viewer._paused = Truerelies on an internal implementation detail. Consider adding a public method to the viewer API (e.g.,viewer.set_paused(True)) if this is a common pattern across examples.
229-231: Consider adding error handling for body lookup.
body_key.index(ee_name)will raise aValueErrorwith a generic message if the end-effector body is not found. A more descriptive error would help debugging when asset loading fails silently or when body names change.🛡️ Suggested improvement
# Find end effector body by searching body names ee_name = "wrist_3_link" - ee_body_idx = ur5e_with_robotiq_gripper.body_key.index(ee_name) + try: + ee_body_idx = ur5e_with_robotiq_gripper.body_key.index(ee_name) + except ValueError: + raise ValueError(f"End effector body '{ee_name}' not found in UR5e model. Available bodies: {ur5e_with_robotiq_gripper.body_key}")Apply similar handling at lines 285 and 351.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
newton/_src/utils/import_urdf.py (1)
66-187:⚠️ Potential issue | 🟡 MinorDocstring combo table is internally inconsistent.
The list-table marks some valid combinations as errors (e.g., floating=True with parent_body=-1) and includes a redundant “any/any/any” row. Consider tightening it to only the actually invalid combinations so API docs don’t mislead.✏️ Suggested docstring cleanup
- * - ``True`` - - *any* - - *any* - - ❌ Error: mutually exclusive - * - *any* - - *any* - - *any* - - ❌ Error: mutually exclusive + * - ``True`` + - ``{dict}`` + - *any* + - ❌ Error: cannot combine floating with base_jointnewton/_src/utils/import_mjcf.py (1)
1569-1601:⚠️ Potential issue | 🟠 MajorUse
effective_xformfor worldbody geoms/sites whenparent_bodyis set.
Right now, static worldbody geoms and sites usexform(relative-to-parent), so they don’t get the parent’s world transform. That misplaces them wheneverparent_body != -1. Useeffective_xformconsistently.🛠️ Suggested fix
- parse_shapes( + parse_shapes( defaults=world_defaults, body_name="world", link=-1, geoms=world.findall("geom"), density=default_shape_density, - incoming_xform=xform, + incoming_xform=effective_xform, ) if parse_sites: _parse_sites_impl( defaults=world_defaults, body_name="world", link=-1, sites=world.findall("site"), - incoming_xform=xform, + incoming_xform=effective_xform, )
🤖 Fix all issues with AI agents
In `@newton/tests/test_model.py`:
- Around line 1000-1010: The test fails because _add_base_joint(child_body,
parent=parent_body) expects the parent to belong to an articulation; after
creating the parent body and calling add_joint_fixed(parent=-1,
child=parent_body) you must call builder.add_articulation(parent_body) to
register the parent into an articulation before invoking _add_base_joint; update
the test to call add_articulation(parent_body) (or otherwise ensure
_find_articulation_for_body(parent_body) returns a valid articulation) between
add_joint_fixed and the _add_base_joint call.
🧹 Nitpick comments (2)
newton/tests/test_import_urdf.py (1)
1260-1301: Consider consolidating duplicate test.This test (
test_base_joint_dict_conflicting_keys_fails) duplicates the functionality oftest_base_joint_dict_with_conflicting_parent(lines 717-766). Both tests verify that thebase_jointdict cannot contain'parent','child', or'parent_xform'keys.Consider removing one of these tests to avoid redundant test maintenance.
newton/tests/test_import_usd.py (1)
2181-2209: Align base_joint “string” test names/docstrings with actual inputs.These tests describe “string” inputs but pass dict configs. Consider renaming for accuracy, or add real string cases if the API supports them.
Also applies to: 2294-2316, 3913-3943, 4557-4638
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
newton/_src/utils/import_mjcf.py (1)
1565-1609:⚠️ Potential issue | 🟠 MajorStatic worldbody geoms/sites should use
effective_xformwhenparent_bodyis set.Bodies are transformed with
effective_xform, but worldbody geoms/sites still usexform, which leaves them at the wrong world pose when attaching to a parent body. Usingeffective_xformkeeps the entire import consistent.🛠️ Suggested fix
- parse_shapes( + parse_shapes( defaults=world_defaults, body_name="world", link=-1, geoms=world.findall("geom"), density=default_shape_density, - incoming_xform=xform, + incoming_xform=effective_xform, ) if parse_sites: _parse_sites_impl( defaults=world_defaults, body_name="world", link=-1, sites=world.findall("site"), - incoming_xform=xform, + incoming_xform=effective_xform, )
🤖 Fix all issues with AI agents
In `@newton/tests/test_import_mjcf.py`:
- Around line 4040-4079: Test currently reads world positions from
ModelBuilder.body_q which may be parent-relative during build; instead call
builder.finalize() then compute forward kinematics via builder.eval_fk() and use
the resulting world-space transforms (positions) for ee and gripper comparisons
(replace references to builder.body_q[...] with the positions returned by
eval_fk). Ensure you finalize the builder before calling eval_fk so the FK uses
the completed model.
In `@newton/tests/test_import_usd.py`:
- Around line 2181-2231: Two tests share the same name
test__add_base_joints_to_floating_bodies_base_joint_dict which causes the latter
to overwrite the former; rename the second test function to a unique name (e.g.,
test__add_base_joints_to_floating_bodies_base_joint_dict_revolute) so both tests
run, and update any references/comments accordingly; locate the duplicate
function definitions around the uses of
builder._add_base_joints_to_floating_bodies and
newton.ModelBuilder.JointDofConfig to make the change.
🧹 Nitpick comments (1)
newton/tests/test_import_usd.py (1)
3872-4559: Remove unused# noqa: PLC0415directives to satisfy Ruff.
Ruff flags these as unused across the newly added USD tests; dropping the directives will clear the warnings.
b9fc5c8 to
f40e3cb
Compare
adenzler-nvidia
left a comment
There was a problem hiding this comment.
2 more comments - also can you resolve the coderabbit comments that are fixes? I think coderabbit can't do it by itself because you force-pushed.
adenzler-nvidia
left a comment
There was a problem hiding this comment.
Looking good now, let's get this in!
dismissing change request after updates
* [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>
Description
Newton Migration Guide
Please ensure the migration guide for warp.sim users is up-to-date with the changes made in this PR.
docs/migration.rstis up-to dateBefore your PR is "Ready for review"
newton/tests/test_examples.py)pre-commit run -aSummary by CodeRabbit
New Features
Behavior & Validation
Tests