Skip to content

Fix Newton rigid object root state writers#6004

Merged
AntoineRichard merged 2 commits into
isaac-sim:developfrom
ooctipus:fix/newton-root-state-keywords
Jun 9, 2026
Merged

Fix Newton rigid object root state writers#6004
AntoineRichard merged 2 commits into
isaac-sim:developfrom
ooctipus:fix/newton-root-state-keywords

Conversation

@ooctipus

@ooctipus ooctipus commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • call Newton rigid-object pose and velocity helper methods with explicit keyword arguments from deprecated root-state writer wrappers
  • align the Newton rigid-object wrappers with the keyword-only helper signatures and the other physics backends
  • add a Newton changelog fragment

Tests

  • git diff --cached --check before commit
  • syntax parsed modified Python file with ast.parse
  • Not run: Isaac Sim tests in this local environment are missing Python dependency lazy_loader

@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Jun 6, 2026
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes three deprecated root-state writer wrappers in the Newton RigidObject class that were calling keyword-only helper methods positionally, which would raise a TypeError at runtime. The fix adds the required root_pose= and root_velocity= keyword arguments to match the *-separated signatures of write_root_link_pose_to_sim_index, write_root_com_pose_to_sim_index, write_root_com_velocity_to_sim_index, and write_root_link_velocity_to_sim_index.

  • Three deprecated wrappers (write_root_state_to_sim, write_root_com_state_to_sim, write_root_link_state_to_sim) now forward their tensor slices with correct keyword arguments to the keyword-only helper methods.
  • A changelog fragment is added under isaaclab_newton/changelog.d/ describing the fix.

Confidence Score: 5/5

Safe to merge — the change is a minimal, targeted correction that makes the three deprecated wrappers callable without raising a TypeError.

All four helper methods use keyword-only signatures (* separator), so the positional calls in the old code would have raised TypeError on any invocation. The fix correctly threads the tensor slices through as named arguments. No logic is changed, and there are no other code paths affected by these six one-line edits.

No files require special attention.

Important Files Changed

Filename Overview
source/isaaclab_newton/isaaclab_newton/assets/rigid_object/rigid_object.py Adds keyword arguments (root_pose=, root_velocity=) to six positional call sites in three deprecated wrappers so they satisfy the keyword-only (*) signatures of the underlying helpers. Fix is minimal, targeted, and correct.
source/isaaclab_newton/changelog.d/fix-rigid-object-state-writers.rst New changelog fragment accurately describes the bug fix for the deprecated root state writers.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant Wrapper as Deprecated Wrapper
    participant Helper as Keyword-Only Helper

    Caller->>Wrapper: write_root_state_to_sim(root_state, env_ids)
    Note over Wrapper: Slices root_state[:, :7] as pose
    Note over Wrapper: Slices root_state[:, 7:] as velocity
    Wrapper->>Helper: "write_root_link_pose_to_sim_index(root_pose=pose, env_ids=env_ids)"
    Wrapper->>Helper: "write_root_com_velocity_to_sim_index(root_velocity=velocity, env_ids=env_ids)"
    Note over Wrapper,Helper: Before fix: positional args raised TypeError
    Note over Wrapper,Helper: After fix: keyword args dispatch correctly
Loading

Reviews (1): Last reviewed commit: "Fix Newton rigid object root state write..." | Re-trigger Greptile

@ooctipus ooctipus requested a review from AntoineRichard June 7, 2026 08:28

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Verdict: ✅ Clean, minimal bugfix — ready to merge

This PR correctly fixes a TypeError that occurs when the deprecated root state writer wrappers (write_root_state_to_sim, write_root_com_state_to_sim, write_root_link_state_to_sim) call the keyword-only helper methods without using explicit keyword arguments.


Analysis

Root Cause: The Newton backend's helper methods (write_root_link_pose_to_sim_index, write_root_com_pose_to_sim_index, write_root_com_velocity_to_sim_index, write_root_link_velocity_to_sim_index) all enforce keyword-only parameters via the * separator in their signatures:

def write_root_link_pose_to_sim_index(self, *, root_pose: ..., env_ids: ...) -> None:

The deprecated wrappers were passing root_state[:, :7] and root_state[:, 7:] as positional arguments, which Python rejects with TypeError: takes 1 positional argument but 2 positional arguments were given.

Fix correctness: Each wrapper now passes the tensor slices as the correct keyword argument:

  • Pose calls → root_pose=root_state[:, :7]
  • Velocity calls → root_velocity=root_state[:, 7:]

The keyword names match the helper signatures exactly across all three wrappers.


Findings

# Severity Finding
1 💡 info The changelog fragment correctly documents the fix under Fixed using towncrier RST format.
2 💡 info CI checks (pre-commit, license-check, build-wheel, changelog fragments) all pass. Installation tests are still pending but unrelated to this code change.
3 ⚠️ minor The PR description notes tests were not run due to missing lazy_loader dependency locally. Since these are deprecated wrappers forwarding to well-tested helpers, runtime risk is low — but adding a unit test calling write_root_state_to_sim through the deprecated path would provide regression coverage if the helper signatures change again in the future.

Summary of Changes

File Change
rigid_object.py 6 lines: positional → keyword arguments in 3 deprecated wrappers
fix-rigid-object-state-writers.rst New changelog fragment (5 lines)

No functional behavior change beyond fixing the crash. The fix is minimal, correctly scoped, and aligns the Newton backend with the keyword-only convention used across the codebase.

@AntoineRichard AntoineRichard merged commit 563388a into isaac-sim:develop Jun 9, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants