How does V-REP implement Bullet?

Typically: "How do I... ", "How can I... " questions
Post Reply
SagiCZ
Posts: 34
Joined: 05 May 2014, 18:16

How does V-REP implement Bullet?

Post by SagiCZ »

Hi,

this question is for the authors of V-REP or for anyone involved in the source code.

I am creating an application similar to V-REP as a part of my bachelors thesis. However my application will be based in Java and have much less features than V-REP. It will serve as a visualization tool for HIL (Hardware-in-loop) simulation for Arduino based robots.
I have chosen Bullet as my main physics engine (I will be using its java port JBullet). I need to achieve similar results in the simulation and V-REP showed me that it IS indeed possible in Bullet. However my vehicles (wheeled robots) are not acting so well, the simulation is very jittery, sometimes the meshes get stuck somewhere. The friction also doesn't work very well.

So how does V-REP use Bullet? I haven't see any references to it in the source code of V-REP so I don't know what to look for. Could the author provide me with some brief tips how to achieve "robotic precision" in Bullet? My main focus is on simple two-wheeled differential drive robot.

Thanks in advance for any tips.
Last edited by SagiCZ on 12 Sep 2016, 09:11, edited 1 time in total.

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: How does V-REP implement Bullet?

Post by coppelia »

Hello,

you can have a look at the dynamics plugin source code.

But basically, make sure to read this section and to understand the design considerations 1,2,6,7,8.

Cheers

SagiCZ
Posts: 34
Joined: 05 May 2014, 18:16

Re: How does V-REP implement Bullet?

Post by SagiCZ »

Thank you very much, I guess that's a good place to start. I missed the dynamics plugin for some odd reason.

SagiCZ
Posts: 34
Joined: 05 May 2014, 18:16

Re: How does V-REP implement Bullet?

Post by SagiCZ »

I realize that by using PURE shapes we can achieve smoother and faster simulation in V-REP. However, I don't understand how do you translate those pure meshes to Bullet?

In particular, I am concerned with the wheels. In V-REP I can see they are pretty detailed (64 sides) but Bullet primitive cylinder does not have variable number of sides.

Do you use some other collision shapes when you translate your meshes to Bullet? Thank you.

coppelia
Site Admin
Posts: 10366
Joined: 14 Dec 2012, 00:25

Re: How does V-REP implement Bullet?

Post by coppelia »

In the V-REP source code, search for btBoxShape (in file CollShapeDyn.cpp). This is the Bullet equivalent for pure cuboids in V-REP.

Cheers

SagiCZ
Posts: 34
Joined: 05 May 2014, 18:16

Re: How does V-REP implement Bullet?

Post by SagiCZ »

Thanks, that was very helpful, I have found what I was looking for in the file you talked about.

This line means that V-REP indeed translates pure cylinders into basic bullet collision cylinder.

Code: Select all

collShape=new btCylinderShapeZ(btVector3(s(0)*0.5f,s(0)*0.5f,s(2)*0.5f));
That means that instability and other issues in my application are not caused by wrong choice of collision shapes.

Post Reply