Accessing existing physics simulation data via C++ shared memory

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
miker2
Posts: 3
Joined: Thu Apr 09, 2020 10:36 pm

Accessing existing physics simulation data via C++ shared memory

Post by miker2 »

I've been looking over the examples and the code but haven't found an answer to this yet. If I have an existing pybullet simulation run (all set up in python) and I want to be able to access information about that simulation (position/orientation of objects, etc), is there a way to do this?

I was thinking that if the simulation is running and is connected using the GUI_SERVER method, then I'd be able to connect to that same simulation using the shared memory API, but I haven't managed to make it work. Even simple calls like getNumBodies() seem to fail (the call succeeds, but returns 0, even though there are multiple bodies in my pybullet simulation. It appears that I'm not connecting to the existing physics simulation but a new one.

Does anyone know if this is possible (and if so, could you point me at an example)?
Post Reply