Replies: 3 comments
-
Indeed. Save/restore state is not compatible with sleeping/deactivation at the moment. For now, it is best to disable sleeping if you rely on determinism and save/restore state. |
Beta Was this translation helpful? Give feedback.
-
I see! Thank you so much for clarifying Erwin! Feel free to close the issue, I just wanted to documented/provide a test-case if this was an untracked bug. |
Beta Was this translation helpful? Give feedback.
-
You are welcome, and thanks a lot for clear description of reproduction of both bugs! I've been busy with Brax and tiny-differentiable-simulator projects, hope to sometimes come back to PyBullet to improve things like this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reproduction
The reproduction scripts, including assets, for the bug are located here:
https://drive.google.com/file/d/1-ym77X1yYny8EzQ-QRBPmW--U6NY4X2U/view?usp=sharing
The reproduction scripts are titled
bug_1.py
andbug_2.py
.Issue 1 (bug_1.py)
p.saveState
on a state containing awake objects does not result in the awake state being restored onp.restoreState
. The state of an object on which you apply force must be restored manually by callingp.changeDynamics
with the activation state and stepping physics withp.step()
Issue 2 (bug_2.py)
In the same problem setup as 1:
After 4 restoreState calls, object 2 will no longer wake up as object 3 approaches, so object 3 passes through object 2 without triggering a collision. The workaround is not to use restoreState, but call resetBasePositionAndOrientation to manually reset the state.
cc @fxia22 @ChengshuLi
Beta Was this translation helpful? Give feedback.
All reactions