isaac-sim / IsaacGymEnvs

Isaac Gym Reinforcement Learning Environments
Other
2.02k stars 426 forks source link

Visualizing Contact Force #56

Closed Kashu7100 closed 2 years ago

Kashu7100 commented 2 years ago

Hello,

Is there any way to render the (foot) contact force as an arrow in the simulator? Any code snippet is appreciated.

Sincerely,

jinseokbae commented 2 years ago

Hi, You can visualize contacts when running simulation in the CPU device. Try using draw_env_rigid_contacts (further explanation is written in the official api document released with the preview source code). You may include it in the render function.

Kashu7100 commented 2 years ago

Thank you for your reply. Is there any way to do this on GPU (I got the following error when trying on GPU)?

[Error] [carb.gym.plugin] Function GymDrawEnvRigidContacts cannot be used with the GPU pipeline after simulation starts.  Please use the tensor API if possible.  See docs/programming/tensors.html for more info.
jinseokbae commented 2 years ago

I've tried only in the CPU pipeline. Maybe it is yet to be implemented in GPU pipeline. I think you need to wait for the developer's reply. Hope figuring this out!

Yasu31 commented 1 year ago

I would like to add that in order for the contacts to be processed, the contact_collection parameter for physx must be set to CC_LAST_SUBSTEP or CC_ALL_SUBSTEPS (though the latter says "broken - do not use!" so the former is probably better) instead of CC_NEVER, which is the default for some environments, e.g. https://github.com/NVIDIA-Omniverse/IsaacGymEnvs/blob/dee7c56765e14f6f4344c4d2e91d7a9eb3bfa619/isaacgymenvs/cfg/task/ShadowHand.yaml#L190