Skip to content

Conversation

@pascal-roth
Copy link
Collaborator

@pascal-roth pascal-roth commented Nov 23, 2025

Description

Replaces IsaacSim XFormPrim with reduced IsaacLab version

Type of change

  • Dependency Removal

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

@github-actions github-actions bot added enhancement New feature or request isaac-lab Related to Isaac Lab team labels Nov 23, 2025
@pascal-roth pascal-roth marked this pull request as draft November 23, 2025 10:10
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 23, 2025

Greptile Overview

Greptile Summary

This PR introduces a new IsaacLab implementation of XFormPrim to replace the IsaacSim dependency. However, the implementation contains multiple critical bugs that will cause runtime failures:

Critical Issues:

  • Inverted validation logic (if self._is_valid instead of if not self._is_valid) in 11 methods - all validation checks will raise exceptions when prims are valid
  • Missing self._backend_utils attribute referenced on line 412, causing AttributeError
  • Incorrect function calls to _get_world_pose_transform_w_scale() with wrong number of arguments (lines 338, 710)
  • Incorrect unpacking in get_visibilities() enumerate loop (line 273)

Impact:

  • All imports from isaacsim.core.prims need to be updated to use this new implementation
  • Multiple files depend on XFormPrim: cameras, ray casters, interactive scene, and device handlers
  • These bugs will break basic functionality like getting/setting poses, scales, and visibilities

Confidence Score: 0/5

  • This PR is not safe to merge and will cause immediate runtime failures
  • The code contains 12+ critical logical errors including inverted validation logic throughout all methods, missing class attributes, and incorrect function signatures that will cause crashes on any usage
  • source/isaaclab/isaaclab/sim/utils/x_form_prim.py requires immediate attention - every validation check is inverted and will fail

Important Files Changed

File Analysis

Filename Score Overview
source/isaaclab/isaaclab/sim/utils/x_form_prim.py 0/5 New XFormPrim implementation with critical logic errors - inverted validation checks, missing _backend_utils attribute, and incorrect function calls

Sequence Diagram

sequenceDiagram
    participant User
    participant XFormPrim
    participant SimulationContext
    participant USD/UsdGeom
    participant prim_utils
    
    User->>XFormPrim: __init__(prim_paths_expr, positions, etc.)
    XFormPrim->>prim_utils: find_matching_prim_paths(expression)
    prim_utils-->>XFormPrim: matching paths list
    XFormPrim->>prim_utils: get_prim_at_path(path)
    prim_utils-->>XFormPrim: USD prims
    XFormPrim->>SimulationContext: get instance
    SimulationContext-->>XFormPrim: device
    XFormPrim->>XFormPrim: _set_xform_properties()
    XFormPrim->>XFormPrim: set_world_poses() / set_local_poses()
    
    User->>XFormPrim: get_world_poses(env_ids)
    XFormPrim->>XFormPrim: _get_world_pose_transform_w_scale()
    XFormPrim->>USD/UsdGeom: ComputeLocalToWorldTransform()
    USD/UsdGeom-->>XFormPrim: transformation matrix
    XFormPrim-->>User: positions, orientations
    
    User->>XFormPrim: set_world_poses(positions, orientations)
    XFormPrim->>USD/UsdGeom: get parent transform
    XFormPrim->>XFormPrim: calculate local from world (MISSING _backend_utils)
    XFormPrim->>XFormPrim: set_local_poses()
    XFormPrim->>USD/UsdGeom: Set xformOp attributes

Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 12 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +229 to +230
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: logic inverted - should check not self._is_valid

Suggested change
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
if not self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")

env_ids = env_ids.tolist()

visibilities = np.zeros(shape=env_ids.shape[0], dtype="bool")
for idx, curr_env_id in env_ids:
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: unpacking will fail - enumerate() returns (idx, value) tuple, not individual values

Suggested change
for idx, curr_env_id in env_ids:
for idx, curr_env_id in enumerate(env_ids):

Comment on lines +328 to +329
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: logic inverted - should check not self._is_valid

Suggested change
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
if not self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")

orientations = np.zeros((env_ids.shape[0], 4), dtype=np.float32)

for idx, curr_env_id in enumerate(env_ids.tolist()):
result_transform = _get_world_pose_transform_w_scale(self._prim_paths[curr_env_id], False)
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: function called with 2 arguments but only accepts 1 parameter (removed fabric parameter on line 703)

Suggested change
result_transform = _get_world_pose_transform_w_scale(self._prim_paths[curr_env_id], False)
result_transform = _get_world_pose_transform_w_scale(self._prim_paths[curr_env_id])

Comment on lines +392 to +393
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: logic inverted - should check not self._is_valid

Suggested change
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
if not self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")

Comment on lines +531 to +532
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: logic inverted - should check not self._is_valid

Suggested change
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
if not self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")

Comment on lines +558 to +559
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: logic inverted - should check not self._is_valid

Suggested change
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
if not self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")

Comment on lines +597 to +598
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: logic inverted - should check not self._is_valid

Suggested change
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
if not self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")

Comment on lines +637 to +638
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: logic inverted - should check not self._is_valid

Suggested change
if self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")
if not self._is_valid:
raise Exception(f"prim view {self._regex_prim_paths} is not a valid view")

parent_prim = get_prim_parent(prim_utils.get_prim_at_path(prim_path=prim_path, fabric=False))
parent_world_transform = usdrt.Gf.Matrix4d(1.0)
if parent_prim:
parent_world_transform = _get_world_pose_transform_w_scale(prim_utils.get_prim_path(parent_prim), fabric=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: function called with 2 arguments (prim_path and fabric=False) but only accepts 1 parameter

Suggested change
parent_world_transform = _get_world_pose_transform_w_scale(prim_utils.get_prim_path(parent_prim), fabric=False)
parent_world_transform = _get_world_pose_transform_w_scale(prim_utils.get_prim_path(parent_prim))

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

Labels

enhancement New feature or request isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant