Joints stiffness

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Joints stiffness

Postby Julio Jerez » Wed Aug 26, 2015 9:49 am

Joe, success :mrgreen:
Sweenie, the jerk and jitter motion of the boom is gone. :mrgreen:

I finally have it working with motors and limits.
It was actually a very simple problem, but if I did not read the Linear Programing and extension book I would probably never get if fix right, or it will take ages to figure it out.
re-writing the old 1.53 lcp solver in the end was did not use it but it gave me the clue as to what I was doing incorrect. Then after that it took few minute to re arrange the code and so far seem very robust and stable

when you Guys have time, please give it a try. It should behave the way you expect.
I checked it in temporality with your joints Joe, even if they have a leak. Later I will make then part of the solver as flexible joint, because they can be quite useful for especial effect.
what I like is then they are soft and not because of crappy joint result but because that is the intended operation. :mrgreen:

Now I will spend some time on convection the vehicle to use the newton joint, It always bothered me that the vehicle have to be special case out because of soft joint. but if the works then there is no reason for that anymore.

I want the car to be full\y articulated with real transmission, engine, clutch and differential, no the mombo-jumbo that I gave there form Wikipedia. In real differential if you spin one tire in one direction the other should spin in the opposite. It is easy to make this with joint, but the mass ratios of the satellite COGs, were prohibited because of the sift joint response maybe now is possible.


Ha one last thong, the pallet of the tank is too powerful because the have unlimited friction force. o if you try to grab anything it will blow up, I will add the limit later so that it can pick and grab stuff.

I find it vey hard to position the very to grab anything, I get disoriented, maybe this will be a good demo for Oculus riff virtual reality, 8)
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby JoeJ » Wed Aug 26, 2015 1:49 pm

ragdoll.PNG
ragdoll.PNG (56.57 KiB) Viewed 4534 times


Hmm, using friction rows anywhere or using unpowered point to point work now without any problem.
Also, balancing ragdoll works out of the box without any change for the first time.
Soft joint behaviour for the 20-bodies-snake in sandbox is great.



But what really confuses me is: The advancement of the skeleton is completely lost :?:
See the screenshot, ragdoll arms hanging down - they can't match the target t-pose (shown by transparent lines), even if it would need only a small torque.
Tried to raise max angular friction but it does not help.
(Same for 20-bodies-snake in sandbox - it's never really straight)

What i would expect is that the arms should match t-pose exactly, as long as reqired torque is smaller than max angular friction, right?



The other issue that shows up now is that feet get pushed into the platforms (kinematic bodies with velocity), see right foot.
This does not happen for ragdoll standing on zero mass static ground body - works as expected.
I do not worry about it now. (The ankle controller i use here does high frequency overpowering and is not intended to work with hard joints at all - decreasing it's gain reduces the problem, but does not eliminate it completely)

On older versions of hard joints i saw something similar, which is interesting:

Not using hard joints: Feet orientation matches ground plane, but ankle joint misses it's target rotation.
Using hard joints: Ankle joint hits target exactly, but foot twists a bit inside the ground (because contact joints are not part of the skeleton).

So at the end both approaches require some error compensation (but hard joints should be much easier to handle).

Have you ever thought extending the hard joint algo to be handled automatically for everything (per island and including contacts)? Maybe avoiding cycles can be done with finding weak pairs similar than finding the "best break"? just thinking...


Hope i have time now to continue on walking...
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Joints stiffness

Postby Julio Jerez » Wed Aug 26, 2015 4:51 pm

Oh yes, you are right, it is still no correct.

the flexible behavior is actually wrong, the long change when resting on the floor should have one it tow breaks instead of the gradual flexing.

I think I can fix that but that will have some extra cost, so make we make and sketon options.
Joe can you try this. in file
../coreLibrary_300\source\physics\dgWorldDynamicsSimpleSolver.cpp
line 687,
replace these line see if the behavior improves, this is and asshat crapping hack but it will show if the solution start to converge to discrete breaks, rather that stupid continue flexing.
Code: Select all
//         for (dgInt32 i = 0; (i < 3) && (maxAccel.GetScalar() > m_solverConvergeQuality); i++) {
         for (dgInt32 i = 0; (i < 10000) && (maxAccel.GetScalar() > 0.1f); i++) {


the I would now how to move that to the skelton only.

as for refiguring out automatically how to from he skeleton, yes that is possible, I classics graph algorithm names Forest. the problem is that contacts are by nature close loop, for the algorithm will do a lot of work for almost no gain since it will find a graphs full of close loop.

Imagine a Pyramid, the abortion will find open forest for east body on the floor, going to the root, each time with one fewer joint. so instead of making one island it will make almost N islands.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby JoeJ » Wed Aug 26, 2015 5:49 pm

Code: Select all
         dgVector maxAccel(accNorm);
         //for (dgInt32 i = 0; (i < 3) && (maxAccel.GetScalar() > m_solverConvergeQuality); i++) {
         for (dgInt32 i = 0; (i < 1000) && (maxAccel.GetScalar() > 0.001f); i++) {
            maxAccel = dgFloat32(0.0f);


Tried to play with the numbers, but no effect on the hanging arms. (Line 697 not 687 for me)

For the pyramids, the graph could look like this when gravity is dominating force:
Code: Select all
  /\
 / /\
/ / /\

I remember playing with ideas like that on my own physics decades ago,
worked to fight gravity but for nothing else :)
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Joints stiffness

Postby Julio Jerez » Wed Aug 26, 2015 6:32 pm

is the hanging arm a motor with low friction limits? what happen if you make the friction unlimited?

on the pyramid, that could be one case but that will be the exception. you see like the because you know that the top in the apex of the pyramid, but algorithmically that information is not available.
second assuming the you start by the top, are you go down.
you have one body on the left an done on the right, but you assume they do no touch, the most like situation Is that do touch. in the case the the touch you get a three body loop for which you nee to make a decision to break the loop. only of you brake the sideway link you the configuration you shoed b the other tow are just as valid. this mean that each time you run the algorithm you will get a different result. where some joint will be preferentially selected to have a small error, and other do not. whoever from frame to frame this will change and the will generate jitter because inevitable you will have a contact that was weak on some previous frame and now some how is strong.

The best we can do is wait only the User contact are implemented and maybe they can be use as part of the skeleton joint. I still do not know how because they will still from a closed loop.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Wed Aug 26, 2015 6:38 pm

My guess is that we need to make motors with unlimited friction if there are part of some internal joint or when ever we can get away with. no all motor nee to have finite limits.

because those are solved but the iterative solver, ta is what I did for the tank, but I when too far, I set the all to unlimited. I need to set limit for the pallets.

This actually give me an idea. I can do a check to see If the joint broke the limit on some previous frame and base of the information do an speculation step. and test if the limit was broke after the step, flag the row and the limit is not broaken again.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Sweenie » Thu Aug 27, 2015 1:51 am

Yep, the boom is really steady now, good work :D
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Joints stiffness

Postby JoeJ » Thu Aug 27, 2015 4:06 am

Julio Jerez wrote:is the hanging arm a motor with low friction limits? what happen if you make the friction unlimited?

Same joint as added to sandbox.
Removing NewtonUserJointSetRowMaximumFriction calls from the joint makes it stiff as expected, matching t-pose exactly.
But also it turns every creature to Superman. A car driving over that guy would not be able to affect it's pose - it would behave like a compound.

For organic creatures limiting friction everywhere is necessary, otherwise standart joints remain the better option for them. (No problem with that - just trying to push the skeleton as far as possible)

Julio Jerez wrote:I can do a check to see If the joint broke the limit on some previous frame and base of the information do an speculation step. and test if the limit was broke after the step, flag the row and the limit is not broaken again.

Sounds good!

Julio Jerez wrote:whoever from frame to frame this will change and the will generate jitter

Yep, that was exactly the reason i gave up that idea :)
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Joints stiffness

Postby Julio Jerez » Thu Aug 27, 2015 8:33 am

JoeJ wrote:....
But also it turns every creature to Superman. A car driving over that guy would not be able to affect it's pose - it would behave like a compound.

For organic creatures limiting friction everywhere is necessary, otherwise standart joints remain the better option for them. (No problem with that - just trying to push the skeleton as far as possible)


It was just to see if the joint worked, yes of course the limit should be working else the feature is almost useless as will generate constant explosions each time a look between two skeletal joint is formed.
I think that the the ideas that I had from last week I can fix now.
the only bad news is that the fix come as a cost. so it may have to be and option.

ex on the skeleton we can pass Boolean that says solve hard motors on/off
on will use the LCP and off use the soft solver,

what the feature does is that is make the bilateral rows error at zero or with in numeral tolerance, (the one that keep structural integrity)
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Thu Aug 27, 2015 8:48 am

This bring me to another topic when talking about characters.
I have read few paper about the topic, and it seem that the are tow main strategist to do physically base characters.
1- to make you articulated rag doll and control the joint DOF torque by applying torque, this is the one that 100% of the papers I read use. I despise this because the have to us the PID or PD controller to covert angular error into toques, and the is always a black art magic trick.
My guess is that every one use that nonsense method because there has not been a Physic engine solve out there capable of solving join reliably. so the use the engine just to keep the structure together and for collsions.

2-teh menthol when the control the joint angle, but are not physically based, instead the use inverse kinematic. and these work more or less but they are a nightmare of code and obscured heuristic. These method I will not touch with a ten foot pole


The there is the method that you and I are trying to use witch combine I and 2, that is make physically base but control the joint error with joint motors and get rid of the PDS.
I believe the I better even with soft motors, by the skeleton joint bring one step forward.

I will try to make a Character controller the controller the pose balance for a skeleton use the pendulum idea and the system we have now.
we learn a lot in the process of doing this. and I am sick and tire of rag doll plummeting to the floor lifeless.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby Julio Jerez » Thu Aug 27, 2015 9:17 am

I added these tow functions
Code: Select all
int NewtonSkeletonGetSolverMode(NewtonSkeletonContainer* const skeleton);
void NewtonSkeletonSetSolverMode(NewtonSkeletonContainer* const skeleton, int hardJointMotors);


what the will do is that they will use the LCP to drive the joint to numeral error. Bu I nee to make a
Line search LCP working again, the dantzig is too slow for the, I could prototype it wi the Guass sidle
I will do that over the weekend. But I am pretty sure we are on the right track to the solution now.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby JoeJ » Thu Aug 27, 2015 9:33 am

Julio Jerez wrote:joint DOF torque by applying torque

I have the same impression from lots of papers, as they mostly need to implement their own solver or borrow the one from the physics engine (mostly ODE).

There is one good research project with a walking ragdoll: https://code.google.com/p/cartwheel-3d/
Never found anything else than that (also i did not look how it works).
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Joints stiffness

Postby Julio Jerez » Thu Aug 27, 2015 11:03 am

wow, that paper is alone the line of what I am looking for, too bad it is mostly python code.
I see if I can get it to run.

Basically I want to make a ragdoll the is a lite smarter, on the can keep a stance pose, and react to pushes, and can take stair step and walk on uneven terrains.
The inverted Pendulum trick is a new information that I did no know before and open lot of possibility.
I wonder if the author of the paper has a would be interest in integration another physic engine
I also look at one library name Dance and there are some other version, but the want nothing to do with Newton so I wont touch that.
There are some Zealot people out there. I offered to integrate Newton myself to this app
https://www.youtube.com/watch?v=2nq5P3-qgmA

and the Dude replied to me with that they the do not integrate engines that are not Peer Reviewed.
I replied that the engine is open source and anyone can check the mathematic on it,
after my reply He said that he considered the conversation closed and banned me from his youtube account as if the conversation never happened.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Joints stiffness

Postby JoeJ » Thu Aug 27, 2015 11:36 am

It's really a shame research people are that ignorant especially in robotics.
They simply don't know what they miss - their fault.
(When i have good walking ragdoll video i'll post on gamedev.net - might catch a bit of attention from there...)


Now i do worry about the contact issue i have noticed on ragdoll feet on moving kinematic bodies.
Because it happens also when not using the skeleton, it just takes more time.
Sometimes the whole foot goes through the platform.
It looks like you have introduced a bug very recently.
I have a little older version before the bug, but don't know where to look for a version or anything.


contact problem.JPG
contact problem.JPG (30.65 KiB) Viewed 4504 times
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Joints stiffness

Postby Julio Jerez » Thu Aug 27, 2015 12:56 pm

JoeJ wrote:Now i do worry about the contact issue i have noticed on ragdoll feet on moving kinematic bodies.
Because it happens also when not using the skeleton, it just takes more time.
Sometimes the whole foot goes through the platform.
It looks like you have introduced a bug very recently.
I have a little older version before the bug, but don't know where to look for a version or anything.

is this new with latest version? or was that there before?
I made a changed on the box contact function.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest