Warm starting in non-contact constraints?

kris928
Posts: 9
Joined: Wed Mar 05, 2014 7:22 pm

Warm starting in non-contact constraints?

Post by kris928 »

It seems that bullet does not support warm starting (using appliedImpulses from previous ticks of the simulation) for arbitrary constraints. However, it does support it for contact constraints.

I'm attempting to implement springs similar to how they are implemented in box 2d because I like being able to control the frequency and damping independent of mass. It's also much easier to build a stable spring that way. For reference see Erin Cotto's soft constraint paper.

Unfortunately, it seems that the SequentialImpulseSolver in bullet does not support warm starting. I believe this is why the CFM parameter cannot remove energy from the spring across ticks of the simulation. Was warm starting of non-contact constraints left out intentionally? I see some code that saves the previous appliedImpulse for non-contact constraints but it doesn't ever appear to be used again. I'm thinking of adding support for it but I'm surprised that no one else has had issues with springs in bullet before.

Thanks
Kris
kris928
Posts: 9
Joined: Wed Mar 05, 2014 7:22 pm

Re: Warm starting in non-contact constraints?

Post by kris928 »

I found this issue:
https://github.com/bulletphysics/bullet3/issues/65

It doesn't address the lack of warm starting explicitly, but does confirm that all the hackery I had to do to get my ERP and CFM params working was necessary. I'll try and move my discussion to that thread and see if I can help out.

In the meantime, if anyone has had success simulating springs in bullet (perhaps using a different solver?) - please let me know!

Thanks,
Kris