Simulation of multiple RigidBodyAPI's in a hierarchy



I am using Omniverse Isaac Sim for reinforcement learning. I am trying to solve the peg in hole task using Panda arm. I created the peg (cylinder shape) in Blender and exported it as usd file. In order to add the peg to my simulation, I created a Rigidprim class and added the usd path: add_reference_to_stage(self._usd_path, prim_path)

However, as I added the rigid body with colliders preset physics to the peg for the collision, I got this error: [omni.physicsschema.plugin] Rigid Body of (/World/envs/env_0/peg/cylinder) missing xformstack reset when child of rigid body (/World/envs/env_0/peg) in hierarchy. Simulation of multiple RigidBodyAPI’s in a hierarchy will cause unpredicted results. Please fix the hierarchy or use XformStack reset.

How can I fix the hierarchy?
Thank you

Could you please make sure that under the /World/envs/env_0/peg tree, only a single prim has a RigidBodyAPI applied to it? Physics does not allow having multiple RigidBodyAPIs defined in a hierarchy.

Yes, but how can I fix this Hierarchy? Or how can I add the usd file of Blender properly so that the mesh (peg) collides with panda arm? I accually need the mesh created in Blender to be a rigid body since I wanted to be lifted. And in order to add it to my simulation, I had to put it inside a Rigidprim. I also tried Xfromprim and Geometryprim but the mesh(peg) still not movable.
Thank you very much for your help
This is the class:

You can try making the peg asset a rigid body by modifying the asset USD. Right click on the prim of the rigid body and choose Add > Physics > Rigid Body. Then, in your code, you can reference the peg asset as a XformPrim to add it to simulation, similar to how the cube is added here: OmniIsaacGymEnvs/ at main · NVIDIA-Omniverse/OmniIsaacGymEnvs · GitHub. Feel free to also reference the block.usd setup on the IsaacSim Nucleus server at Isaac/Props/Blocks/block.usd