How to Properly Delete Objects in Isaac Gym

Issue Description

I am training reinforcement learning policies in Isaac Gym, which involves repeatedly creating and deleting objects in an open set. I noticed that Isaac Gym does not provide a direct function to delete objects based on their handle. Instead, I use the destroy_env function to delete the environment associated with each specific environment handle at the end of each episode.

Initially, this seemed to work fine, but as the algorithm runs for more episodes, I encounter the error: “contact buffer overflow detected.” This suggests that the contact buffer is not being properly cleared after calling destroy_env.

Question

How should I handle this situation to ensure that objects are properly deleted in Isaac Gym, and the contact buffer is appropriately cleared?

Is it the same object?

I’m pretty sure I read somewhere about removing objects from the scene was an issue. That might be incorrect but I have a vague memory of it.

If it’s the same object can you not teleport to a holding station rather than deleting? If it the same objects you could just have a line of teleporting out holding station then teleporting back to the start and just cycle thru the objects?