InsertModelSDF potential race condition
I am trying to programmatically add objects to an environment with InsertModelSDF
. There seems to be a race condition that causes this to sporadically fail if InsertModelSDF
is called too quickly after init_world
. This test script reliably fails on the first iteration and, additionally, sometimes fails on the second iteration of the loop:
Additionally, I noticed a few other quirks that are potentially relevant:
GetModel
only returns the new model afterrunWorld
has run for at least one timestep.- There is no reliable way of telling if
InsertModelSDF
failed.
Am I doing something wrong in my test script (e.g. neglecting acquire a lock)? Also, is there any way to force this data to refresh without running a simulation timestep?
In your test script you don't declare `model_path`. Can you fix it?
I accidentally removed that line when cleaning up the code. It's fixed now (same URL).