Inverse Dynamics Robot demo questions

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Sun Dec 31, 2017 3:08 pm

Ok I believe I found a flaw in the sytem.
not really a problem that can not be solve, but it requires a refactoring.
Basically the inverse dynamic solver is writing to solve constraints in global space.
This is fine as long as the targers are independent of the body positions.
For example the six axis demo is fixed to the world, so local and global targets are identical. When the root is a floating body this is not the case.
For a floating root the moment any part of the configuration is used to calculate a target, you get into a mathematical regression.
This is equivalent to taking a child bone of an articulated body and use its rotation to calculate the parent rotation.
Imagine the parent is a zero yaw angle and the child at one degree from the parent.
After one step if you say the parent is now at the child rotation in global space this means that the child moves to two degrees and so on. This is not good.

One solution is to reformulated the solver so that it works in local space.
Basically what this means is that the mass matrix is transform by the inverse
of the root matrix, and the root is not allowed to be constrained.
It is eassy to say but it takes some work to get it done, plus the demos has to be rewriting.
I will commit what I have as work in progress so that you guys can see what I mean,
It will look like a bug, but it is a wip.

I did not envision this recursion problem, but it is like they say, the devil is in the detail
I would not find out if we did not have the parts that we have already.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Mon Jan 01, 2018 1:23 pm

woohoo, I now made the changes to the inverse dynamic to work in local space.

I committed the six axis demo with ik robot use a floating root.
the forward dynamics will not work because is not possible to make effectors that are both local and global space. the moment it touches the limit is produces huge acceleration that propagate all the way to the root of the articulation. we now see how the two system start to differentiate.
For the UK on the left later I will make the base 10 time heavier, that should make stable when moving the effector.

the robot now act as if it was a piece of hardware that can be attach to anything, so Joe, I believe this answers your question that if a robot will work on a moving platform? the answer is yes, because teh inverse dynamics only generate internal acceleration and torques.

Later today I will try to re enable teh hexapot and see what, we get, maybe new issues how up, but I am hoping this was the last. so in teh end we did faced unknown problems in all three major component of the system. but in returns we are getting a much simpler overall system to set up stuff
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Mon Jan 01, 2018 4:16 pm

Ok, we now have a fully articulated Hexapod with a floating body :mrgreen: 8) :lol: :x :) :shock: :mrgreen:
guys when you get this sometime please try it this out and let me know what you think.
for now one this is just boiler place set up.

next I see if I can make a walk cycle with turning and maybe even a jump.
and that will be the last for newton 3.14 stable release.

There is a bug somewhere in the modifier that some time calculate the wrong target position but even that is really cool, it may have to do with leg friction been too weak, I will debug later.

post: oh I see what is wrong they are self colliding and the joint does no know how to clear the obstacle. and well designed controller can solve that by having a node modifies that track self collision and change trajectory away of the path. for now I will disable self collision.

post: ok a tuned the modifier limits an now the feed do not goes to areas where the solution loses one degree of freedom. so far this seem stable, so now to make the basic walk.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Mon Jan 01, 2018 8:11 pm

It's Alive!!!, It's Alive!!!
https://www.youtube.com/watch?v=xos2MnVxe-c

the walk cycle is only in place and very basic, but is enough to show my prediction that any animation cycle is natural, when is physically generated.
Before adding forward motion I will add key controls to move from idle to walk.
I will also make the idle do a small brawnian motion so that it looks like.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby Sweenie » Tue Jan 02, 2018 3:59 am

Wow, it feels really stable now.
You can lift it or push it to the ground and it just keeps on walking :D

Can't wait to see it start walking forwards and how it behaves on uneven terrain. :lol:
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Inverse Dynamics Robot demo questions

Postby JoeJ » Tue Jan 02, 2018 5:09 am

Yes, although the chaotic behaviour in worldspace looked cool it's much more under control now. Guess to make it walk forward would be a matter of minutes now... :wink:

So now we have to use effectors relative to the root?
And we have no more direct control of the root itself? (meaning there can be no effector for the root)
(That's how i have it and why i need some utility stuff operate in world space)
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Tue Jan 02, 2018 6:47 am

Technically we can attach an effector to the root, but in practice this seems one of those
Thing that are not forbidden by the laws of algebra, but that lead to absurd results.
If you think about, an end effector is a joint that constraint a body to the root, not to the world.
So constraining the root to itself lead to circular or recursive mathematically feedback.

To make it walk forward, is just filling in the x component of the spline, but I did not do it until I added the key controll and a node to control turning otherwise it will run away.

Do you see how the entire thing is build, basically there is a anym tree where each node do a simple thing. Then the evaluator function concatenated each individual node.

I will post the diagram of that one later. But basically to make a creature do something is a matter of adding a node to the tree, and hold to that object to control that funtionalitty.

Imagine now the biped, the control of the pelvis is just a node the take the root and calculated the next position using inv pendulum and have that position propagated down to the effector that control the feets. Not sure how will work, be suddenly it seems more fixable.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Tue Jan 02, 2018 3:56 pm

Ok joe, I think I found a cause where a root effector is useful, in fact necessary.
the image below, is a simplified 2d biped, show three important parameters.
1-the root com
2-the total com
3-the projected of the com to any to some point.
demo.png
demo.png (19.34 KiB) Viewed 13915 times


the goal is to align the total com to the projected point on the ground by moving the root to the in teh direction that would achive that goal.

there is not way that moving the leg effector can do this unless that physically move because the can no generated joint rotation unless the translate.
so in the case at root effector can trnslate toward the projection, and it will not biolate the parent child realtion because the toall centr of mass in a local point relative to the root.

notice that teh projection to teh floor is jus an assesory that is no part of teh calcution, teh body can be in space and as long as node can genertate a direction to aligh the com the should will work.

this suggest that a biped motion is no reallt depende on what the actor is, the IP is just one of the funtion to achive this.
later I will start the this demo, trying to set thsi up.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby JoeJ » Tue Jan 02, 2018 5:10 pm

Julio Jerez wrote:there is not way that moving the leg effector can do this unless that physically move because the can no generated joint rotation unless the translate.


In my setup i need indeed to translate the feet effectors to the left so the com moves to the right because the feet remain fixed due to contact. This is the part i said things can get confusing, so if you can still support the root effector that should be likely more intuitive.
But it does not really matter, you need to do what works anyways.

Driving the biped com to a projected target is exactly the problem you should tackle if you are basically happy with the system (still the center of all my ragdoll work). I got those problems with this:

Naive approaches to move the com did not work - too hard to keep balanced or too slow movement. IP model came to the rescue. Assuming your system is not so smart to know how fast it can move while keeping balanced, your idea to move the root com (pelvis) is too naive too i guess, but it would work if you generate a pose from IP and get the pelvis target from that. (Resulting again in confusing intermediate skeleton transformations. No problem but annoying work. We'll see...)


Knees matter - the main issue when mapping IP to biped. I assume your system might care for this automatically, but i need to care to bring both feet into the plane the IP uses for it's single foot. If both legs are stretched out, and they usually are, this can be a problem. Non planar ground or ground with varying velocity are other cases where i added a lot hard coded behaviour to manage all this. That's hard to maintain. I have high hope in your stuff here :)

So i think if you get to this you see what you can handle internally and what needs to go to controllers / user code and so on.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Tue Jan 02, 2018 5:33 pm

I added the spline for the forward motion, but does not works as I expected.
I committed at a low fps because is quite funning, the right leg moves forward and the leg leg move backward,
Naive approaches to move the com did not work - too hard to keep balanced or too slow movement. IP model came to the rescue. Assuming your system is not so smart to know how fast it can move while keeping balanced, your idea to move the root com (pelvis) is too naive too i guess, but it would work if you generate a pose from IP and get the pelvis target from that. (Resulting again in confusing intermediate skeleton transformations. No problem but annoying work. We'll see...)

ha but that precisely what I said, there is not such thing as naïve approach which this system.
remember that when any part of the system moves, the entire system react with the proper response because the motion because the system has a mass matrix, which is singular at all time and relates every row to any other row.
When a row is set to a certain value, then all other rows will have a proper reaction since they are relate by a linear expression. so knowing one row, gives the values of the others be solving the resulting system. That's the whole point of the system, that is easy and intuitive to control by having the dirty math doing the heavy lifting. 8)

I see if will star the biped demo tonight.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby JoeJ » Tue Jan 02, 2018 5:56 pm

I believe you, but i also believe to problem of balance is unrelated to your current work.
As said we need very precise control of the COM, and we need to hope that internal motion generated by any system to achieve this won't have a too bad impact. As i've seen even a bad contact for one frame kills balancing. In the worst case we both still underestimate the balancing problem :wink: But that's just me, learned to have doupts all the time... :P
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Tue Jan 02, 2018 6:46 pm

never mind everything I said on my previous post about adding a root effector is nonsense.
we need the root motion but In a virtual sense, more on this later.

on this
I believe you, but i also believe to problem of balance is unrelated to your current work.
As said we need very precise control of the COM

that's my claim, I claim that this is not true. I strongly believe any motion will do, regardless of the accuracy of the contacts. I know is hard to get convinced but let us see when we try to implement a working demo, I am sure there will be problems that I do no know now..
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Tue Jan 02, 2018 10:21 pm

ok now the walker can walk.
this is programmer walk cycle so it not very nice an animator can do a much better than this.

but anyway, here is it, one thing that may bee is to make the ground friction stronger, at the moment is the default which is 0.6, and restitution is 0.4, so the fee bounce of the ground very strong, but a walker can have a large than one friction and zero restitution value and we do support that. I'd play with that later.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Inverse Dynamics Robot demo questions

Postby JoeJ » Wed Jan 03, 2018 2:51 am

Awesome! You can use the y slider to make it jump :)
I added a second robot and they interact nicely with each other, all perfectly stable. :mrgreen:
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Inverse Dynamics Robot demo questions

Postby Julio Jerez » Wed Jan 03, 2018 9:53 am

Ah nice, I was hopping you guys discover some of the emerging tricks like jumping, 8)

I am trying to make a more smooth right, it is amassing the little thing that you learn by using a system.
I was wording why the ride was no as smooth as I expected,
I can apply tweak physics trick but as a rule tuning in my opinion soudl something the enhance a fumtionality, should not be use to hide a problem, so I decide to plot the walk curve.
walkcicle.png
walkcicle.png (12.28 KiB) Viewed 13895 times


the read line is the vertical motion and the blue is the translation.
It immediately obvious what the problem are:
1- the vertical; motion you can see that the feed remain about 10% of the period on the on the air, since the other leg is teh same curve at on phase angle of 180 degree, the there is a 10% of the period that both legs at on the air, that is why the body going up and down, to fix that teh curve should the opposite, it should be 60% time on the ground and 40% on air that way all six leg will be will be on ground by 10% of the period.
if this was a run cicle the thsi will be correct, and it kind of does that if the frquency is incread to about half secund.

teh sucudn bug is that teh curve is smoth at, thsi makes that the walkr slow dwon to zero each time the feed reach chnge direction, teh curece sodul be a degree 1, or maybe 2

I will fix that first, before moving on.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
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 16 guests