Page 1 of 1

Integrate simulator with Bullet

Posted: Wed Mar 21, 2018 2:51 pm
by johndoe11
I have a robotic simulator using OpenSceneGraph as its scenegraph and graphic engine. I want to integrate bullet physics engine in it for collision detection. So what are basic procedures for integrating it. Do I have to write whole code again using bullet physics or can I make change in my existing robotic simulator.

Re: Integrate simulator with Bullet

Posted: Thu Mar 22, 2018 3:52 pm
by hyyou
I use 1 body = 1 node.
Yes, there are still a lot of (fun) work.

Re: Integrate simulator with Bullet

Posted: Fri Mar 23, 2018 4:05 pm
by drleviathan
Do I have to write whole code again using bullet physics or can I make change in my existing robotic simulator.
I bet you could find existing code for loading your robot into a simulation, as long as your robot was in URDF format. However, I don't have a link to such. There might even be example code in the Bullet github repository.

Alternatively, you could fork one of the C++ Bullet examples and modify it to suit your needs.

If you already have a mature C++ codebase it might be easier to look at example code, study the Bullet API, and add the Bullet libs as dependencies to your project and roll your own integration.

It is possible to load and manipulate scenes with pyBullet. You might try reading the pyBullet quickstart guide to get an idea of what is possible.

Re: Integrate simulator with Bullet

Posted: Fri Mar 23, 2018 10:53 pm
by johndoe11
Thanks for reply. Actually my simulator take input as xml files. these xml files contain sample robotic world. So can u give some idea exactly where I have to focus to change code .

Re: Integrate simulator with Bullet

Posted: Sat Mar 24, 2018 12:33 am
by drleviathan
Your questions are general and vague so I provide general and vague answers. To get more useful answers you might need to provide more info about your project or ask more specific questions.

If you are using OpenSceneGraph and you can parse, load, and render content from XML, then it sounds like you have a "mature C++ codebase" and I would recommend just adding Bullet as a dependency. It would take too long to type out all the instructions here. The best way forward would be for you look at example code, study the Bullet API, and try it. Come back here when you have specific questions and provide relevant source code.

Re: Integrate simulator with Bullet

Posted: Sat Mar 24, 2018 2:06 am
by hyyou
Thank drleviathan, for the great answer!

On topic:-

OgreBullet (http://wiki.ogre3d.org/OgreBullet) is a popular example.
It aims to integrate a node-based graphic engine (Ogre) with Bullet.
OP may get some neat idea from it. I have never used it though.