Collision rendering inconsistent in train.py custom program

Good afternoon,

I am having some issues with my tensor training code. If you can see the video, you will see that initially, the cube is spawned below the ball that is dropping from above. It clips through the box as though there was no collision. When the ball and box are respawned, it is slightly offset from before, and the ball hits the corner of the box and is pushed to the side from the collision. This is consistent with other balls/boxes in the other environments within the simulation: whether the collision is detected seems to be random.

I have collision rendering turned on for the ball as well as the box so long as they are within the same environment, which they are in this case:
ball = self.gym.create_actor(env, ball_asset, self.ball_pose, “ball”, i, 0)
box = self.gym.create_actor(env, asset_box, pose, “box”, i, 0)

When I do the same in a program that doesn’t involve training or tensors, just dropping the ball onto the box, collision is detected 100% of the time. See image below:


Screenshot from 2022-02-03 15-06-23

The code I used to set up the environments are identical between these two codes, and both are using the GPU for PhysX rendering. I’m wondering what might be causing Isaac gym to miss the collisions when conducting training.

1 Like

Here’s another example of similar collision geometry failures. The code for creating the environment is below, and in the image I selected the option to render collision meshes:

for i in range(num_envs):
# create env
env = gym.create_env(sim, env_lower, env_upper, num_per_row)
envs.append(env)

# generate random bright color
c = 0.5 + 0.5 * np.random.random(3)
color = gymapi.Vec3(c[0], c[1], c[2])
#add capsule
ahandle = gym.create_actor(env, asset, pose, "actor", i, 0)
handles.append(ahandle)
gym.set_rigid_body_color(env, ahandle, 0, gymapi.MESH_VISUAL_AND_COLLISION, color)
#add bowl

bhandle = gym.create_actor(env, bowl, pose_b, "bowl", i, 0)
handles.append(bhandle)

I continued looking into it, and as of right now it seems to be due to a glitch in the program. The collisions render when the block only shifts in a single direction - for example, if the block moves to a different location in z it still collides. But when the block moves in both z and x the collision does not render.

I found a solution to the collisions not being rendered. I added joints to the URDF files used to create the blocks. Just a single joint was sufficient to cause the collisions to be rendered. I am not sure why it would work without joints when I was only moving the cube in a single direction and this seems like something Nvidia may be interested in taking a look at.

I have had this same problem. For me the problem appears only after the environment resets a few times. Oftentimes it appears as though the block is getting reset to a different position every time and the collision eventually breaks. I am using the gym.create_box function to create blocks, which shouldn’t require a URDF file. I would argue that your solution is more of a temporary work around and that there is a bug that actually needs to be addressed. My point being that saying that this is a solved problem is dis-informative.

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