Give a mass to a loaded urdf

I am trying to import a simple urdf block with Python and giving it a mass. To do so, I am creating a RigidPrim (which has the mass api) from the loaded urdf. However, I keep having this issue:

2022-10-18 13:24:21 [8,739ms] [Error] [omni.physicsschema.plugin] Rigid Body of (/World/box/block_1_base_link) missing xformstack reset when child of rigid body (/World/box) in hierarchy. Simulation of multiple RigidBodyAPI's in a hierarchy will cause unpredicted results. Please fix the hierarchy or use XformStack reset.

The hierarchy of the block is as follows:

I understand the problem (see How to do xformstack reset?) but I cannot found a solution to my issue, loading a urdf and giving it a mass. Has anyone a solution ?

Here is the code to reproduce the issue load_urdf.zip (1.8 KB)

Hi @loic.sacre

Your object has the following schema:

box (articulation)
  |-- block_1_base_link (riding prim)

What about setting the mass directly on the rigid object

prim = RigidPrim(prim_path="/World/box/block_1_base_link", mass=1)

instead of applying it on the articulation?

By doing it the RigidPrim will use the current applied rigid body API…
Otherwise, it will apply a rigid body API to the articulation resulting in the nested rigid body problem.

Hi @toni.sm,

Thanks it works !

I did test this solution in my codebase before posting this issue but the block was floating in the air (like if no gravity was applied to it)

I have just pointed out that in my default config use_flatcache was set to True and was causing the issue. Do you know what is this config used for ?

@loic.sacre

Flatcache allows simulating faster by disconnecting the physics from USD update.
That’s why the block was floating in the air like if no gravity was applied to it

See more here:

https://docs.omniverse.nvidia.com/prod_extensions/prod_extensions/ext_physics.html#physx-short-flatcache-also-known-as-fabric-rename-in-next-release

1 Like

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