Refactoring joints

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Refactoring joints

Postby Julio Jerez » Wed Jan 03, 2018 3:55 pm

Ok I starting another topic for the biped, because here we are going to talk about biomechanics movements and all that good stuff of character animation more than physics, assuming we have a reliable physics system.
the first thing is that we need to recalibrate the other two tow ragdoll joints, so the work for both local and global space. I only did it for the effector and the one dof joint,

I deleted the old thread when we started this idea, because few things has changed since then.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby Julio Jerez » Wed Jan 03, 2018 10:26 pm

hey Joe I was looking to see if there are new papers about physic based animation,
and it seems In the last 30 years the egghead experts come up with this.
http://www.cs.ubc.ca/~van/papers/2017-T ... epLoco.pdf

This is what it says, so we have our baseline
The motions from the policies are best seen in the supplemental
videos. We learn locomotion skills for a 3D biped, as modeled by
eight links: three links for each leg and two links for the torso. The
biped is 1.6 m tall and has a mass of 42 kд. The knee joints have one
degree of freedom (DOF) and all other joints are spherical, i.e., three
DOFs. We use a ground friction of µ = 0.9. The character’s motion
is driven by internal joint torques from stable PD controllers [Tan
et al. 2011] and simulated using the Bullet physics engine [Bullet
2015] at 3000 Hz. The kp gains for the PD controllers are (1000,
300, 300, 100) Nm/rad for the (waist, hip, knee, ankle), respectively.
Derivative gains are specied as kd = 0.1kp . T
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby JoeJ » Thu Jan 04, 2018 4:02 am

I think modeling the upper body with just two boxes is good for the start, arms are probably useful for running, but for walking you can ignore them. (But the setup you already have for the ragdoll is perfect, and to me it did not add any complexity to have arms and head from the beginning.)

I'm a bit resistant against the idea to use machine learning for basic locomotion. I'm sure we get at least the same results by understanding the dynamics ourselves, leading to much faster calculations and better control. Same thoughts to other applications, e.g. denoising a path traced image or faking fluid simulation. But to be honest i just don't know how machine learning works and at some point of course it will become useful / necessary for character simulation...

No comment on 3000 Hz... i did not knew we can express such tiny numbers using floating point :)
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Self balancing biped

Postby Julio Jerez » Thu Jan 04, 2018 10:59 am

I have all three ragdoll joint enabled again, but I see something really wrong with the 3dof, it is producing strange accelerations, even when is not in motor mode.

you can see this when the rag doll lands of the floor and there are really strong acceleration that make some body parts bounce back very unnatural, I am guessing it is the joint limit
I need to fix that first. no sure why broke I remember it working fine before.

edit: it must be me, when I see the to be fix they seems well behave.
I am going to move on to export this model, and loaded as a active biped now.


on the deep learning it is like everything, deep learning is the brand knew shinny object that the self appointed experts think is going to make up for the mediocrity.

Deep learning is a serius and powerful classifier. but it does not make up for bad math and physics.
that dude wrote all those words to explain how he is calculation t = -k * o - c * w differently

yet at the same time is try Bamboozled the reader into thinking that some how a neural net that is not real a neural net is going to do the physics for him.

that is the complete history of the self appointed Academics eggheads.
they keep ingnoring newton pretending is does not exist.
this dude moved from ode to bullet and he is satisfied with 3000 hertz updates.
he thinks the neural network is doing the magic trick but sorry to tell, it is the 3000 hertz update that is doing it. this is another example of Garbage in Garbage out.

at some point I will experiment with a deep learning net, but this net will operate on a set of geometrical parameters. maybe even using google TensorFlow or some other, but that far away

Imagine the walker, using a small rendered of the environment around and feeding that to the deep learnig need which oput is the controller varibales.
basically thsi could be use a ray cast to render the terrain and some obtacles, render the to a texture and use the gpu kernel to evaluated the controller output.
that to me is a good application for deep learning and teh raw power of gpu computing.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby JoeJ » Thu Jan 04, 2018 11:56 am

I'm worried because of the 3dof:

The motorized joint using 3 angular rows that i use with success is problematic because IK system does not yet know on which axis the torque has to happen (the other two rows are mostly for stabilization)

The twist / swing approach should work but i never got it working as a motorized joint.

... hope you don't run into issues here.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Self balancing biped

Postby Julio Jerez » Thu Jan 04, 2018 12:55 pm

I am sorry about that too, the problem is that a three Dof motor is very difficult to come up with.
The reason is that a that it requires three rotation axis. So there will always be one that is floating. It is the rotation of the floating axis that generates the weird non linear accelerations.

If you look at all practical robots and dummies, the hip and the shoulder joints aren't 3dof that links two bodies, they use a middle body to make a 2dof and split the leg into two axial bodies connected by a 1dof. I think we should do the same. That make possible to calculate constant acceleration and velocities.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby JoeJ » Thu Jan 04, 2018 1:09 pm

Yeah, with your improved joints reduced stiffness is no more problem, so there's only the performance loss we have to swallow :cry:

Maybe only hip, shoulder and ankle are affected?
Spine could be modeled as a series of hinges with alternating rotation axis direction so the body count does not increase that dramatically... not really a great idea.

Do you expect only a small performance cost if those additional bodies are non-collidable?
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Self balancing biped

Postby Julio Jerez » Thu Jan 04, 2018 3:57 pm

Oh, I forget about the spines you are right that high count make be expensive
anyway we can start by doing it to the limb and see how that goes.

I made a diagram of the transformation. as you can see, the 3dof add 6 extra rows per joints. so maybe we can limit the spines to two joints. but let us worry about that later.
3dof.png
3dof.png (10.79 KiB) Viewed 11287 times


I changed the ragdoll to use a 2dof joint, now I need to add code so that we can offset the limits.
and do the joint mass splitting.
over the weekend I will write the algebraic expression for that system and see if one is equivalent to the other, I have the feeling we are missing something.
basically the objective goal is to have a two body joint that behaves like the three body two joints system, It seems possible.

We also need a 2 dof hinge that calculates angles in two Cartesian space, a cone is good for legs and arms but is not good for stuff like ankles and hands
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby Julio Jerez » Thu Jan 04, 2018 4:45 pm

Woow I quickly wrote the equation and I am pretty sure I have it. In fact we may be able to fuse all three joints into one.
Of course I will just made a new one and if it work as expected the we make the change.

I will post the derivation later, it is quite simple, I do not know why it evated me for so long.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby Julio Jerez » Fri Jan 05, 2018 10:43 am

Ha Joe I found what was wrong.
which the changed to local space. the joint has a flag that on initialization say the these is local space inverse dynamics, the flag is set to zero after the inverse dynamics solver.
then the rigid body solve just read those values.

this works fine as long as there is an invdynamics update, but if you us eteh same joint for exampl for a rag doll, then the joint is set to local space and calcute a morot accelration, but since the clean only happne on the invese dynamics update, then the joint swhict to work space mode, and it never rest since there was never at inv dynamic date.
but moving the clean up to the rigid body update, the it is always clean after the update.

now the joint is working we do no nee to worry about using combination of three bodies nor we nee to re write the joints. They seem correct.
I did find some tweaks, like using soft limit acceleration instead of a hard stop.
anyway we can now continue.

let us see if we can get to the Gaits keeping its balance this weekend.

Two things I want to add.
1-a way to rotate the limits instead of physically offsetting the child body.
2-a two axis hinge, for thing like ankles and wrists, teh cone is no right because the limits are different for the different axis.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby Julio Jerez » Fri Jan 05, 2018 11:01 am

Joe here is a hint that gives me hopes.
the simple gaits as simple as it is, should be able to stand up,
you can see that it almost want to stand up already, and gradually art to topple.

because the howl body stay up and start to move slowly thsi mean that if the is a controller that is smart and fast enough to calculate the corrections, they the gait you maintain equilibrium.

so I thinking making level of model, so that we do no go over the fiasco the happen last month that I made a complicated system to find out all those bug and missing functionality that I could only fond which the simple model.

for this model, we know that the equilibrium will be unstable, because the support polygon is a line or a point, so the controller that try to move the COM to the line of to the point will be unstable.
by this will be a good test to check out the frequency response of the system.

what do you think?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby JoeJ » Fri Jan 05, 2018 11:05 am

Julio Jerez wrote:Two things I want to add.
1-a way to rotate the limits instead of physically offsetting the child body.
2-a two axis hinge, for thing like ankles and wrists, teh cone is no right because the limits are different for the different axis.


I did this by allowing the limit cone to follow the child but constrained to a plane and by a min/max angle. Probably the sing/twist joint i added to the joints demo has this functionality IIRC.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Self balancing biped

Postby JoeJ » Fri Jan 05, 2018 11:18 am

Julio Jerez wrote:what do you think?


I'm not sure if i get you right.
I run the demo, biped lands on floor than falls to its back.

You want to balance it without planar feet, just at the tips of capsules?
I think that's impossible (without making a step). If not then i've missed something really important... but no, more likely i just get you wrong :?:
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: Self balancing biped

Postby Julio Jerez » Fri Jan 05, 2018 12:01 pm

JoeJ wrote:I'm not sure if i get you right.
I run the demo, biped lands on floor than falls to its back. You want to balance it without planar feet, just at the tips of capsules?

Yes that is correct.

I think that's impossible (without making a step

It not impossible, that's the claim I am making.
Animation is independent of the environment.

Imagine that some how the is a way to keep the center of mass of the body aligned to the projection of the com over the line that connect the top tip of the capsule, along the direction of gravity.

That will keep the body upright as long as the capsule are in contact with the ground, but this does not need the plane of the ground at all. The character can be in space and it still do it.
In fact I claim that it can be backed on one leg :shock: :P :P :D
This is a new way of looking at the problem. And it even have philosophical implication. Because I claim that walking is not difficult at all, since every creature in the animal kingdom and microscopy kingdom has evolved ways of walking and very few have evolve brains. Walk is accomplish by instinst and the brain have a small participation, only when it need to change the a mode
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Self balancing biped

Postby JoeJ » Fri Jan 05, 2018 12:07 pm

Interesting. I can't believe until i see.
Think of balancing a stick with your hand, you need to move your hand forth and back.

Dou you say that if we divide the stick into two and add a joint in the middle, this joint can generate motion that is able to balance the system? No - don't believe this either. You make me really curious... :wink:
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 29 guests

cron