javax.robotics.engine.trajectory
Class Trapezoidal

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

public class Trapezoidal
extends java.lang.Object
implements Trajectory

This class implements trapezoidal velocity profile interpolator.

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

Field Summary
 
Fields inherited from interface javax.robotics.engine.trajectory.Trajectory
BAD_DATA, NOT_IN_RANGE
 
Constructor Summary
Trapezoidal(double ps, double pf, double vMax, double tf)
          Constructor of trapezoidal interpolator for a single trajectory.
Trapezoidal(java.io.File fileName)
          Constructor of trapezoidal interpolator from XML file.
Trapezoidal(java.io.InputStream fileName)
          Constructor of trapezoidal interpolator from XML input stream.
Trapezoidal(RVector ps, RVector pf, RVector vMax, double tf)
          Constructor of trapezoidal interpolator for trajectories of the same durations.
Trapezoidal(RVector ps, RVector pf, RVector vMax, RVector tf)
          Constructor of trapezoidal interpolator for trajectories of differents durations.
Trapezoidal(java.lang.String fileName)
          Constructor of trapezoidal interpolator from XML file.
Trapezoidal(java.net.URI uri)
          Constructor of trapezoidal interpolator with URI of xml file parameter.
 
Method Summary
 short getError()
          Gets error flag.
 short getID()
          Gets Trajectory class ID.
 pathML.PathConfigurationType getXmlHandler()
          Gets the xml confguration handler of trajectory.
 double[] interpolate(double t)
          Interpolates at time t to set the position, velocity and acceleration.
 void interpolate(double t, Quaternion q, RVector3d w)
          Deprecated.  
 void interpolate(double t, RVector3d p, RVector3d pp, RVector3d ppp)
          Interpolates at time t to set the position, velocity and acceleration.
 void interpolate(double t, RVector3d p, RVector3d pp, RVector3d ppp, Quaternion q, RVector3d w)
          Deprecated.  
 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 at time t to set the position, velocity and acceleration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Trapezoidal

public Trapezoidal(java.net.URI uri)
            throws org.apache.xmlbeans.XmlException,
                   java.io.IOException
Constructor of trapezoidal interpolator 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

Trapezoidal

public Trapezoidal(java.lang.String fileName)
            throws org.apache.xmlbeans.XmlException,
                   java.io.IOException
Constructor of trapezoidal interpolator from XML file.

Parameters:
fileName - the xml trapezoidal path file.
Throws:
org.apache.xmlbeans.XmlException
java.io.IOException

Trapezoidal

public Trapezoidal(java.io.File fileName)
            throws org.apache.xmlbeans.XmlException,
                   java.io.IOException
Constructor of trapezoidal interpolator from XML file.

Parameters:
fileName - the xml trapezoidal path file.
Throws:
org.apache.xmlbeans.XmlException
java.io.IOException

Trapezoidal

public Trapezoidal(java.io.InputStream fileName)
            throws org.apache.xmlbeans.XmlException,
                   java.io.IOException
Constructor of trapezoidal interpolator from XML input stream.

Parameters:
fileName - the xml trapezoidal path file.
Throws:
org.apache.xmlbeans.XmlException
java.io.IOException

Trapezoidal

public Trapezoidal(RVector ps,
                   RVector pf,
                   RVector vMax,
                   double tf)
Constructor of trapezoidal interpolator for trajectories of the same durations.

Parameters:
ps - the initial positions.
pf - the final positions.
vMax - the maximum velocities (the absolute value is taken).
tf - the final time.

Trapezoidal

public Trapezoidal(RVector ps,
                   RVector pf,
                   RVector vMax,
                   RVector tf)
Constructor of trapezoidal interpolator for trajectories of differents durations.

Parameters:
ps - the initial positions.
pf - the final positions.
vMax - the maximum velocities (the absolute value is taken).
tf - the final times.

Trapezoidal

public Trapezoidal(double ps,
                   double pf,
                   double vMax,
                   double tf)
Constructor of trapezoidal interpolator for a single trajectory.

Parameters:
pf - the final position.
vMax - the maximum velocity (the absolute value is taken).
tf - the final time.
Method Detail

getID

public short getID()
Description copied from interface: Trajectory
Gets Trajectory class ID.

Specified by:
getID in interface Trajectory
Returns:
ID

getError

public short getError()
Description copied from interface: Trajectory
Gets error flag.

Specified by:
getError in interface Trajectory
Returns:
error flag.
See Also:
Trajectory.interpolate(double, RVector, RVector, RVector), Trajectory.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.

interpolate

public void interpolate(double t,
                        RVector p,
                        RVector pp,
                        RVector ppp)
Description copied from interface: Trajectory
Interpolates at time t to set the position, velocity and acceleration.

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

interpolate

public void interpolate(double t,
                        RVector3d p,
                        RVector3d pp,
                        RVector3d ppp)
Description copied from interface: Trajectory
Interpolates at time t to set the position, velocity and acceleration.

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

interpolate

public double[] interpolate(double t)
Description copied from interface: Trajectory
Interpolates at time t to set the position, velocity and acceleration.

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,
                        Quaternion q,
                        RVector3d w)
Deprecated. 

Function Not implemented

Specified by:
interpolate in interface Trajectory
Parameters:
t - time
q - the quaternion at time t
w - the angular velocity at time t

interpolate

public void interpolate(double t,
                        RVector3d p,
                        RVector3d pp,
                        RVector3d ppp,
                        Quaternion q,
                        RVector3d w)
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
See Also:
Trajectory.getError()

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()