Actor's data set to nan



I have a 7DOF franka robot in an environment with multiple objects (including a collision-free target, a mug and a table).


After what seems like a random number of steps, the mug’s position, velocities, orientation and any other data associated with it is set to nan. The only way to get rid of this is to call my reset function which works similarly to the example in

What I’ve tried

I’ve tried to replicate this by replaying the same actions taken during the failure episode, however, it doesn’t seem to trigger it. In one such episode, the robot didn’t even touch the mug and the error still appears.
I’ve also tried to simulate each possible spawning position. Unfortunately, this didn’t trigger it either.

Any ideas what could cause this? Thanks in advance!

Hi @mihai.anca13,

Usually, nans can be observed when the simulation instability occurs. What are your physics simulation parameters - dt, the number of substeps, number of position iterations?

I can recommend to start with increasing a number of position iterations or substeps and check if nans still happen,

Hi @vmakoviychuk. Thank you for your reply!

Here are the parameters used:

dt = 1/100
substeps = 4
num_position_iterations = 10
num_velocity_iterations = 1

I will try increasing the num_velocity_iterations and see if that makes a difference.

Velocity iterations shouldn’t make any change, 0 or is usually a good default choice. Looking at your parameters, they should be more than ok, even for more challenging simulation scenarios. The next hypothesis is that if a random generation of start object configurations is used, sometimes they can start with colliding with each other. It would be good to try to localize the exact moment when instability happens.

Thank you for your swift reply. That’s what I focused on next. I deliberately spawned objects colliding to see if I can replicate the issue. The objects explode, but no nan value is returned.