bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.

Home Page:http://bulletphysics.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reproducibility via explicitly setting random seed?

LemonPi opened this issue · comments

Discussed in #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:

    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?