Skip to content

PhysX error when setting angular damping: PxSceneFlag::eENABLE_DIRECT_GPU_API prevents setGlobalPose / setLinearVelocity #63

@shy924

Description

@shy924

Description

I encounter a PhysX runtime error when trying to apply PhysxRigidBodyAPI and set angular damping for a prim.

The code works for creating the attribute, but during simulation PhysX throws errors related to PxSceneFlag::eENABLE_DIRECT_GPU_API.

Code

prim = stage.GetPrimAtPath(prim_path)

physx_rigid_body = PhysxSchema.PhysxRigidBodyAPI(prim)
if not physx_rigid_body:
    physx_rigid_body = PhysxSchema.PhysxRigidBodyAPI.Apply(prim)

angular_attr = physx_rigid_body.CreateAngularDampingAttr()
angular_attr.Set(angular_damping)

Error Log

[Error] [omni.physx.plugin] PhysX error: PxRigidDynamic::setGlobalPose(): it is illegal to call this method if PxSceneFlag::eENABLE_DIRECT_GPU_API is enabled!, FILE /builds/omniverse/physics/physx/source/physx/src/NpRigidDynamic.cpp, LINE 102 

[Error] [omni.physx.plugin] PhysX error: PxRigidDynamic::setLinearVelocity(): it is illegal to call this method if PxSceneFlag::eENABLE_DIRECT_GPU_API is enabled!, FILE /builds/omniverse/physics/physx/source/physx/src/NpRigidDynamic.cpp, LINE 239 

[Error] [omni.physx.plugin] PhysX error: PxRigidDynamic::setAngularVelocity(): it is illegal to call this method if PxSceneFlag::eENABLE_DIRECT_GPU_API is enabled!, FILE /builds/omniverse/physics/physx/source/physx/src/NpRigidDynamic.cpp, LINE 287

Expected Behavior

Setting the angular damping attribute should not trigger PhysX errors during simulation.

Questions

Is this caused by the PhysX scene running with PxSceneFlag::eENABLE_DIRECT_GPU_API?

Are we not allowed to modify rigid body state (angular damping) when the direct GPU API is enabled?

Is there a recommended way to configure damping parameters for rigid bodies when running GPU PhysX?

Environment

Simulator: Isaac Sim

Framework: Isaac Lab

PhysX backend: GPU PhysX

Python API: `PhysxSchema.PhysxRigidBodyAPI```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions