hey Joe, speaking of controller.
As you know I am try to get one using a neural net that will act as a magic function that given the state of the model, it will just tell where to move the effectors.
that in the simplest explanation that I can come up with.
for that, there are many algorithms from simple to more complex,
I am starting from the simplest of all which is called Q learning.
it is not good for continue spaces, like a ragdoll moved by effectors.
but it is good as entry level test.
I am reading a lot of literature before I start doing it, because there are many ways to make mistakes and few to be right, but without a good foundation of the theory, you just get frustration.
here is a good description of the method,
https://en.wikipedia.org/wiki/Q-learningand this happen to be at the core of almost all more sophisticated methods.
anyway. before I get there, I need to have a good reliable environment which I have been working for few days now.
work on that I just discover a huge fatal flaw, on the ik effector method.
It turns out that using the IK effector to calculate joint acceleration or torque, do work kinematically but does not work dynamically.
since the dynamics solution is the kinematic solution that minimized the energy, or toral momentum on the system, this seem to work for a while until the amount of movement added is no longer manageable.
that when I found that last week, it seemed to be a huge blow, to using the IK joints. but after a working the code, to see how can I make the kinematic solution abide but the conservation of momentum, the more I studied the disappointment I was getting.
them I start to think what if I use the kinematic joint just to calculate the joint accelerations, and not using them as part of the rig.
this is made possible by the principle of virtual work. and it is what the ndIkSolver does.
so I decide to test if that was right, and guess what it is 100% correct.
I added two test to verify this.
if you sync and try it here are the tests:
test one show the error. which is what is committed, shows the disastrous result of attaching the effector to the rig. if you try to move the limb, you will see that after a while the model rotates.
but that is impossible because the model has zero momentum, and there are no external forces or torque, so no matter how any internal part move, the overall momentum should be zero,
so using this on a controller, will probably work but will be very chaotic.
the secund demo, is the same model, but I just connected one limb that is control by an actuators joint,
if you move that limb, you will see that the upper body react in the opposite way to counter the momentum needed to move the limb, this is the expected behavior not withstanding numerical errors. but numerial errors can be controlled by small amount of damping.
those tow demos expose the problem, but do not really solve it.
the idea is to use the IK for simplicity but have it physically plausible.
so today I was ready to set that experiment but then I remember that I already have that experiment even in more complex setting. that is the ndAdvancedIndustrialRobot
all I had to do was detach it from the fix base, and let is float on the air.
I was not expecting to work, but to my amazement,
It just worked better than wildest expectation.
that model is a long chain of linked bodies, and it does no add any all the degree of freedom act just as expected.
so I am very, very happy about this result, so I will just go a head, and set the secund biped like that.
I still live the effector as possible joints, because for most rig this is not really a problem, is the rig is stable and has support, like is resting on the floor with a stable support, them the IK solution will be the same as the dynamic's solution, because there will be only one.
This is a problem only when there are multiple solutions like indifferent and unstable equilibrium, which is what a walk creature is. you do not what the movement to add momentum to the articulated body.
any way I just want to mention that.