Skip to content

Fix exception during io_descriptors creation#5058

Open
prina404 wants to merge 1 commit intoisaac-sim:developfrom
prina404:develop
Open

Fix exception during io_descriptors creation#5058
prina404 wants to merge 1 commit intoisaac-sim:developfrom
prina404:develop

Conversation

@prina404
Copy link

Description

Added wp.to_torch wrappers needed for io_descriptors creation in ManagerBasedEnv.

This PR partially fixes #5057

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@prina404 prina404 requested a review from Toni-SM as a code owner March 18, 2026 14:59
@github-actions github-actions bot added the isaac-lab Related to Isaac Lab team label Mar 18, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR fixes a runtime exception in export_articulations_data() within io_descriptors.py by wrapping raw warp array accesses with wp.to_torch() before calling PyTorch tensor methods (.detach().cpu().numpy().tolist()). The root cause was that articulation data properties such as default_joint_pos, default_joint_vel, joint_damping, joint_stiffness, joint_friction_coeff, joint_armature, and default_joint_pos_limits all return wp.array objects (confirmed in both isaaclab_physx and isaaclab_newton backends), which do not expose PyTorch's .detach() method.

Key points:

  • The fix is consistent with the existing wp.to_torch() usage already present in record_joint_pos_offsets (line 324) and record_joint_vel_offsets (line 341) in the same file.
  • All seven affected data accesses in export_articulations_data() are correctly wrapped.
  • No tests were added to prevent regression of this bug.
  • articulation.data.default_joint_pos_limits is marked for deprecation in IsaacLab 4.0 (see base_articulation_data.py), so this code path may need to be revisited in a future release.

Confidence Score: 4/5

  • This PR is safe to merge; the fix is correct, targeted, and consistent with existing patterns in the file.
  • The fix correctly applies wp.to_torch() to warp arrays before calling PyTorch tensor methods, matching how the same data types are handled elsewhere in the file. Both physx and newton backends confirm these properties return wp.array. The only notable gaps are the absence of regression tests and the use of the soon-to-be-deprecated default_joint_pos_limits property, neither of which is a blocker.
  • No files require special attention; source/isaaclab/isaaclab/envs/utils/io_descriptors.py is the only substantive change and the fix is straightforward.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/envs/utils/io_descriptors.py Wraps 7 warp array accesses in export_articulations_data() with wp.to_torch() to fix a runtime AttributeError; fix is correct and consistent with existing usage in the same file.
CONTRIBUTORS.md Adds contributor name in alphabetical order — no issues.

Sequence Diagram

sequenceDiagram
    participant Env as ManagerBasedEnv
    participant IoDesc as export_articulations_data()
    participant ArtData as ArticulationData (wp.array)
    participant WP as wp.to_torch()
    participant Torch as PyTorch Tensor

    Env->>IoDesc: call export_articulations_data(env)
    IoDesc->>ArtData: articulation.data.default_joint_pos
    ArtData-->>IoDesc: wp.array
    IoDesc->>WP: wp.to_torch(wp.array)
    WP-->>IoDesc: torch.Tensor
    IoDesc->>Torch: [0].detach().cpu().numpy().tolist()
    Torch-->>IoDesc: list[float]
    Note over IoDesc: Repeated for all 7 data fields
    IoDesc-->>Env: dict[str, dict[str, list[float]]]
Loading

Last reviewed commit: "Fix exception raised..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant