Parent / child ordering in joints - does it matter?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Parent / child ordering in joints - does it matter?

Postby JoeJ » Fri Apr 29, 2022 2:52 am

Example ragdoll.
If we relate the skeleton structure to a tree, we likely make body0 always the parent and body1 always the child.
Actually, i did it the other way around (body1 is the parent), assuming it should not matter.

But now i'd eventually like to mix those conventions to ease up some things.
So the lower arm would be a child of both the upper arm and the hand bodies.

So my question is: Does it matter for Newton what we do here? Should we follow some convention?
I guess not, but beside constraints, you also have skeleton and you also make some graph structure afaik.
So maybe it does matter?

Actually i can not test if there shows a difference, because there is no physics sim for my ragdoll stuff yet. I'll re-enable this only later, after i'm done with IK and procedural animation.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Parent / child ordering in joints - does it matter?

Postby Julio Jerez » Fri Apr 29, 2022 9:01 am

The only convention is that for simplicity
If one of the two bodies linked by a joint is static, meaning the invmass is zero.
Them tha body must be the secund body of the joint.

Contacts handle that automatically.
But all other joints are specified by the application. So the app must abide by that rule.

In newton 3 the engine deal with that by flipping the order
But the the index was indirect.
For newton four, all that baby sister has been removed to make the code flow simpler.

When forming stuff like rag doll, no there is not rule as to who is parent or who is child, the Skeleton solver figure that out by making a spawn tree where the root is the heaviest body.

A spawn tree can be formed from any body, but since every spawn tree has a square matrix representation, the same rule that apply to solving matrices by pivoting also apply to the spawn tree.
One such rule is that if you want to solve a linear system, the best pivot is the row that contains the larger diagonal value. They call that rule diagonal dominant.
This guarantee the solution with the minimal error and the smallest number of steps.

In the graph, this rules translate to
1 make the root of the spawn tree the node with the largest mass value.
2 organize the children by descend order of mass value.

This order is better than let it the app control the construction. Plus remove the burden from the app.

In cases when an articulation of bodies is connected to a static body, them that is automatically a root. So the rule is the same.

So you do not have to worry about who is parent and who is child.

If you are going to experiment with joints trying using a new object introduced in newton 4
The ndModel.

In the pass this was called a listener but is now formalized.

A model is an object that let you group bodies and joints together. Plus you can add anything you want.
What make it useful is that it has a comple of method that are called at strategic point during the pipe line.

You get a call in between contacts and solver, so you can make decision on how to control contact and joints.
You also get call after solver and you can post process the results.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Parent / child ordering in joints - does it matter?

Postby JoeJ » Fri Apr 29, 2022 4:51 pm

Ok thanks, that should help me a bit. :)

Another change i start to consider is to use only one offset rotation to go from body space to joint space.
Like you, so far i use two offsets - one for each body.
But in theory it should work to make one offset zero by adding it to the other.
Though, in practice i was not yet able to reproduce the same joint limits behavior, so not sure yet if this really works...

3D rotations remain a constant source of confusion, no matter how much experience i already have with them. :roll:
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 40 guests