[SOLVED] How to know if all constraints are met?

Post Reply
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

[SOLVED] How to know if all constraints are met?

Post by benelot »

Hello!

I am writing a 3D creature simulator which evolves creatures over time. The creatures are built from rigidbody shapes and joint constraints. Since the creatures are automatically built from a specification, they usually have minor to major interpenetrations in the shapes. So far so good, because many creatures resolve their problems numerically (by wiggling around a bit and then they are quiet). Is there a simple way for me to know if all the constraints are met or if it is still trying to resolve?

Thanks for your answer!
Last edited by benelot on Tue Aug 18, 2015 1:35 pm, edited 1 time in total.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: How to know if all constraints are met?

Post by benelot »

Ok, I found out that it has something to do with:

Code: Select all

joint.getAppliedImpulse()
and the force and torque vectors of

Code: Select all

joint.getJointFeedback()
I am going to investigate if I can differentiate a numerical solving from the general force that is applied to keep the limbs attached.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: How to know if all constraints are met?

Post by benelot »

Anybody?
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: How to know if all constraints are met?

Post by Basroil »

Not sure what you're trying to solve or how physics plays a role in it.

If you are just asking "when are collision/friction/joint constraints done resolving for a single step", then the answer is easy, the constraints are either violated (solution is outside the viable solution space) or solved (a set of forces within your solution space results in a constraint being possible) by the end of your step.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: How to know if all constraints are met?

Post by benelot »

Hi Basroil,

What I am trying to do is basically this. Think of a number of rigid bodies (let us say boxes for simplicity) and a number of generic joint constraints that hold them together. The definitions of the joint constraint rotation limits and the rigid bodies connected via the constraint are randomly chosen. So in some cases, the box and joint constraint system is solvable (and the boxes properly snap together in the physics world), in other situations, the system is ill-defined and the solution is outside the viable solution space and will never be found by the solver.

My question is now if I can determine if the system is ill-defined or not. I expect it to be done by putting the system into the physics world and let is solve and then ask the system, whether all the constraints hold or not. Or how can this be done?

Thanks for your answer!
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: How to know if all constraints are met?

Post by benelot »

So how can I check if a constraint is violated?
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: How to know if all constraints are met?

Post by benelot »

I fixed my problem by looking at the penetration depth between all boxes as I described here:

http://www.bulletphysics.org/Bullet/php ... =9&t=10741

By that I could find out if there are still some constraints that are not properly resolved, because the interpenetration is not yet solved.
Post Reply