Erin Catto wrote:You can make joint motors infinitely stiff in a joint coordinate model if you make the torque limits infinite. In that case you just treat the joint angle and speed as input.
unfortunately realistic torque limits are essential for realistic behaviours.
Erin Catto wrote:
Another approach would be to solve the inverse dynamics problem (prescribed joint torques) and use the computed joint torques as an initial guess for an iterative method. If you are not hitting torque limits, then you could skip the iterations. This takes order N time.
when you hit the limits the system may suddendly soften because of the iterative solver.
Erin Catto wrote:
Back in '99 I didn't know about iterative methods, so I wrote an engine that combined Featherstone with Lemke. You can read more about it here:
http://www.gphysics.com/archives/26
yes i remember that,thanks, it was possible to download them from the gphysics site years ago.
Erin Catto wrote:
If the number of motors is small, the problem might be reasonably solved with a direct LCP solver. I would expect the LCP matrix to be dense.
what i meant was that it should be possible to use Featherstone style computations inside a direct LCP solver in order to bring down the complexity.
If a pivoting method at each step is solving a linear system for a subset of the links, thats what the inverse/direct/hybrid dynamics versions of featherstone are doing in O(n). If the linear system is not changing too much from one iteration to another(thats the case for pivoting methods) we may even be able to optimise even more by reusing the previous computations.
as another example and outside the solver if we are trying to solve for the motors forces(so no contacts) we are trying to match the accelerations within given force limits
a = M*f (plus extra conditions)
where M is the system matrix, which could be computed for example by a unit force method, or more specifically by applying unit torques and reading the results out of the forward dynamics algorithm. see also Kokkevis "practical character physics" for the details..
now if we want to do some preconditioning we can premultiply both sides by the inverse of M and we get:
b = I*f (I = identity)
M_i*a = b
M_i*a can be computed by the inverse dynamics algorithm or more in general by the O(N) hybrid dynamics. So no explicit M and M_i is required.
If i didn't get anything wrong we end up with unit system matrix and a direct solver shouldn't struggle too much with it in order to enforce the LCP conditions.
the general idea is that the various versions of the Featherstone algorithm allow us to compute multiplications of a vector by the system matrix, its inverse or the hybrid dynamics case in O(n) for the entire hierarchy, so it should be possible to do the same for a subset of the hierarchy. Where all these case arise we can simplify the problem. This would work just for the motors, contacts may still be solved by a SI,GS,impulsive solver.
as i stated earlier on, these are just ideas i didn't have time to verify in depth. I was mainly focused on the control problem rather than the solver when i came across them.
generally speaking we know that the maximum subsystem dimension is somehow fixed(a human, a robot etc..), so O(n) or not the important thing is the total running time. Even if we want to stack controlled ragdolls we can do that by an iterative solver on the top level.
cheers,
Antonio