shady.common.multi.chain
Class DLSIK

java.lang.Object
  extended by shady.common.multi.chain.ChainIK
      extended by shady.common.multi.chain.DLSIK

public class DLSIK
extends ChainIK

Damped Least Squares Inverse Kinematics for a MultiShady chain.

Following Introduction to Inverse Kinematics with Jacobian Transpose, Pseudoinverse and Damped Least Squares Methods by Samuel R. Buss, unpublished, 2004, this method computes ChainIK.dofDelta by transforming the target error vector e = (ChainIK.dx, ChainIK.dy, ChainIK.dt) through the matrix


 J'(JJ'+lambda^2I)^(-1)

 
, where lambda is a non-zero damping constant.

Copyright (C) 2006 Marsette A. Vona, III

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Author:
Marsette (Marty) A. Vona, III

Field Summary
private static java.lang.String cvsid
          CVS id.
static boolean DEBUG
          Whether to debug.
static double DEFAULT_LAMBDA
          Default damping constant.
protected  Jama.Matrix e
          The error vector.
protected  double[][] E
          The error vector matrix.
protected  double[][] J
          Local reference to the Jacobian array.
protected  double[][] JJTL2I
          Reference to JJTPlusLambda2I's array.
protected  Jama.Matrix JJTPlusLambda2I
          [3 x 3] JJ'+lambda^2I.
static double lambda
          Damping constant.
 
Fields inherited from class shady.common.multi.chain.ChainIK
blockEndToChainEnd, blockStartToEnd, blockStartToEndWithDelta, chainEnd, chainEndToWorld, chainEndToWorldWithDelta, chainStart, DEBUG_ITERATION, DEFAULT_DOF_DELTA_CLAMP, DEFAULT_TARGET_CLAMP, dofDelta, dofDeltaClamp, dt, dx, dy, jacobian, JACOBIAN_DELTA, n, sentinel, targetClamp, worldToBlockStart, worldToChainEnd, worldToChainEndWithDelta
 
Constructor Summary
DLSIK(Block chainEnd)
          Construct a new DLSIK for a chain.
 
Method Summary
protected  void computeDOFDelta(int iteration)
          Subclasses must implement this to compute ChainIK.dofDelta vector from current ChainIK.jacobian and vector to target (ChainIK.dx, ChainIK.dy, ChainIK.dt).
 
Methods inherited from class shady.common.multi.chain.ChainIK
clampDOFDelta, clampDOFDeltaMagnitude, clampTarget, clampTargetMagnitude, closeEnough, gotoTarget, updateJacobian
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvsid

private static final java.lang.String cvsid

CVS id.

See Also:
Constant Field Values

DEBUG

public static final boolean DEBUG

Whether to debug.

See Also:
Constant Field Values

DEFAULT_LAMBDA

public static final double DEFAULT_LAMBDA

Default damping constant.

See Also:
Constant Field Values

J

protected double[][] J

Local reference to the Jacobian array.


JJTPlusLambda2I

protected Jama.Matrix JJTPlusLambda2I

[3 x 3] JJ'+lambda^2I.


JJTL2I

protected double[][] JJTL2I

Reference to JJTPlusLambda2I's array.


e

protected Jama.Matrix e

The error vector.


E

protected double[][] E

The error vector matrix.


lambda

public static double lambda

Damping constant.

Constructor Detail

DLSIK

public DLSIK(Block chainEnd)

Construct a new DLSIK for a chain.

Parameters:
chainEnd - the end of the chain to control, not null. Note that the actual chain may be longer, but IK control will only be applied to (non-locked) blocks at or before chainEnd.
Method Detail

computeDOFDelta

protected void computeDOFDelta(int iteration)

Subclasses must implement this to compute ChainIK.dofDelta vector from current ChainIK.jacobian and vector to target (ChainIK.dx, ChainIK.dy, ChainIK.dt).

This is the main IK step.

Following [Buss] this impl computes

Specified by:
computeDOFDelta in class ChainIK
Parameters:
iteration - iteration number