javax.robotics.engine.clik
Class ConstraintFunction

java.lang.Object
  extended by javax.robotics.engine.clik.ConstraintFunction
All Implemented Interfaces:
ConstraintVelocity

public abstract class ConstraintFunction
extends java.lang.Object
implements ConstraintVelocity

Interface for the constraint function w(q).

Example
define a constraint class:

 
  public class MyFunctionConstraint extends ConstraintFunction
  {
  
      MyFunctionConstraint(double k0, ...)
      {
          super(k0);
          ...
      }
  
  
      // Here implement function w(q)
      public double function(RVector q)
      {
          ...
       }
  
  }
  
 
use the class in your application:
 
  public class MyApplication
  {
       CLIKR clik = new ClikPosJcobianInverse(...); 
       MyFunctionConstraint w = new MyFunctionConstraint(k0, ...);
       ...
       // pass the class to clik wich computes the velocity constraint as gradient of w(q) 
       clik.step(pd, pdd, q, qp, w);
  }
  
 

Since:
1.0.2
Author:
Carmine Lia

Constructor Summary
ConstraintFunction(double k0)
           
 
Method Summary
 RVector compute(RVector q)
          Computes the constraint velocity as gradient of function w(q).
abstract  double function(RVector q)
          Interface for the constraint function w(q).
 double getK0()
          Gets the velocity constraint gain.
 void setK0(double k0)
          Sets the velocity constraint gain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstraintFunction

public ConstraintFunction(double k0)
Method Detail

getK0

public final double getK0()
Description copied from interface: ConstraintVelocity
Gets the velocity constraint gain.

Specified by:
getK0 in interface ConstraintVelocity
Returns:
the gain value.

setK0

public final void setK0(double k0)
Description copied from interface: ConstraintVelocity
Sets the velocity constraint gain.

Specified by:
setK0 in interface ConstraintVelocity
Parameters:
k0 - the gain value to set.

function

public abstract double function(RVector q)
Interface for the constraint function w(q).

Parameters:
q - the joints position.
Returns:
the function.

compute

public final RVector compute(RVector q)
Computes the constraint velocity as gradient of function w(q).
q0'=k0*grad(w(q))

Specified by:
compute in interface ConstraintVelocity
Parameters:
q - the joints position.
Returns:
the current value of constraint.