javax.robotics.engine.trajectory
Class Spline

java.lang.Object
  extended by javax.robotics.engine.JRoboOp
      extended by javax.robotics.engine.trajectory.Spline
All Implemented Interfaces:
Trajectory

public class Spline
extends JRoboOp
implements Trajectory

This class implements cubic spline interpolator.

Wrapper class for C++ library ROBOOP.

Since:
1.0.0
Version:
16/11/2005
Author:
Carmine Lia

Field Summary
 
Fields inherited from class javax.robotics.engine.JRoboOp
ID, Version
 
Fields inherited from interface javax.robotics.engine.trajectory.Trajectory
BAD_DATA, NOT_IN_RANGE
 
Constructor Summary
Spline()
          Spline cubic path default constructor.
Spline(java.io.File fileName)
          Trajectory Spline Path constructor from XML file.
Spline(java.io.InputStream fileName)
          Trajectory Spline Path constructor from XML input stream.
Spline(java.lang.String fileName)
          Trajectory Spline Path constructor from XML file.
Spline(java.net.URI uri)
          Spline constructor with URI of xml file parameter.
 
Method Summary
 short getError()
          Gets error flag.
 short getID()
          Gets Trajectory class ID.
 Matrix getOrientationData()
          Gets the orientation data as matrix.
 Matrix getPositionData()
          Gets the position data as matrix.
 pathML.PathConfigurationType getXmlHandler()
          Gets the xml confguration handler of trajectory.
 double[] interpolate(double t)
          Deprecated.  
 void interpolate(double t, Quaternion q, RVector3d w)
          Interpolates the spline at time t to set the quaternion and angular velocity.
 void interpolate(double t, RVector3d p, RVector3d pp, RVector3d ppp)
          Interpolates the spline at time t to set the position, velocity and acceleration.
 void interpolate(double t, RVector3d p, RVector3d pp, RVector3d ppp, Quaternion q, RVector3d w)
          Interpolates the spline at time t to set the position, velocity, acceleration, the quaternion and angular velocity.
 void interpolate(double t, RVector3d p, RVector3d pp, RVector3d ppp, Quaternion q, RVector3d w, RVector3d wp)
          Deprecated.  
 void interpolate(double t, RVector p, RVector pp, RVector ppp)
          Interpolates the spline at time t to set the position, velocity and acceleration.
 
Methods inherited from class javax.robotics.engine.JRoboOp
acceleration, acceleration, createComputedTorqueMethod, createGravityCompensation, createImpedance, createPDGravityComp, createProportionalDerivative, createResolveRateAcceleration, createRobot, createRobot, createRobot, createRobot, createRobustControl, createSplinePath, createSplineQuaternion, dTdqi, getAvDof, getConverge, getDof, getError, getGravity, getPosErrorGCOMP, getPosErrorRRA, getQ, getQ, getQMax, getQMin, getQOffset, getQp, getQpp, getQuatErrorGCOMP, getQuatErrorRRA, impedanceControl, inertia, interpolate, interpolatePathQuat, interpolateQuat, invKine, invKine, jacobian, jacobian, jacobianDLSinv, jacobianDot, jacobianDot, kine, kine, setGravity, setKdCTM, setKdPD, setKdPDG, setKdRC, setKpCTM, setKpPD, setKpPDG, setKpRC, setQ, setQ, setQp, setQpp, torque, torque, torqueCmdCTM, torqueCmdGCOMP, torqueCmdGCOMP, torqueCmdPD, torqueCmdPDG, torqueCmdRC, torqueCmdRRA, torqueCmdRRA, torqueCoriolis, torqueCoulombFriction, torqueGravity, torqueViscousFriction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spline

public Spline()
Spline cubic path default constructor.


Spline

public Spline(java.net.URI uri)
       throws org.apache.xmlbeans.XmlException,
              java.io.IOException
Spline constructor with URI of xml file parameter. The URI can be an URL or a file path.

Parameters:
uri - xml configuration file URI of robot parameter
Throws:
org.apache.xmlbeans.XmlException
java.io.IOException

Spline

public Spline(java.io.File fileName)
       throws org.apache.xmlbeans.XmlException,
              java.io.IOException
Trajectory Spline Path constructor from XML file.

Parameters:
fileName - file positions and/or orientation
Throws:
java.io.IOException
org.apache.xmlbeans.XmlException

Spline

public Spline(java.lang.String fileName)
       throws org.apache.xmlbeans.XmlException,
              java.io.IOException
Trajectory Spline Path constructor from XML file.

Parameters:
fileName - file positions and/or orientation
Throws:
java.io.IOException
org.apache.xmlbeans.XmlException

Spline

public Spline(java.io.InputStream fileName)
       throws org.apache.xmlbeans.XmlException,
              java.io.IOException
Trajectory Spline Path constructor from XML input stream.

Parameters:
fileName - file positions and/or orientation
Throws:
java.io.IOException
org.apache.xmlbeans.XmlException
Method Detail

getID

public final short getID()
Gets Trajectory class ID.

Specified by:
getID in interface Trajectory
Specified by:
getID in class JRoboOp
Returns:
ID

getError

public final short getError()
Gets error flag.

Specified by:
getError in interface Trajectory
Returns:
error flag.
See Also:
interpolate(double, RVector, RVector, RVector), interpolate(double, Quaternion, RVector3d)

getXmlHandler

public final pathML.PathConfigurationType getXmlHandler()
Gets the xml confguration handler of trajectory.

Specified by:
getXmlHandler in interface Trajectory
Returns:
the handler.

getPositionData

public final Matrix getPositionData()
Gets the position data as matrix.

Returns:
the position data.

getOrientationData

public final Matrix getOrientationData()
Gets the orientation data as matrix.

Returns:
the position data.

interpolate

public void interpolate(double t,
                        RVector p,
                        RVector pp,
                        RVector ppp)
Interpolates the spline at time t to set the position, velocity and acceleration.

It modifies error flag.

Specified by:
interpolate in interface Trajectory
Parameters:
t - time
p - the position at time t
pp - the velocity at time t
ppp - the acceleration at time t
See Also:
getError()

interpolate

public void interpolate(double t,
                        RVector3d p,
                        RVector3d pp,
                        RVector3d ppp)
Interpolates the spline at time t to set the position, velocity and acceleration. It modifies error flag.

Specified by:
interpolate in interface Trajectory
Parameters:
t - time
p - the position at time t
pp - the velocity at time t
ppp - the acceleration at time t
See Also:
getError()

interpolate

public void interpolate(double t,
                        Quaternion q,
                        RVector3d w)
Interpolates the spline at time t to set the quaternion and angular velocity.

Call C++ Spl_Quaternion method

  
   
    quat_w(const Real time, Quaternion & q, ColumnVector &wd)
    
   
 

It modifies error flag.

Specified by:
interpolate in interface Trajectory
Parameters:
t - time
q - the quaternion at time t
w - the angular velocity at time t
See Also:
getError()

interpolate

public void interpolate(double t,
                        RVector3d p,
                        RVector3d pp,
                        RVector3d ppp,
                        Quaternion q,
                        RVector3d w)
Interpolates the spline at time t to set the position, velocity, acceleration, the quaternion and angular velocity.

It modifies error flag.

Specified by:
interpolate in interface Trajectory
Parameters:
t - the time
p - the position at time t
pp - the velocity at time t
ppp - the acceleration at time t
q - the quaternion at time t
w - the angular velocity at time t
See Also:
getError()

interpolate

public double[] interpolate(double t)
Deprecated. 

Function Not implemented

Specified by:
interpolate in interface Trajectory
Parameters:
t - time
Returns:
a 3 elements array: the first element is the position at time t the second element is the velocity at time t the third element is the acceleration at time t

interpolate

public void interpolate(double t,
                        RVector3d p,
                        RVector3d pp,
                        RVector3d ppp,
                        Quaternion q,
                        RVector3d w,
                        RVector3d wp)
Deprecated. 

Function Not implemented

Specified by:
interpolate in interface Trajectory
Parameters:
t - the time
p - the position at time t
pp - the velocity at time t
ppp - the acceleration at time t
q - the quaternion at time t
w - the angular velocity at time t
wp - the angular acceleration at time t
See Also:
Trajectory.getError()