Fast Research Interface Library  Manual and Documentation
Public Types | Public Member Functions | Private Member Functions | Private Attributes
TypeIRML Class Reference

This class contains the API of the Reflexxes Motion Library (Type I) More...

#include <TypeIRML.h>

List of all members.

Public Types

enum  TypeIRMLResult {
  RML_ERROR = -1, RML_MAX_VELOCITY_ERROR = -200, RML_MAX_ACCELERATION_ERROR = -201, RML_WORKING = 0,
  RML_FINAL_STATE_REACHED = 1
}
 Result values of the methods TypeIRML::GetNextMotionState_Position() and TypeIRML::GetNextMotionState_Velocity() More...

Public Member Functions

 TypeIRML (const unsigned int &NoOfDOFs, const double &CycleTimeInSeconds)
 Constructor of the class TypeIRML.
 ~TypeIRML (void)
 Destructor of the class TypeIRML.
int GetNextMotionState_Position (const double *CurrentPosition, const double *CurrentVelocity, const double *MaxVelocity, const double *MaxAcceleration, const double *TargetPosition, const bool *SelectionVector, double *NewPosition, double *NewVelocity)
 Calculates new position $ \vec{P}_{i+1} $ and velocity $ \vec{V}_{i+1} $ values for target position-based trajectory generation.
int GetNextMotionState_Position (const TypeIRMLInputParameters &IP, TypeIRMLOutputParameters *OP)
 Calculates new position $ \vec{P}_{i+1} $ and velocity $ \vec{V}_{i+1} $ values for target position-based trajectory generation.
int GetNextMotionState_Velocity (const double *CurrentPosition, const double *CurrentVelocity, const double *MaxAcceleration, const double *TargetVelocity, const bool *SelectionVector, double *NewPosition, double *NewVelocity)
 Calculates new position $ \vec{P}_{i+1} $ and velocity $ \vec{V}_{i+1} $ values for target velocity-based trajectory generation.
int GetNextMotionState_Velocity (const TypeIRMLInputParameters &IP, TypeIRMLOutputParameters *OP)
 Calculates new position $ \vec{P}_{i+1} $ and velocity $ \vec{V}_{i+1} $ values for target velocity-based trajectory generation.
double GetExecutionTime (void) const
 Returns the time in seconds that is required to time-optimally reach the desired target state of motion.

Private Member Functions

double CalculateMinimumSynchronizationTime (const TypeIRMLMath::TypeIRMLInputParameters &IP) const
 Calculates and returns the minimum synchronization time.
void SynchronizeTrajectory (const TypeIRMLMath::TypeIRMLInputParameters &IP, const double &SynchronizationTime, TypeIRMLMath::TypeIMotionPolynomials *PolynomialArray)
 Computes time-synchronized trajectories for all selected DOFs.
int CalculateOutputValues (const TypeIRMLMath::TypeIMotionPolynomials *PolynomialArray, const TypeIRMLBoolVector &SelectionVector, TypeIRMLMath::TypeIRMLOutputParameters *OP)
 Computes the output values for of the method GetNextMotionState_Position()

Private Attributes

int NumberOfDOFs
 Number of degrees of freedom.
double CycleTime
 Cycle time in seconds.
double InternalClockInSeconds
 Internal time. This time will set to zero if the input values have changed. Otherwise, this value will be incremented by CycleTime during every call of GetNextMotionState_Position() or GetNextMotionState_Velocity()
double TrajectoryExecutionTimeForTheUser
 Time in seconds until the final state of motion has been reached.
TypeIRMLMath::TypeIRMLInputParametersCurrentInputParameters
 Pointer to an object of the class TypeIRMLInputParameters.
TypeIRMLMath::TypeIRMLOutputParametersOutputParameters
 Pointer to an object of the class TypeIRMLOutputParameters.
TypeIRMLMath::TypeIMotionPolynomialsPolynomials
 Pointer to an array of TypeIMotionPolynomials objects.

Detailed Description

This class contains the API of the Reflexxes Motion Library (Type I)

The algorithm works with an arbitrary number of degrees of freedom. It can handle and proceed with any state of motion, that is, a new motion trajectory can be generated in any situation after any sensor event within the same control cycle. Further and detailed information can be found in

T. Kroeger.
On-Line Trajectory Generation in Robotic Systems.
Springer Tracts in Advanced Robotics, Vol. 58, Springer, January 2010.
http://www.springer.com/978-3-642-05174-6
.

Definition at line 87 of file TypeIRML.h.


Member Enumeration Documentation

Result values of the methods TypeIRML::GetNextMotionState_Position() and TypeIRML::GetNextMotionState_Velocity()

Enumerator:
RML_ERROR 

A general error.

RML_MAX_VELOCITY_ERROR 

The specified maximum velocity value of at least one degree of freedom is below the threshold of RML_MIN_VALUE_FOR_MAXVELOCITY.

RML_MAX_ACCELERATION_ERROR 

The specified maximum acceleration value of at least one degree of freedom is below the threshold of RML_MIN_VALUE_FOR_MAXACCELERATION.

RML_WORKING 

The on-line trajectory generation algorithm is working; the final state of motion has not been reached yet.

RML_FINAL_STATE_REACHED 

The desired final state of motion has been reached.

Definition at line 123 of file TypeIRML.h.


Constructor & Destructor Documentation

TypeIRML::TypeIRML ( const unsigned int &  NoOfDOFs,
const double &  CycleTimeInSeconds 
)

Constructor of the class TypeIRML.

Parameters:
NoOfDOFsIndicates the number of degrees of freedom
CycleTimeInSecondsIndicates the cycle time in seconds for the generator. A typical value is 0.001 (seconds).

Definition at line 68 of file TypeIRML.cpp.

TypeIRML::~TypeIRML ( void  )

Destructor of the class TypeIRML.

Definition at line 85 of file TypeIRML.cpp.


Member Function Documentation

Calculates and returns the minimum synchronization time.

This method computes the minimum execution time for each selected DOF, determines the maximum one, and returns this value.

Parameters:
IPPointer to the input parameters of the current call of GetNextMotionState_Position()
Remarks:
In the context of the on-line trajectory generation framework, this method is considered as Step 1.
Returns:
The value of the minimum synchronization time in seconds.

Definition at line 192 of file TypeIRML.cpp.

int TypeIRML::CalculateOutputValues ( const TypeIRMLMath::TypeIMotionPolynomials PolynomialArray,
const TypeIRMLBoolVector SelectionVector,
TypeIRMLMath::TypeIRMLOutputParameters OP 
) [private]

Computes the output values for of the method GetNextMotionState_Position()

Based on all polynomial parameters that have been calculated by the method SynchronizeTrajectory(), this method computes the output values for of the method GetNextMotionState_Position(), that is, the state of motion for the next control cycle.

Parameters:
PolynomialArrayPointer to the array of polynomials (TypeIRMLMath::TypeIMotionPolynomials) that have been parameterized by SynchronizeTrajectory().
SelectionVectorSelection vector of the current set of input parameters. Only if the flag for a DOF is set to true, output values will be set by this method.
OPOutput values of GetNextMotionState_Position(), that is, the state of motion for the next control cycle.
Remarks:
In the context of the on-line trajectory generation framework, this method is considered as Step 3.
Returns:

Definition at line 401 of file TypeIRML.cpp.

double TypeIRML::GetExecutionTime ( void  ) const

Returns the time in seconds that is required to time-optimally reach the desired target state of motion.

If this method is called after the execution of the method TypeIRML::GetNextMotionState_Position(), the time value for the position-based trajectory will be returned. If this method is called after the execution of the method TypeIRML::GetNextMotionState_Velocity(), the time value for the velocity-based trajectory will be returned, i.e., the time until which the last degree of freedom will reach its target velocity. For the case, the final and desired state of motion has already been reached (i.e., the result of TypeIRML::GetNextMotionState_Position() or TypeIRML::GetNextMotionState_Velocity() was TypeIRML::RML_FINAL_STATE_REACHED), this method returns a zero value.

Returns:
The value of the execution time in seconds. If neither the method TypeIRML::GetNextMotionState_Position() nor the method TypeIRML::GetNextMotionState_Velocity() was not called before, the returned value is -1.0.
See also:
TypeIRML::GetNextMotionState_Position()
TypeIRML::GetNextMotionState_Velocity()

Definition at line 521 of file TypeIRML.cpp.

int TypeIRML::GetNextMotionState_Position ( const double *  CurrentPosition,
const double *  CurrentVelocity,
const double *  MaxVelocity,
const double *  MaxAcceleration,
const double *  TargetPosition,
const bool *  SelectionVector,
double *  NewPosition,
double *  NewVelocity 
)

Calculates new position $ \vec{P}_{i+1} $ and velocity $ \vec{V}_{i+1} $ values for target position-based trajectory generation.

Parameters:
CurrentPositionThe current position $ \vec{P}_{i} $ (position of the last cycle, given by the user)
CurrentVelocityThe current velocity $ \vec{V}_{i} $ (velocity of the last cycle, given by the user)
MaxVelocityThe maximum velocity $ \vec{V}^{\,max}_{i} $ (given by the user)
MaxAccelerationThe maximum acceleration $ \vec{A}^{\,max}_{i} $ (given by the user)
TargetPositionThe target Position $ \vec{P}^{\,trgt}_{i} $ (given by the user)
SelectionVectorThe selection vector $ \vec{S}_{i} $, which determines, which DOFs are position controlled by the RML (of the current control cycle, given by the user)
NewPositionPointer to an array of double values for the new position $ \vec{P}_{i+1} $ (position of the current control cycle, to be calculated)
NewVelocityPointer to an array of double values for the new velocity $ \vec{V}_{i+1} $ (velocity of the current control cycle, to be calculated)
Returns:
See also:
TypeIRML::TypeIRMLResult

Definition at line 96 of file TypeIRML.cpp.

Calculates new position $ \vec{P}_{i+1} $ and velocity $ \vec{V}_{i+1} $ values for target position-based trajectory generation.

Parameters:
IPInput parameters for the current control cycle
OPOutput parameters for the current control cycle
Returns:
See also:
TypeIRML::TypeIRMLResult
TypeIRMLMath::TypeIRMLInputParameters
TypeIRMLMath::TypeIRMLOutputParameters

Definition at line 175 of file TypeIRML.cpp.

int TypeIRML::GetNextMotionState_Velocity ( const double *  CurrentPosition,
const double *  CurrentVelocity,
const double *  MaxAcceleration,
const double *  TargetVelocity,
const bool *  SelectionVector,
double *  NewPosition,
double *  NewVelocity 
)

Calculates new position $ \vec{P}_{i+1} $ and velocity $ \vec{V}_{i+1} $ values for target velocity-based trajectory generation.

Parameters:
CurrentPositionThe current position $ (\vec{P}_{i} $ (position of the last cycle, given by the user)
CurrentVelocityThe current velocity $ (\vec{V}_{i} $ (velocity of the last cycle, given by the user)
MaxAccelerationThe maximum acceleration $ \vec{A}^{\,max}_{i} $ (given by the user)
TargetVelocityThe target velocity $ (\vec{V}_{i}^{\,trgt} $ (velocity to be reached, given by the user)
SelectionVectorThe selection vector $ \vec{s}_{i} $, which determines, which DOFs are position controlled by the RML (of the current control cycle, given by the user)
NewPositionPointer to an array of double values for the new position $ (\vec{p}_{i} $ (position of the current control cycle, to be calculated)
NewVelocityPointer to an array of double values for the new velocity $ (\vec{v}_{i} $ (velocity of the current control cycle, to be calculated)
Returns:
See also:
TypeIRML::TypeIRMLResult

Definition at line 443 of file TypeIRML.cpp.

Calculates new position $ \vec{P}_{i+1} $ and velocity $ \vec{V}_{i+1} $ values for target velocity-based trajectory generation.

Parameters:
IPInput parameters for the current control cycle
OPOutput parameters for the current control cycle
Returns:
See also:
TypeIRML::TypeIRMLResult
TypeIRMLMath::TypeIRMLInputParameters
TypeIRMLMath::TypeIRMLOutputParameters

Definition at line 505 of file TypeIRML.cpp.

void TypeIRML::SynchronizeTrajectory ( const TypeIRMLMath::TypeIRMLInputParameters IP,
const double &  SynchronizationTime,
TypeIRMLMath::TypeIMotionPolynomials PolynomialArray 
) [private]

Computes time-synchronized trajectories for all selected DOFs.

This method computes all polynomial parameters PolynomialArray of all selected DOFs. These calculations are based on the input parameters that are given through the call of GetNextMotionState_Position() and and the minimum synchronization time SynchronizationTime.

Parameters:
IPPointer to the input parameters of the current call of GetNextMotionState_Position()
SynchronizationTimeMinimum synchronization time in seconds
PolynomialArrayPointer to an array of polynomials (TypeIRMLMath::TypeIMotionPolynomials)
Remarks:
In the context of the on-line trajectory generation framework, this method is considered as Step 2.

Definition at line 283 of file TypeIRML.cpp.


Member Data Documentation

Pointer to an object of the class TypeIRMLInputParameters.

Definition at line 494 of file TypeIRML.h.

double TypeIRML::CycleTime [private]

Cycle time in seconds.

See also:
TypeIRML::TypeIRML()

Definition at line 464 of file TypeIRML.h.

Internal time. This time will set to zero if the input values have changed. Otherwise, this value will be incremented by CycleTime during every call of GetNextMotionState_Position() or GetNextMotionState_Velocity()

Definition at line 476 of file TypeIRML.h.

int TypeIRML::NumberOfDOFs [private]

Number of degrees of freedom.

See also:
TypeIRML::TypeIRML()

Definition at line 453 of file TypeIRML.h.

Pointer to an object of the class TypeIRMLOutputParameters.

Definition at line 503 of file TypeIRML.h.

Pointer to an array of TypeIMotionPolynomials objects.

Definition at line 512 of file TypeIRML.h.

Time in seconds until the final state of motion has been reached.

Definition at line 485 of file TypeIRML.h.


The documentation for this class was generated from the following files:
This document was generated with Doxygen on Thu Apr 12 2012 11:18:55. User documentation of the Fast Research Interface Library for the KUKA Lightweight Robot IV by the Stanford Robotics Research Group. Copyright 2010–2012.