Bullet into Matlab

Mysticronos
Posts: 2
Joined: Tue May 21, 2013 8:40 am

Bullet into Matlab

Post by Mysticronos »

Hi everybody,

I have a simple question:
Is it possible to import and use Bullet functions into Matlab?
and if yes, how do you do that?

Thank's for your answers!

Mysticronos
allsey87
Posts: 33
Joined: Fri Oct 26, 2012 1:50 pm

Re: Bullet into Matlab

Post by allsey87 »

I think the way to go about this would be to compiling Bullet into a dynamically linked MATLAB Executable and call the functions from inside MATLAB.

Here is some information (although dated) on MATLAB: http://www.mathworks.de/support/compile ... e_r13.html

And this persons thesis seems relevant: http://is.muni.cz/th/256594/fi_m/thesis.pdf

Keep in mind this isn't likely going to be easy. I have a hunch that things could get very ugly very quickly. However if you do have some success, remember to post back and let other people who find this post in the future know!
Mysticronos
Posts: 2
Joined: Tue May 21, 2013 8:40 am

Re: Bullet into Matlab

Post by Mysticronos »

Hi,
So after some researches and experiences, it seems that the easiest way to introduce Bullet into Matlab is to use the Java implementation of Bullet (JBullet) that you can find here.

:arrow: So first step you have to import your .zip file into netBeans. You can directly import a project as zip file so no problems...
:arrow: Now you have to build JBullet with NetBeans. You have to use a Ant building system which is integrate by default on NetBeans but not on Eclipse... (with Eclipse I had some problem when I use the build project like that: "Error: not instrumented"). So you just have to click right on your project and select "build" (hard isn't?? :lol:)
:arrow: Then you have a jar file called JBullet.jar in the folder "dist" inside your netbeans project folder.
You just have to import this jar file into Matlab and then you can call Java function directly by using command or inside a .m file.

I did not use the C++ version of Bullet cause I had to convert all .cpp files into .mex files and I had some compilation problemes. The Java version is easiest to install and use in a Matlab context.

That's all for now, thanks for your help allsey87 :D
allsey87
Posts: 33
Joined: Fri Oct 26, 2012 1:50 pm

Re: Bullet into Matlab

Post by allsey87 »

No problem, Java is probably the way to go for integration with MATLAB. Does JBullet create bindings to the underlying C++ library or are all the algorithms actually implemented in Java?

It seems that your simulation could be quite slow for anything more than a few objects depending on how the algorithms are running underneath, i.e. whether they are dynamically linked libraries, Java classes with/without JIT etc...
allsey87
Posts: 33
Joined: Fri Oct 26, 2012 1:50 pm

Re: Bullet into Matlab

Post by allsey87 »

Ah I see on the homepage:
100% pure Java port, native libraries are used only for OpenGL access in demos