Custom physics server in pybullet

Post Reply
juancamilog
Posts: 1
Joined: Fri Feb 11, 2011 2:42 am

Custom physics server in pybullet

Post by juancamilog »

I'm currently trying to use the pybullet API to interface with some code that was written using the bullet2 c++ API. As the code uses a GUI, I was looking into replicating the way the GUI server is instiatied when calling pybullet.connect(pybullet.GUI). I was looking into subclassing PhysicsClientSharedMemory, overriding its methods to calls to my backend, and replacing the call to btCreateInProcessExampleBrowser with a function that would instantiate instantiate my own browser (a subclass of the ExampleBrowserInterface in the bullet2 API).
I would add a new case in the pybullet_connectPhysicsServer, eCONNECT_CUSTOM_SERVER, to connect to my custom server.

I'm not sure if this is the way to go. What would be the appropriate way to do this?

Thanks!

-- Juan
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Custom physics server in pybullet

Post by Erwin Coumans »

What do you want to replace and what do you want to keep exactly? Replace the physics engine or the 3D graphics visualizer or everything?

If you want to write a custom physics engine, we can make the PhysicsServerCommandProcessor a virtual class, and allow subclassing (I was planning this).
Replacing the entire backend/server, you could start with TCP or UDP first, and go from there.

Thanks!
Erwin
Post Reply