Issues regarding Rigid and Geometry Prims

Hello team,

I am running robotic simulations with YCB objects placed on a table (see attached image below). I spawn all the objects at appropriate locations in the scene using Isaac’s bounding box computations and use the contact sensor to detect collisions between the robot and objects.

Previously, I have been running the simulations (for reinforcement learning) in Isaac Sim 2021.1.1 and I have recently been porting everything to Isaac Sim 2022.1.0. I am now using all the new APIs and am using the same setup as OmniIsaacGymEnvs [https://OmniIsaacGymEnvs)GitHub - NVIDIA-Omniverse/OmniIsaacGymEnvs: Reinforcement Learning Environments for Omniverse Isaac Gym]. However, I’m having difficulty working with the collision objects in the world in the new Isaac 2022…

  1. Firstly, I don’t yet understand the correct usage of RigidPrims and GeometryPrims. It would seem that GeometryPrims are for ‘static’ objects that have a geometry defined (with or without collisions), while RigidPrims are for ‘dynamic’ objects (with or without collisions). However, the examples with dynamic objects have BOTH Rigid and Geometry Prim properties applied to them (For eg. omni.isaac.core.objects.DynamicCuboid). Why do I need both of these properties?

  2. I can make do with just ‘static’ objects in the scene for now. Using just the GeometryPrim class works fine for the most part. However, the contact sensor does not work with only the GeometryPrim property
    I use the following code snippet:

    from omni.isaac.core.prims.geometry_prim import GeometryPrim
    import torch
    add_reference_to_stage(object_usd_path, prim_path + "/obstacle/" + name)
    obj = GeometryPrim(
        prim_path=prim_path + "/obstacle/" + name,
        name=name,
        position= torch.tensor([0.0, 0.0, 0.0], device=device),
        orientation= torch.tensor([0.707106, 0.707106, 0.0, 0.0], device=device),
        scale=[0.01,0.01,0.01], # Has to be scaled down to metres. Default usd units for these objects is cms
        collision=True
    )
    # Enable tight collision approximation
    obj.set_collision_approximation("convexDecomposition")

I checked and the CollisionAPI is definitely applied to the prim so this lack of contact sensing is strange. I also verified this with the contact sensor example (isaac_sim-2022.1.0/standalone_examples/api/omni.isaac.ros_bridge/contact.py). If you use a ‘FixedCuboid’ instead of a ‘DynamicCuboid’ and place it on the ground, contacts with the ground are not detected…

  1. I am now using applying both Rigid and Geometry Prim properties to my objects and am able to move them and detect contacts:
    from omni.isaac.core.prims.geometry_prim import GeometryPrim
    from omni.isaac.core.prims.rigid_prim import RigidPrim
    import torch
    add_reference_to_stage(object_usd_path, prim_path + "/obstacle/" + name)
    obj = GeometryPrim(
        prim_path=prim_path + "/obstacle/" + name,
        name=name,
        position= torch.tensor([0.0, 0.0, 0.0], device=device),
        orientation= torch.tensor([0.707106, 0.707106, 0.0, 0.0], device=device),
        scale=[0.01,0.01,0.01], # Has to be scaled down to metres. Default usd units for these objects is cms
        collision=True
    )
    # Enable tight collision approximation
    obj.set_collision_approximation("convexDecomposition")

    RigidPrim.__init__(
        obj,
        prim_path=prim_path + "/obstacle/" + name,
        name=obj.name,
        position= torch.tensor([0.0, 0.0, 0.0], device=device),
        orientation= torch.tensor([0.707106, 0.707106, 0.0, 0.0], device=device),
        scale=[0.01,0.01,0.01], # Has to be scaled down to metres. Default usd units for these objects is cms
    )

However, whenever I move the object using obj.set_world_pose(orientation=torch.tensor([0.707106, 0.707106, 0.0, 0.0], device=device)), it successfully moves the object to the correct position/orientation but shows the error on the command line: "PhysX error: PxRigidDynamic::setGlobalPose: pose is not valid. /source/physx/src/NpRigidDynamic.cpp, LINE 85". This only happens when the RigidPrim class is also applied to the object. It does not happen when only the GeometryPrim class is applied to the object. What is the reason for this error? And if it can be ignored, how can I suppress it?

Regards,
Snehal Jauhri

1 Like

Hi - Sorry for the delay in the response. Let us know if you still having this issue/question with the latest Isaac Sim 2022.2.1 release.

Hello team,

Upon updating to Isaac 2022.2 we have further issues.

What we would like to understand is the following:

  1. We need to simulate objects that can be placed at any location and moved anywhere in the scene. The robot can collide with the objects. As we understand it, this would mean that the objects should have BOTH RigidPrim and GeometryPrim attributes. Is this true??

  2. The only example we found for this was the DynamicObject class at the path “isaac_sim-2022.2.0/standalone_examples/replicator/offline_pose_generation/flying_distractors/dynamic_object.py”. This Dynamic object class seems to be adding RigidPrim properties to the prim while adding GeometryPrim properties to the underlying mesh. The problem we still have is that we use the world scene functions such as “set_world_pose”, “get_world_pose” and “compute_object_AABB” functions to move the objects, get their pose and compute their bounding box. Currently the “get_world_pose” and “compute_object_AABB” functions don’t work as expected and their values are not updated. we think this is because of the RigidPrim property. What is the correct way to continue using these functions with a RigidPrim??

Regards,
Snehal Jauhri

Hi @SnehalJauhri - Apologies for no earlier response on this forum post.

Can you please summarize all issues that you are seeing with the current Isaac Sim 2022.2.1 release?