-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Replaces IsaacSim XFormPrim with reduced IsaacLab version
#4070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Greptile OverviewGreptile SummaryThis PR introduces a new IsaacLab implementation of Critical Issues:
Impact:
Confidence Score: 0/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
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
|
There was a problem hiding this 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
| if self._is_valid: | ||
| raise Exception(f"prim view {self._regex_prim_paths} is not a valid view") |
There was a problem hiding this comment.
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
| 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: |
There was a problem hiding this comment.
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
| for idx, curr_env_id in env_ids: | |
| for idx, curr_env_id in enumerate(env_ids): |
| if self._is_valid: | ||
| raise Exception(f"prim view {self._regex_prim_paths} is not a valid view") |
There was a problem hiding this comment.
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
| 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) |
There was a problem hiding this comment.
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)
| 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]) |
| if self._is_valid: | ||
| raise Exception(f"prim view {self._regex_prim_paths} is not a valid view") |
There was a problem hiding this comment.
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
| 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") |
| if self._is_valid: | ||
| raise Exception(f"prim view {self._regex_prim_paths} is not a valid view") |
There was a problem hiding this comment.
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
| 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") |
| if self._is_valid: | ||
| raise Exception(f"prim view {self._regex_prim_paths} is not a valid view") |
There was a problem hiding this comment.
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
| 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") |
| if self._is_valid: | ||
| raise Exception(f"prim view {self._regex_prim_paths} is not a valid view") |
There was a problem hiding this comment.
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
| 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") |
| if self._is_valid: | ||
| raise Exception(f"prim view {self._regex_prim_paths} is not a valid view") |
There was a problem hiding this comment.
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
| 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) |
There was a problem hiding this comment.
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
| 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)) |
Description
Replaces IsaacSim
XFormPrimwith reduced IsaacLab versionType of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there