bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
http://bulletphysics.org
Other
12.18k stars 2.85k forks source link

Reproducibility via explicitly setting random seed? #4613

Open LemonPi opened 1 month ago

LemonPi commented 1 month ago

Discussed in https://github.com/bulletphysics/bullet3/discussions/4612

Originally posted by **LemonPi** May 8, 2024 I'd like to be able to reproduce robot-object interaction trajectories, however the objects behave different (bounce to a different position) even when I use the same random seed. Is there a way to ensure reproducible simulations? I'm setting the seed for python, numpy, and pytorch: ```python random.seed(randseed) np.random.seed(randseed) torch.manual_seed(randseed) if torch.cuda.is_available(): torch.cuda.manual_seed_all(randseed) ``` Does pybullet use a C++ RNG that we can set the seed for?