RigidPrimView reg-exp path Error

The error occurs after RigidPrimView initializes with multi-regular expressions in prim_paths_expr of RigidPrimView.

Codes:
rigids = RigidPrimView(prim_paths_expr=f"{base_env_path}/.*/Humanoid/(?!joints).")
world.scene.add(rigids)
world.reset()

Error:
2023-05-27 10:11:34 [13,934ms] [Warning] [omni.usd] Warning: in SdfPath at line 97 of /buildAgent/work/ca6c508eae419cf8/USD/pxr/usd/sdf/path.cpp – Ill-formed SdfPath </World/envs/env_66/Humanoid/(?!joints).+>: syntax error

Hi @hardy3663 - It seems like a syntex error in your code. Can you try to update your code based on this core API document?
https://docs.omniverse.nvidia.com/py/isaacsim/source/extensions/omni.isaac.core/docs/index.html#module-omni.isaac.core.prims

The path works well in omni.isaac.core.utils.prims.find_matching_prim_paths, the error occurs at articulation_view.py

The error message indicates that the regular expression you’re using in prim_paths_expr is not valid for the SdfPath class in the USD library. The SdfPath class expects a string that represents a path in the scene graph, and it does not support regular expressions.

The RigidPrimView class in Isaac Sim is designed to create a view of all rigid bodies that match a certain pattern in the scene graph. The prim_paths_expr parameter is a string that specifies this pattern. It can contain wildcard characters (* and ?), but it does not support full regular expressions.

If you want to create a view of all rigid bodies in the Humanoid group except those in the joints group, you might need to do it in two steps:

  1. Create a view of all rigid bodies in the Humanoid group:
rigids = RigidPrimView(prim_paths_expr=f"{base_env_path}/.*/Humanoid/*")
world.scene.add(rigids)
  1. Then, remove the rigid bodies in the joints group from the view:
joints = RigidPrimView(prim_paths_expr=f"{base_env_path}/.*/Humanoid/joints/*")
for joint in joints:
    rigids.remove(joint)

Please note that this code is a general example and might need to be adjusted based on your specific setup and requirements. Also, make sure that the scene is properly set up and the paths are correct before trying to create the views.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.