Bullet vs ODE for simulating robotic systems

yvanix
Posts: 5
Joined: Thu Apr 29, 2010 3:35 pm
Location: Switzerland
Contact:

Bullet vs ODE for simulating robotic systems

Post by yvanix »

Hi,

We have developed for many years a commercial robot simulator using ODE. Recently we decided to evaluate the option of switching our application from ODE to Bullet. We thought that from Bullet we would benefit from more reliable and complete collision detection, soft bodies and many other features that ODE does not have.

However after a substantial amount of work in porting our software to Bullet we came across some of Bullet's limitations. In a robot simulator we need to work with physically plausible values, because our simulations are used in experiments where people want to measure accurate forces or torques through simulated force/pressure sensors, etc. Our simulator is also used to validate mechanical prototypes before the real robots are built, hence we need accurate physical values. This is different from video games where the physics engine must only yield visually plausible results.

The problem we have noticed is that Bullet's btHingeConstraint seems to be much less capable to cope with large mass ratios compared to ODE's hinges. Bullet hinges move off the axis and become unstable and relaxed with smaller mass ratio than ODE. Similarly Bullet has a hard time to cope with large ratios of moment of inertia, e.g. a chain of btRigidBodys linked with btHingeConstraints where the btRigidBodys use small and large btShapes alternatively.

Of course Bullet's User Manual recommend to avoid large mass ratios, but we need to simulate something physically plausible. For example we need to simulate wheeled robots, in which the wheels typically weight 30 times less than the robot's bodys, or robotic hands, where the fingers weight much less than the arm.

We noticed that the weakness about the btHingeConstraint can be counter-balanced by:

1. decreasing the time step (stepSimulation())
2. increasing a lot (up to 100) the number of iterations of the solver
3. decreasing the gravity

Although 1. and 2. improves things, unfortunately this also decreases the performance to a level that is finally slower than ODE.
And 3. must again be ruled out because this unfortunately makes the values unrealistic.

We have also tried the btGeneric6DofConstraint with similar results.
So we are currently stuck in our transition to Bullet and would appreciate some advice:

Is Bullet suitable to simulate mechanical systems with several actuated joints such as humanoid/quadruped robots, articulated arms/hands, wheeled robots, etc. ?
Has anyone been able to program a realistic humanoid robot model using an unmodified version of Bullet ?
Have anyone encountered the sames problems as me ?
How could you solve the problem ?

I look forward for any info, good or bad.
Best regards,

Yvan

--------------------------
Yvan Bourquin
Software Engineer
Cyberbotics Ltd.
http://www.cyberbotics.com
--------------------------
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Bullet vs ODE for simulating robotic systems

Post by Erwin Coumans »

Are you using dWorldStep in ODE, or dQuickStep?

It seems you require a direct (pivoting) constraint solver, such as Dantzig. If you are using dQuickStep you should get similar results to Bullet constraint solver. dWorldStep has a different solving method. If there is interest, we can port this Dantzig solver over to Bullet, there is already an issue for that: http://code.google.com/p/bullet/issues/detail?id=152

Thanks,
Erwin
yvanix
Posts: 5
Joined: Thu Apr 29, 2010 3:35 pm
Location: Switzerland
Contact:

Re: Bullet vs ODE for simulating robotic systems

Post by yvanix »

Erwin Coumans wrote:Are you using dWorldStep in ODE, or dQuickStep?

It seems you require a direct (pivoting) constraint solver, such as Dantzig. If you are using dQuickStep you should get similar results to Bullet constraint solver. dWorldStep has a different solving method. If there is interest, we can port this Dantzig solver over to Bullet, there is already an issue for that.

Thanks,
Erwin
Hello Erwin,

Many thanks for the quick reply. Our software uses ODE's dWorldStep().
Isn't there a way to workaround these issues with the current Bullet 2.76 ?
Unfortunately we have paused our transition to Bullet just because of that.
Thanks in advance,

Yvan

--------------------------
Yvan Bourquin
Software Engineer
Cyberbotics Ltd.
http://www.cyberbotics.com
--------------------------
yvanix
Posts: 5
Joined: Thu Apr 29, 2010 3:35 pm
Location: Switzerland
Contact:

Re: Bullet vs ODE for simulating robotic systems

Post by yvanix »

Hi Erwin,

There is definitely interest on our side for porting the Danzig solver to Bullet. I believe that other people using Bullet for simulating robotic or mechanical systems will also be interested. On our side we could provide our support by testing this solver against our existing collection of robots and vehicles.

However the decision to transfer our code to Bullet is not completely made yet. We are unsure if we will find all the features we need in Bullet to implement the simulated devices that we need and which are currently implemented with ODE. In particular we are wondering if these things will be possible:

1. Find out how much force is applied on a specific body and what is the direction (vector) of that force, in order to implement "force" or "pressure" sensors. Something equivalent to ODE's dJointFeedback struct.

2. Find out the position and normal vectors of contact points/edges of collision detection. This is necessary to provide visual feedback about the collision to our users. Something equivalent to ODE's dContactGeom.

3. Find out how much torque/force is currently used by a hinge/slider motor while moving or maintaining the current position (motor force feedback).

I would greatly appreciate your opinion on this.
Best regards,

Yvan

--------------------------
Yvan Bourquin
Software Engineer
Cyberbotics Ltd.
http://www.cyberbotics.com
--------------------------
YAN3
Posts: 11
Joined: Fri May 07, 2010 2:18 pm

Re: Bullet vs ODE for simulating robotic systems

Post by YAN3 »

Hello Yvan and Erwin,

I am a masters students at a robotics lab and I have recently started using (learning about) Bullet because I need some efficient way of collision checking for a 7-joint robotic arm. The checking would be used during a path planning process where the algorithm would try to find a way for the arm to move to a goal point without colliding with anything along the way. Someone here at the lab suggested Bullet and we spent some time installing it so that it can be used by our simulator at the lab.

I was searching around for anyone who has done something like this using Bullet, and I found this thread. So does this mean that Bullet is not suited for such a task? The problem is that I don't know anything about ODE, so I'd really appreciate any feedback or advice before I delve into modeling the arm in Bullet. Thanks a lot.

Regards,
Nick
yvanix
Posts: 5
Joined: Thu Apr 29, 2010 3:35 pm
Location: Switzerland
Contact:

Re: Bullet vs ODE for simulating robotic systems

Post by yvanix »

Hi Nick,

According to my experience with both ODE and Bullet, my feeling is that currently ODE is more suited for simulating mechanical system such as robots. In the other hand Bullet has a more active community and is much more feature-rich, e.g. soft bodies, continuous collision detection, etc. However the problem with hinge (or rotational 6 dof) joints that I explained in the initial post makes it less suited, in my opinion, to simulate mechanical systems. In short I would recommend ODE for robotics and Bullet for game engines. Of course this may change by the addition of a new solver in Bullet as Erwin suggested.
Best regards,

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

Re: Bullet vs ODE for simulating robotic systems

Post by Erwin Coumans »

Currently Bullet uses an iterative LCP constraint solver, based on the projected Gauss Seidel algorithm (PGS). For robotics, a direct constraint solver such as Dantzig LCP or Featherstone will give better results.

We will look into this in the future, currently we are busy preparing for Bullet 3.x.

See also those issues/topics:
http://code.google.com/p/bullet/issues/detail?id=152 (Dantzig)
http://code.google.com/p/bullet/issues/detail?id=33 (Featherstone)
ngbinh
Posts: 117
Joined: Fri Aug 12, 2005 3:47 pm
Location: Newyork, USA

Re: Bullet vs ODE for simulating robotic systems

Post by ngbinh »

Featherstone will surely help articulated bodies.

But Dantzig is unnecessary. It has been proved that with Bullet's friction model, the underlying problem is a convex QP. And convex QP solvers are much more mature than LCP ones. Also, if carefully implemented, the problem can be solved in linear time ( convex QP solver = decomposition( usually n^3) + forward/backward solves (linear), but incremental low rank matrix update can be used on previous time step decomposition).
bone
Posts: 231
Joined: Tue Feb 20, 2007 4:56 pm

Re: Bullet vs ODE for simulating robotic systems

Post by bone »

ngbinh wrote:Featherstone will surely help articulated bodies.

But Dantzig is unnecessary. It has been proved that with Bullet's friction model, the underlying problem is a convex QP. And convex QP solvers are much more mature than LCP ones. Also, if carefully implemented, the problem can be solved in linear time ( convex QP solver = decomposition( usually n^3) + forward/backward solves (linear), but incremental low rank matrix update can be used on previous time step decomposition).
The nice thing about Dantzig is that there is no need for a previous time step, therefore adding/removing constraints on the fly is not an issue. Not to mention there's a free, working, optimized implementation in ODE. It is still O(n^3), though, but I don't think it has the numerical issues of CG and the like.

Featherstone doesn't help much if you need elasticity or loops (although the latter can be done in a painful way).

I know little about convex QP solvers other than what I can quickly find on Wikipedia. Is there a (well-written) paper which describes how to do these incremental matrix updates?
copjia
Posts: 1
Joined: Sun Jun 20, 2010 2:26 pm

Re: Bullet vs ODE for simulating robotic systems

Post by copjia »

hi yvanix :
You have writen that
" Find out how much torque/force is currently used by a hinge/slider motor while moving or maintaining the current position (motor force feedback). "
I think you mean when the robot motor joint (anglemotorjoint) cause the link arms to move an angle,the ODE engine could calculats the force/torque used by motor joint.It looks like a inverse dynamic problems. Isn't it ?

thanks,

copjia
yvanix
Posts: 5
Joined: Thu Apr 29, 2010 3:35 pm
Location: Switzerland
Contact:

Re: Bullet vs ODE for simulating robotic systems

Post by yvanix »

Hi copjia,

No I was not referring to "inverse kinematics", but to the ability of ODE to compute and give as feedback the force applied by joints onto bodies.
But this is off topic anyway...
Best regards,

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

Re: Bullet vs ODE for simulating robotic systems

Post by Erwin Coumans »

bone wrote:The nice thing about Dantzig is that there is no need for a previous time step, therefore adding/removing constraints on the fly is not an issue. Not to mention there's a free, working, optimized implementation in ODE. It is still O(n^3), though, but I don't think it has the numerical issues of CG and the like.
The idea is to take the ODE Dantzig implementation, optimize it further, and use a PGS fallback in case the solver terminates without a solution (sometimes the Dantzig implementation doesn't find a solution).

Thanks,
Erwin
tompalmer
Posts: 8
Joined: Wed Aug 26, 2009 2:40 am

Re: Bullet vs ODE for simulating robotic systems

Post by tompalmer »

Putting in another vote for improvements for robotics. Another student in my research lab has discussed these same issues about mass ratios and such. My own issues are with working at small scale, so I use units as cm instead of meters, but I keep gravity relatively weak since it seems the constraint forces can't keep up with the fully scaled gravity.

Anyway, if the Dantzig will solve at least some problems, I vote for putting this when at the soonest opportunity.

Meanwhile, thanks much for the hard work on Bullet.
edualbu
Posts: 3
Joined: Tue Aug 05, 2014 11:06 pm

Re: Bullet vs ODE for simulating robotic systems

Post by edualbu »

Hi,

I'd like to know if the Dantzig Solver is already implemented. I'm also working with robotic simulation and I'm trying to choose between ODE and Bullet.

Best regards,

Eduardo Albuquerque
Last edited by edualbu on Wed Aug 06, 2014 7:13 pm, edited 1 time in total.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Bullet vs ODE for simulating robotic systems

Post by Basroil »

edualbu wrote: I'd like to know if the Dantzig Solver is already implemented. I'm also working if robotic simulation and I'm trying to choose between ODE and Bullet.
It has been for a while, and for low DoF systems (<20 joints or so) it works faster than PGS with the high iterations need for powered joints. ODE is no longer the go-to choice for robots. I've personally modeled robots using AX-12 motors (including motor load characteristics) using just Bullet hinges and Dantzig. The only issue right now seems to be that (according to the comments) friction doesn't work the same way as in PGS. You can also check to see if featherstone works for you, though it's a bit harder to set up real motors using it.
Post Reply