Reflexxes Motion Libraries  Manual and Documentation (Type II, Version 1.2.6)
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
TypeIIRMLPosition Class Reference

This class constitutes the low-level user interface of the Reflexxes Type II Motion Library, which contains the Type II On-Line Trajectory Generation algorithm More...

#include <TypeIIRMLPosition.h>

List of all members.

Public Member Functions

 TypeIIRMLPosition (const unsigned int &DegreesOfFreedom, const double &CycleTimeInSeconds)
 Constructor of the class TypeIIRMLPosition.
 ~TypeIIRMLPosition (void)
 Destructor of the class TypeIIRMLPosition.
int GetNextStateOfMotion (const RMLPositionInputParameters &InputValues, RMLPositionOutputParameters *OutputValues, const RMLPositionFlags &Flags)
 The main method of the class TypeIIRMLPosition. It executes the position-based Type II On-Line Trajectory Generation algorithm
int GetNextStateOfMotionAtTime (const double &TimeValueInSeconds, RMLPositionOutputParameters *OutputValues) const
 Once the method of TypeIIRMLPosition::GetNextStateOfMotion() was successfully called to compute a trajectory, this method can be used to compute a state of motion on this trajectory at a given time instant.

Protected Types

enum  FunctionResults { FUNC_SUCCESS = false, FUNC_ERROR_OCCURRED = true }
 For class-internal use only: return values of boolean methods. More...
enum  DominatValueForPhaseSync { UNDEFINED = 0, POSITION = 1, CURRENT_VELOCITY = 3, TARGET_VELOCITY = 4 }
 Set of input vector identifiers that can determine the normalized vector for phase-synchronization. More...

Protected Member Functions

void CompareInitialAndTargetStateofMotion (void)
 If the initial state of motion exactly equals the target state of motion, an adaptation is performed.
void Step1 (void)
 Step 1 of the On-Line Trajectory Generation algorithm: Calculate the synchronization time $ t_i^{\,sync} $.
void Step2 (void)
 Step 2 of the On-Line Trajectory Generation algorithm: time synchronization of all selected degrees of freedom.
int Step3 (const double &TimeValueInSeconds, RMLPositionOutputParameters *OP) const
 Step 3 of the On-Line Trajectory Generation algorithm: calculate output values.
void FallBackStrategy (const RMLPositionInputParameters &InputValues, RMLPositionOutputParameters *OutputValues, const RMLPositionFlags &InputsFlags)
 In case of an error, this method triggers the second layer of the safety concept.
bool IsWithinAnInoperativeTimeInterval (const double &SynchronizationTimeCandidate, const RMLDoubleVector &MaximalExecutionTime, const RMLDoubleVector &AlternativeExecutionTime) const
 Checks, whether the value SynchronizationTimeCandidate lies within an inoperative timer interval.
bool IsPhaseSynchronizationPossible (RMLDoubleVector *ReferenceVector)
 Checks, whether the motion trajectory can be phase-synchronized.
void Step2PhaseSynchronization (void)
 Executes Step 2 for phase-synchronized motion trajectories.
void CalculatePositionalExtrems (const double &TimeValueInSeconds, RMLPositionOutputParameters *OP) const
 Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLPosition::OutputParameters)
void SetPositionalExtremsToZero (RMLPositionOutputParameters *OP) const
 Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLPosition::OutputParameters) to zero.
void SetupModifiedSelectionVector (void)
 Modify the current selection vector and exclude unnecessary degrees of freedom.
unsigned int GetNumberOfSelectedDOFs (const RMLBoolVector &BoolVector) const
 Returns the number of elements in BoolVector that are true.

Protected Attributes

bool CurrentTrajectoryIsPhaseSynchronized
 Indicates, whether the current trajectory is phase-synchronized.
bool CurrentTrajectoryIsNotSynchronized
 Indicates that no synchronization is required for the current set of input values, that is, the input flag RMLFlags::NO_SYNCHRONIZATION is set.
bool CalculatePositionalExtremsFlag
 Indicates, whether the positional extremes are to be calculated.
int ReturnValue
 Contains the return value of the method TypeIIRMLPosition::GetNextStateOfMotion()
unsigned int NumberOfDOFs
 The number of degrees of freedom $ K $.
unsigned int GreatestDOFForPhaseSynchronization
 Contains the index of the degree of freedom that was used to compute the reference vector for phase-synchronization, $ \vec{\varrho}_i $.
unsigned int MotionProfileForPhaseSynchronization
 Contains the ID of the profile that is used for phase-synchronization.
double CycleTime
 Contains the cycle time in seconds.
double SynchronizationTime
 If the trajectory is time- or phase-synchronized, this attribute will contain the synchronization time $ t_i^{\,sync} $. Otherwise,is used for the execution time of the degree of freedom that requires the greatest time.
double InternalClockInSeconds
 In order to prevent from recalculating the trajectory within every control cycle and to safe CPU time, this time value in seconds represents the elapsed time since the last calculation.
RMLPositionFlags OldFlags
 In order to check, whether a new calculation has to be started, the input values have to be compared to the input and output values of the previous cycle. This variable is used to store the flags of last cycle.
RMLBoolVectorModifiedSelectionVector
 Boolean vector, which contains the modified selection vector that is based on the original selection vector $ \vec{S}_i $.
RMLVector< Step1_Profile > * UsedStep1AProfiles
 Vector that contains the profiles that are used by Step 1A to calculate $ \vec{t}_i^{\,min} $.
RMLDoubleVectorStoredTargetPosition
 Stores the original target position vector $ \vec{P}_i^{\,trgt} $.
RMLDoubleVectorMinimumExecutionTimes
 Vector that contains the minimum execution times in seconds, $ \vec{t}_i^{\,min} $.
RMLDoubleVectorBeginningsOfInoperativeTimeIntervals
 Vector that contains the beginnings of inoperative time intervals in seconds, $ \vec{t}_i^{\,begin} $.
RMLDoubleVectorEndingsOfInoperativeTimeIntervals
 Vector that contains the endings of inoperative time intervals in seconds, $ \vec{t}_i^{\,end} $.
RMLDoubleVectorPhaseSynchronizationReferenceVector
 Reference vector for phase-synchronized trajectories, $ \vec{\varrho}_i $ with $ _{\kappa}\varrho_i\,=\,1 $.
RMLDoubleVectorPhaseSynchronizationCurrentPositionVector
 Current position vector $ \vec{P}_i $ used for the calculation of phase-synchronized motion trajectories.
RMLDoubleVectorPhaseSynchronizationTargetPositionVector
 Target position vector $ \vec{P}_i^{\,trgt} $ used for the calculation of phase-synchronized motion trajectories.
RMLDoubleVectorPhaseSynchronizationPositionDifferenceVector
 Position difference vector $ \left( \vec{P}_i^{\,trgt}\,-\,\vec{P}_i \right) $ used for the calculation of phase-synchronized motion trajectories.
RMLDoubleVectorPhaseSynchronizationCurrentVelocityVector
 Current velocity vector $ \vec{V}_i $ used for the calculation of phase-synchronized motion trajectories.
RMLDoubleVectorPhaseSynchronizationTargetVelocityVector
 Target velocity vector $ \vec{V}_i^{\,trgt} $ used for the calculation of phase-synchronized motion trajectories.
RMLDoubleVectorPhaseSynchronizationMaxVelocityVector
 Contains the adapted maximum velocity vector $ \left.\vec{V}_i^{\,max}\right.' $ for phase-synchronized trajectories.
RMLDoubleVectorPhaseSynchronizationMaxAccelerationVector
 Contains the adapted maximum acceleration vector $ \left.\vec{A}_i^{\,max}\right.' $ for phase-synchronized trajectories.
RMLDoubleVectorPhaseSynchronizationTimeVector
 A vector of execution time values in seconds for all selected degrees of freedom used for phase-synchronized motion trajectories.
RMLDoubleVectorPhaseSynchronizationCheckVector
 Candidate for a reference vector $ \vec{\varrho}_i $ used for phase-synchronized motion trajectories.
RMLDoubleVectorArrayOfSortedTimes
 An array of possible synchronization times in seconds. It contains all values of $ \vec{t}_i^{\,min} $, $ \vec{t}_i^{\,begin} $, and $ \vec{t}_i^{\,end} $. The array contains $ 3\,\cdot\,K $ elements.
RMLDoubleVectorZeroVector
 A vector with $ K $ double elements, all of which are zero.
RMLPositionInputParametersOldInputParameters
 Pointer to an RMLPositionInputParameters object. In order to check, whether a new calculation has to be started, the input values have to be compared to the input and output values of the previous cycle. This variable is used to store the old input values.
RMLPositionInputParametersCurrentInputParameters
 Pointer to an RMLPositionInputParameters object. This object contains a complete set of input values $ {\bf W}_i $.
RMLPositionOutputParametersOutputParameters
 Pointer to an RMLPositionOutputParameters object. This object contains the output parameters of the method TypeIIRMLPosition::GetNextStateOfMotion(). Besides the new desired state of motion $ {\bf M}_{i+1} $, further complementary values for positional extremes are provided.
TypeIIRMLVelocityRMLVelocityObject
 Pointer to an TypeIIRMLVelocity object. The velocity-based On-Line Trajectory Generation algorithm is used in the second layer of the safety concept.
RMLVelocityInputParametersVelocityInputParameters
 Pointer to an RMLVelocityInputParameters object. It is used for the input parameters of the velocity-based On-Line Trajectory Generation algorithm called with TypeIIRMLVelocity::GetNextStateOfMotion() in the second safety layer.
RMLVelocityOutputParametersVelocityOutputParameters
 Pointer to an RMLVelocityOutputParameters object. It is used for the output parameters of the velocity-based On-Line Trajectory Generation algorithm called with TypeIIRMLVelocity::GetNextStateOfMotion() in the second safety layer.
RMLVelocityFlags VelocityFlags
 Pointer to an RMLVelocityFlags object. It is used for the velocity-based On-Line Trajectory Generation algorithm called with TypeIIRMLVelocity::GetNextStateOfMotion() in the second safety layer.
MotionPolynomialsPolynomials
 Pointer to an MotionPolynomials object, which contains the actual trajectory $ {\cal M}_i $. It is a two-dimensional array of polynomial functions.
DominatValueForPhaseSync PhaseSynchronizationMagnitude
 Value indicating, which of input vectors was used to compute the reference vector for phase-synchronization TypeIIRMLPosition::PhaseSynchronizationReferenceVector ( $ \vec{\varrho}_i $)

Detailed Description

This class constitutes the low-level user interface of the Reflexxes Type II Motion Library, which contains the Type II On-Line Trajectory Generation algorithm

This class is the low-level application interface of the Type II On-Line Trajectory Generation algorithm. The wrapper class ReflexxesAPI, simplifies this interface for the user, such that all relevant functionalities can be accessed, but all parts that are not needed by the user are hidden.

The mathematical futtocks of the algorithm are described 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

The algorithm makes use of the namespace TypeIIRMLMath, which is a collection of mathematical functions required for the algorithm. Besides others, this namespace contains the functions for each single decision of all decision trees as well as all functions to solve the systems of equations that occur in the leaves of of the decision trees.

Besides the constructor, the class only has one method that is relevant for the user: TypeIIRMLPosition::GetNextStateOfMotion(). The input and and output values of this function are described in the classes RMLFlags, RMLPositionInputParameters, and RMLPositionOutputParameters, all of which are also described in the context of the class ReflexxesAPI. Information about all these parameters can be found on the pages

The class TypeIIRMLVelocity is a byproduct only. It can be used in the very same as this class, but target position vectors $ \vec{P}_i^{\,trgt} $ cannot be specified. While the class TypeIIRMLPosition can be used for the instantaneous computation of motions towards a desired target pose or position, the class TypeIIRMLVelocity basically has two functionalities:

  1. TypeIIRMLVelocity is the main component for the second safety layer (cf. Safety: Three Layers of Error Handling).
  2. TypeIIRMLVelocity can be used to generate a trajectory starting from an arbitrary initial state of motion to achieve a certain target velocity $ \vec{V}_i^{\,trgt} $.
See also:
TypeIIRMLVelocity
RMLPositionInputParameters
RMLPositionOutputParameters
ReflexxesAPI
TypeIIRMLMath

Member Enumeration Documentation

Set of input vector identifiers that can determine the normalized vector for phase-synchronization.

In order to assure numerical stability, the input vector with the greatest magnitude is used to compute the normalized reference direction vector for phase-synchronized trajectories. The attribute TypeIIRMLPosition::PhaseSynchronizationMagnitude is set-up by the method TypeIIRMLPosition::IsPhaseSynchronizationPossible(), which checks, whether all conditions for the generation of a phase-synchronized trajectory are fulfilled.

See also:
TypeIIRMLPosition::PhaseSynchronizationMagnitude
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior
Enumerator:
UNDEFINED 

No value has been assigned yet.

POSITION 

The position difference vector $ \left( \vec{P}_i^{\,trgt}\ -\ \vec{P}_i\right) $ was to the dominant value to determine the reference vector $ \vec{\varrho}_i $ for a phase-synchronized trajectory.

CURRENT_VELOCITY 

The current acceleration vector $ \vec{A}_i $ was to the dominant value to determine the reference vector $ \vec{\varrho}_i $ for a phase-synchronized trajectory.

TARGET_VELOCITY 

The target velocity vector $ \vec{V}_i^{\,trgt} $ was to the dominant value to determine the reference vector $ \vec{\varrho}_i $ for a phase-synchronized trajectory.

For class-internal use only: return values of boolean methods.

Enumerator:
FUNC_SUCCESS 

The method was executed without any error.

FUNC_ERROR_OCCURRED 

The method was executed, and an error occurred.


Constructor & Destructor Documentation

TypeIIRMLPosition::TypeIIRMLPosition ( const unsigned int &  DegreesOfFreedom,
const double &  CycleTimeInSeconds 
)

Constructor of the class TypeIIRMLPosition.

The two tasks of the constructor are

  1. Initializing all class attributes
  2. Allocating and initializing memory for all pointer attributes
Warning:
The constructor is not real-time capable as heap memory has to be allocated.
Parameters:
DegreesOfFreedomSpecifies the number of degrees of freedom
CycleTimeInSecondsSpecifies the cycle time in seconds
See also:
TypeIIRMLPosition::~TypeIIRMLPosition()

Destructor of the class TypeIIRMLPosition.

All the heap memory that was allocated by the constructor is freed again.

See also:
TypeIIRMLPosition::TypeIIRMLPosition()

Member Function Documentation

void TypeIIRMLPosition::CalculatePositionalExtrems ( const double &  TimeValueInSeconds,
RMLPositionOutputParameters OP 
) const [protected]

Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLPosition::OutputParameters)

After all trajectory parameters $ {\cal M}_{i}(t) $ have been computed in Step 2, they are stored in the attribute TypeIIRMLPosition::Polynomials. Using this attribute, this method computes all positional extremum values and corresponding states of motion and writes the results to TypeIIRMLPosition::OutputParameters. In particular, the following values are calculated:

All these values may be used by the user to perform further calculations based on the currently calculated motion trajectory (e.g., a check for workspace boundaries).

Parameters:
TimeValueInSecondsTime value in seconds, at which the next state of motion is calculated. The positional extremes are calculated with respect to this value.
OPPointer to an object of the class RMLPositionOutputParameters. The positional extreme values will be calculated for these data.
Note:
The calculation of these values can be disabled by setting the flag RMLPositionFlags::EnableTheCalculationOfTheExtremumMotionStates to false when the method TypeIIRMLPosition::GetNextStateOfMotion() is called.
See also:
Description of Output Values
RMLPositionOutputParameters
RMLPositionFlags::EnableTheCalculationOfTheExtremumMotionStates
TypeIIRMLPosition::GetNextStateOfMotion()
TypeIIRMLPosition::SetPositionalExtremsToZero()
TypeIIRMLVelocity::CalculatePositionalExtrems

If the initial state of motion exactly equals the target state of motion, an adaptation is performed.

If the initial state of motion exactly equals the target state of motion, we add a negligible error to the input state of motion in order to let the decision trees run deterministically. Otherwise, these values would be a singularity for the decision trees as

  • either no trajectory is required (i.e., an execution time of zero seconds), or
  • the current motion is continued until the same state of motion is reached again (time-optimally).

As this case can only occur, if the input values change, and if the output values of the last cycle are not directly fed back to the input parameters of this cycle, we need to calculate the trajectory to reach the desired state of motion. Otherwise, no trajectory would be required at all and it would not make sense to the On-Line Trajectory Generation algorithm.

See also:
TypeIIRMLPosition::GetNextStateOfMotion()
void TypeIIRMLPosition::FallBackStrategy ( const RMLPositionInputParameters InputValues,
RMLPositionOutputParameters OutputValues,
const RMLPositionFlags InputsFlags 
) [protected]

In case of an error, this method triggers the second layer of the safety concept.

If no trajectory can be calculated by the position-based On-Line Trajectory Generation algorithm (TypeIIRMLPosition::GetNextStateOfMotion()), the velocity-based algorithm (TypeIIRMLVelocity::GetNextStateOfMotion()) is called in the second safety layer. Before this call can be made, this method casts the TypeIIRMLPosition::CurrentInputParameters object and the RMLPositionFlags input flag object used in TypeIIRMLPosition::GetNextStateOfMotion() to an RMLVelocityInputParameters object and an RMLVelocityFlags object. During this casting, the desired target velocity vector $ \vec{V}_{i}^{\,trgt} $ for the velocity-based On-Line Trajectory Generation algorithm is either set

Subsequently to the casting procedure, TypeIIRMLVelocity::GetNextStateOfMotion() is called and generates valid and feasible output values, which are represented in a RMLVelocityOutputParameters that finally is casted to a RMLPositionOutputParameters object, namely OutputValues.

A detailed description of the three-layered safety mechanism of the Reflexxes Motion Libraries can be found at Safety: Three Layers of Error Handling.

Parameters:
InputValuesThe current input values of the position-based On-Line Trajectory Generation algorithm. These values are casted to an RMLVelocityInputParameters as described above
OutputValuesPointer to an RMLVelocityOutputParameters object. The method writes the resulting output values of the velocity-based On-Line Trajectory Generation algorithm into this object.
InputsFlagsThe current input flags of the position-based On-Line Trajectory Generation algorithm.
Note:
By default, the flag RMLPositionFlags::KeepCurrentVelocityInCaseOfFallbackStrategy is set to false, and the alternative target velocity vector $ \vec{V}_{i}^{\,\underline{trgt}} $ is set to zero. Depending on the requirements of the application, one may choose between the two additional options that are described above by setting up the value of RMLPositionFlags::KeepCurrentVelocityInCaseOfFallbackStrategy and RMLPositionInputParameters::AlternativeTargetVelocityVector of the TypeIIRMLPosition::CurrentInputParameters object correspondingly.
See also:
TypeIIRMLVelocity
TypeIIRMLVelocity::GetNextStateOfMotion()
TypeIIRMLPosition::OutputParameters
TypeIIRMLPosition::ReturnValue
Safety: Three Layers of Error Handling
int TypeIIRMLPosition::GetNextStateOfMotion ( const RMLPositionInputParameters InputValues,
RMLPositionOutputParameters OutputValues,
const RMLPositionFlags Flags 
)

The main method of the class TypeIIRMLPosition. It executes the position-based Type II On-Line Trajectory Generation algorithm

Given a set of InputValues consisting of

  • a current state of motion $ {\bf M}_i $ at intstant $ T_i $,
  • a target state of motion $ {\bf M}_i^{\,trgt} $ at intstant $ T_i $ (with zero acceleration),
  • kinematic motion constraints $ {\bf B}_i $ at intstant $ T_i $, and
  • a selection vector $ \vec{S}_i $ at intstant $ T_i $

and a set of boolean Flags to control the behavior of the algorithm, this method executes the position-based Type II On-Line Trajectory Generation algorithm and provides a set of OutputValues, which contain

  • the desired state of motion $ {\bf M}_{i+1} $ at intstant $ T_{i+1} $ and
  • (optionally) further complementary values of the current trajectory.

For a detailed description, please refer to TypeIIRMLPosition and to the start page Start Page.

Parameters:
InputValuesInput values of the position-based Type II On-Line Trajectory Generation algorithm. For detailed information, please refer to the class RMLPositionInputParameters and to the page Description of Input Values.
OutputValuesOutput values of the position-based Type II On-Line Trajectory Generation algorithm. For detailed information, please refer to the class RMLPositionOutputParameters and to the page Description of Output Values.
FlagsA set of boolean values to configure the behavior of the algorithm (e.g., specify whether a time- or a phase-synchronized trajectory is desired, specify, whether the complementary output values are supposed to be computed). For a detailed description of this data structure and its usage, please refer to RMLPositionFlags.
Returns:
An element of ReflexxesAPI::RMLResultValue:

Note:
A complete description of the On-Line Trajectory Generation framework may be also found at

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

See also:
TypeIIRMLPosition
RMLPositionInputParameters
RMLPositionOutputParameters
RMLPositionFlags
ReflexxesAPI
TypeIIRMLVelocity::GetNextStateOfMotion()
TypeIIRMLPosition::GetNextStateOfMotionAtTime()
TypeIIRMLMath
Synchronization Behavior
int TypeIIRMLPosition::GetNextStateOfMotionAtTime ( const double &  TimeValueInSeconds,
RMLPositionOutputParameters OutputValues 
) const

Once the method of TypeIIRMLPosition::GetNextStateOfMotion() was successfully called to compute a trajectory, this method can be used to compute a state of motion on this trajectory at a given time instant.

After the method GetNextStateOfMotion() was called and no error value was returned (i.e., ReflexxesAPI::RML_WORKING or ReflexxesAPI::RML_FINAL_STATE_REACHED was returned), a trajectory was successfully generated. In order to compute a state of motion of this trajectory at a given time instant, this method can be used. No new calculations are started by calling this method; only the existing result of the method GetNextStateOfMotion() is used. TimeValueInSeconds specifies the time of the desired state of motion, which is copied to OutputValues (cf. RMLPositionOutputParameters).

If the method TypeIIRMLPosition::GetNextStateOfMotion() returned an error, the same error will be returned by this method. The value of TimeValueInSeconds has to be positive and below the values of RML_MAX_EXECUTION_TIME ( $ 10^{10} $ seconds).

For further information, please refer to the documentation of TypeIIRMLPosition::GetNextStateOfMotion().

Parameters:
TimeValueInSecondsTime value in seconds, at which the desired state of motion is calculated.
OutputValuesOutput values of the position-based Type II On-Line Trajectory Generation algorithm. For detailed information, please refer to the class RMLPositionOutputParameters and to the page Description of Output Values.
Returns:
An element of ReflexxesAPI::RMLResultValue:

See also:
TypeIIRMLPosition
RMLPositionOutputParameters
RMLPositionFlags
ReflexxesAPI
TypeIIRMLPosition::GetNextStateOfMotion()
TypeIIRMLVelocity::GetNextStateOfMotionAtTime()
unsigned int TypeIIRMLPosition::GetNumberOfSelectedDOFs ( const RMLBoolVector BoolVector) const [protected]

Returns the number of elements in BoolVector that are true.

Parameters:
BoolVectorAn RMLBoolVector object (cf. RMLVector)
Returns:
The number of elements in BoolVector that are true
See also:
TypeIIRMLPosition::ModifiedSelectionVector
RMLPositionInputParameters::SelectionVector
bool TypeIIRMLPosition::IsPhaseSynchronizationPossible ( RMLDoubleVector ReferenceVector) [protected]

Checks, whether the motion trajectory can be phase-synchronized.

After all minimum execution times $ \vec{t}_i^{\,min} $ have been calculated in Step 1A, it can be checked whether the trajectory can be phase-synchronized. Therefore, this method checks whether the input vectors

  • current position difference vector $ \left(\vec{P}_{i}^{\,trgt}\,-\,\vec{P}_{i}\right) $,
  • current velocity vector $ \vec{V}_{i} $, and
  • target velocity vector $ \vec{V}_{i}^{\,trgt} $,

are collinear to each other. If this is the case,

If this is not the case,

For all these computations, the attributes

are used. Further information about time- and phase-synchronization can be found in the section on Synchronization Behavior.

Parameters:
ReferenceVectorPointer to an RMLDoubleVector object. If all mentioned conditions are fulfilled, such that the motion trajectory can be phase-synchronized, the reference vector $ \vec{\varrho}_i $ will be written to this RMLDoubleVector object. If the motion cannot be phase-synchronized, the RMLDoubleVector object will not be changed.
Returns:
  • true if phase-synchronization is possible
  • false otherwise
See also:
TypeIIRMLPosition::Step1()
TypeIIRMLVelocity::IsPhaseSynchronizationPossible()
Synchronization Behavior
bool TypeIIRMLPosition::IsWithinAnInoperativeTimeInterval ( const double &  SynchronizationTimeCandidate,
const RMLDoubleVector MaximalExecutionTime,
const RMLDoubleVector AlternativeExecutionTime 
) const [protected]

Checks, whether the value SynchronizationTimeCandidate lies within an inoperative timer interval.

After all minimum execution times $ \vec{t}_i^{\,min} $, all inoperative time interval beginnings $ \vec{t}_i^{\,begin} $, and inoperative time interval endings $ \vec{t}_i^{\,end} $ are calculated be the decision trees 1A, 1B, and 1C, it has to be checked for each possible candidate for $ t_i^{\,sync} $, whether it is within an inoperative time interval $ _k\zeta_{i}\ \forall\ k\ \in \ \left\{1,\,\dots,\,K\right\} $ where all inoperative intervals are described by $ _k\zeta_{i}\,=\,\left[_kt_{i}^{\,begin},\,_kt_{i}^{\,end}\right] $.

Parameters:
SynchronizationTimeCandidatePossible candidate for $ t_i^{\,sync} $ that will be checked by this method. The value is given in seconds.
MaximalExecutionTimeBeginning of an inoperative time interval $ _kt_{i}^{\,begin} $ in seconds
AlternativeExecutionTimeEnding of an inoperative time interval $ _kt_{i}^{\,end} $ in seconds
Returns:
  • true if SynchronizationTimeCandidate lies within the inoperative time interval
  • false otherwise
See also:
TypeIIRMLPosition::Step1()

Modify the current selection vector and exclude unnecessary degrees of freedom.

This method modifies the selection vector RMLPositionInputParameters::SelectionVector of TypeIIRMLPosition::CurrentInputParameters to TypeIIRMLPosition::ModifiedSelectionVector. Degrees of freedom that are already in their target state of motion, and whose target state of motion $ {\bf M}_i^{\,trgt} $ consists of a velocity value of zero are removed from the selection vector $ \vec{S}_i $, that is, the corresponding elements are set to false. Although a correct solution would be calculated for such cases, it is important to exclude them in order give remaining degrees of freedom the chance to become phase-synchronized. During the procedure of phase-synchronization might, numerical problems may occur if degrees of freedom are involved, that already reached their final and desired target state of motion.

Note:
The method is called within the method TypeIIRMLPosition::Step1() right after Step 1A was executed. All parts of the algorithm before this point use the original selection vector of TypeIIRMLPosition::CurrentInputParameters $ \vec{S}_i $, and all following parts make use of TypeIIRMLPosition::ModifiedSelectionVector.
See also:
TypeIIRMLPosition::ModifiedSelectionVector
RMLPositionInputParameters::SelectionVector
TypeIIRMLPosition::GetNextStateOfMotion()
TypeIIRMLPosition::Step1()
TypeIIRMLVelocity::SetupPhaseSyncSelectionVector()
Synchronization Behavior
void TypeIIRMLPosition::Step1 ( void  ) [protected]

Step 1 of the On-Line Trajectory Generation algorithm: Calculate the synchronization time $ t_i^{\,sync} $.

The only result of this method is a value for the synchronization time $ t_i^{\,sync} $ (cf. TypeIIRMLPosition::SynchronizationTime) and the information, whether the motion is phase-synchronized or time-synchronized (cf. TypeIIRMLPosition::CurrentTrajectoryIsPhaseSynchronized).

To achieve this, a set of other functionalities is used:


A brief overview about the interrelations among the different steps and decision trees can be found in section The Position-based Type II On-Line Trajectory Generation Algorithm.

See also:
TypeIIRMLPosition::Step2()
TypeIIRMLPosition::Step3()
TypeIIRMLPosition::SynchronizationTime
TypeIIRMLPosition::CurrentTrajectoryIsPhaseSynchronized
The Position-based Type II On-Line Trajectory Generation Algorithm
void TypeIIRMLPosition::Step2 ( void  ) [protected]

Step 2 of the On-Line Trajectory Generation algorithm: time synchronization of all selected degrees of freedom.

After the synchronization time $ t_i^{\,sync} $ (cf. TypeIIRMLPosition::SynchronizationTime) was calculated by the method TypeIIRMLPosition::Step1(), this method computes all trajectory parameters $ {\cal M}_{i}(t) $ of the entire trajectory, which finally is represented by TypeIIRMLPosition::Polynomials. Depending on whether the motion is phase-synchronized, we have to distinguish between two cases (cf. TypeIIRMLPosition::CurrentTrajectoryIsPhaseSynchronized):

  • Time-synchronization. In this case and depending on how many threads are available (cf. TypeIIRMLPosition::NumberOfOwnThreads), parts of this method may be executed in a concurrent way (cf. TypeIIRMLPosition::ThreadControlInstance). The method TypeIIRMLMath::TypeIIRMLDecisionTree2() contains the actual Step 2 decision tree, which selects a Step velocity profile, solves the corresponding system of nonlinear equations, and uses the solution to set-up all trajectory parameters.
  • Phase-synchronization. The method TypeIIRMLPosition::Step2PhaseSynchronization() will be applied. This method always runs single-threaded, because it only computes the trajectory for one single degree of freedom (cf. TypeIIRMLPosition::GreatestDOFForPhaseSynchronization), and all other selected degrees of freedom are linearly dependent on this reference one.

    A brief overview about the interrelations among the different steps and decision trees can be found in section The Position-based Type II On-Line Trajectory Generation Algorithm.
See also:
TypeIIRMLPosition::Step1()
TypeIIRMLPosition::Step3()
TypeIIRMLPosition::SynchronizationTime
TypeIIRMLPosition::CurrentTrajectoryIsPhaseSynchronized
The Position-based Type II On-Line Trajectory Generation Algorithm
Synchronization Behavior
void TypeIIRMLPosition::Step2PhaseSynchronization ( void  ) [protected]

Executes Step 2 for phase-synchronized motion trajectories.

This function executes the actual Step 2 for all selected degrees of freedom. For the degree of freedom with the index $ \kappa $ (TypeIIRMLPosition::GreatestDOFForPhaseSynchronization), all trajectory parameters $ _{\kappa}{\cal M}_{i}(t) $ are calculated. The trajectory parameters for all other degrees of freedom $ \left\{1,\,\dots,\,K\right\}\backslash\left\{\kappa\right\} $ are calculated using the reference vector $ \vec{\varrho}_i $ TypeIIRMLPosition::PhaseSynchronizationReferenceVector.

In order to compensate numerical inaccuracies, the resulting polynomials for the degrees of freedom $ \left\{1,\,\dots,\,K\right\}\backslash\left\{\kappa\right\} $ are adapted. Therefore, a first-order polynomial is added to the polynomials represented by TypeIIRMLPosition::Polynomials.

See also:
TypeIIRMLPosition::Step2()
TypeIIRMLPosition::Step1()
Synchronization Behavior
int TypeIIRMLPosition::Step3 ( const double &  TimeValueInSeconds,
RMLPositionOutputParameters OP 
) const [protected]

Step 3 of the On-Line Trajectory Generation algorithm: calculate output values.

After all parameters $ {\cal M}_{i}(t) $ (cf. TypeIIRMLPosition::Polynomials) of the synchronized trajectory have been calculated in the second step by TypeIIRMLPosition::Step2(), this method computes the actual output values, that is, the desired state of motion $ {\bf M}_{i+1} $ at intstant $ T_{i+1} $ (cf. TypeIIRMLPosition::OutputParameters) and the return value TypeIIRMLPosition::ReturnValue, which is an element of the enumeration ReflexxesAPI::RMLResultValue.

A brief overview about the interrelations among the different steps and decision trees can be found in section The Position-based Type II On-Line Trajectory Generation Algorithm.

Parameters:
TimeValueInSecondsTime value in seconds, at which the next state of motion is calculated.
OPPointer to an object of the class RMLPositionOutputParameters. All output values will be written into this data structure.
Returns:
The return value for the method TypeIIRMLPosition::GetNextStateOfMotion()
See also:
TypeIIRMLPosition::Step1()
TypeIIRMLPosition::Step2()
TypeIIRMLPosition::OutputParameters
TypeIIRMLPosition::ReturnValue
RMLPositionFlags
The Position-based Type II On-Line Trajectory Generation Algorithm

Member Data Documentation

An array of possible synchronization times in seconds. It contains all values of $ \vec{t}_i^{\,min} $, $ \vec{t}_i^{\,begin} $, and $ \vec{t}_i^{\,end} $. The array contains $ 3\,\cdot\,K $ elements.

See also:
TypeIIRMLMath::Quicksort()
TypeIIRMLPosition::Step1()

Vector that contains the beginnings of inoperative time intervals in seconds, $ \vec{t}_i^{\,begin} $.

See also:
TypeIIRMLPosition::Step1()
TypeIIRMLPosition::EndingsOfInoperativeTimeIntervals

Indicates, whether the positional extremes are to be calculated.

See also:
CalculatePositionalExtrems()

Pointer to an RMLPositionInputParameters object. This object contains a complete set of input values $ {\bf W}_i $.

See also:
TypeIIRMLPosition::GetNextStateOfMotion()
Description of Input Values

Indicates that no synchronization is required for the current set of input values, that is, the input flag RMLFlags::NO_SYNCHRONIZATION is set.

See also:
RMLFlags::NO_SYNCHRONIZATION
double TypeIIRMLPosition::CycleTime [protected]

Contains the cycle time in seconds.

See also:
TypeIIRMLPosition::TypeIIRMLPosition()

Vector that contains the endings of inoperative time intervals in seconds, $ \vec{t}_i^{\,end} $.

See also:
TypeIIRMLPosition::Step1()
TypeIIRMLPosition::BeginningsOfInoperativeTimeIntervals

Contains the index of the degree of freedom that was used to compute the reference vector for phase-synchronization, $ \vec{\varrho}_i $.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

In order to prevent from recalculating the trajectory within every control cycle and to safe CPU time, this time value in seconds represents the elapsed time since the last calculation.

See also:
TypeIIRMLPosition::GetNextStateOfMotion()

Vector that contains the minimum execution times in seconds, $ \vec{t}_i^{\,min} $.

See also:
TypeIIRMLPosition::Step1()

Boolean vector, which contains the modified selection vector that is based on the original selection vector $ \vec{S}_i $.

See also:
TypeIIRMLPosition::SetupModifiedSelectionVector()
RMLPositionInputParameters::SelectionVector
TypeIIRMLPosition::GetNextStateOfMotion()
TypeIIRMLPosition::Step1()

Contains the ID of the profile that is used for phase-synchronization.

See also:
TypeIIRMLMath::Step1_Profile
Synchronization Behavior
unsigned int TypeIIRMLPosition::NumberOfDOFs [protected]

The number of degrees of freedom $ K $.

See also:
TypeIIRMLPosition::TypeIIRMLPosition()

In order to check, whether a new calculation has to be started, the input values have to be compared to the input and output values of the previous cycle. This variable is used to store the flags of last cycle.

See also:
RMLOutputParameters::ANewCalculationWasPerformed
TypeIIRMLPosition::GetNextStateOfMotion()
TypeIIRMLVelocity::OldFlags
OldInputParameters
Description of Input Values

Pointer to an RMLPositionInputParameters object. In order to check, whether a new calculation has to be started, the input values have to be compared to the input and output values of the previous cycle. This variable is used to store the old input values.

See also:
RMLOutputParameters::ANewCalculationWasPerformed
TypeIIRMLPosition::GetNextStateOfMotion()
TypeIIRMLVelocity::OldInputParameters
OldFlags
Description of Input Values

Pointer to an RMLPositionOutputParameters object. This object contains the output parameters of the method TypeIIRMLPosition::GetNextStateOfMotion(). Besides the new desired state of motion $ {\bf M}_{i+1} $, further complementary values for positional extremes are provided.

See also:
RMLPositionOutputParameters
TypeIIRMLPosition::GetNextStateOfMotion()
Description of Output Values

Candidate for a reference vector $ \vec{\varrho}_i $ used for phase-synchronized motion trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Current position vector $ \vec{P}_i $ used for the calculation of phase-synchronized motion trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Current velocity vector $ \vec{V}_i $ used for the calculation of phase-synchronized motion trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Value indicating, which of input vectors was used to compute the reference vector for phase-synchronization TypeIIRMLPosition::PhaseSynchronizationReferenceVector ( $ \vec{\varrho}_i $)

See also:
DominatValueForPhaseSync
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Contains the adapted maximum acceleration vector $ \left.\vec{A}_i^{\,max}\right.' $ for phase-synchronized trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Contains the adapted maximum velocity vector $ \left.\vec{V}_i^{\,max}\right.' $ for phase-synchronized trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Position difference vector $ \left( \vec{P}_i^{\,trgt}\,-\,\vec{P}_i \right) $ used for the calculation of phase-synchronized motion trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Reference vector for phase-synchronized trajectories, $ \vec{\varrho}_i $ with $ _{\kappa}\varrho_i\,=\,1 $.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Target position vector $ \vec{P}_i^{\,trgt} $ used for the calculation of phase-synchronized motion trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Target velocity vector $ \vec{V}_i^{\,trgt} $ used for the calculation of phase-synchronized motion trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

A vector of execution time values in seconds for all selected degrees of freedom used for phase-synchronized motion trajectories.

See also:
TypeIIRMLPosition::IsPhaseSynchronizationPossible()
Synchronization Behavior

Pointer to an MotionPolynomials object, which contains the actual trajectory $ {\cal M}_i $. It is a two-dimensional array of polynomial functions.

See also:
TypeIIRMLMath::TypeIIRMLPolynomial
TypeIIRMLMath::MotionPolynomials
TypeIIRMLPosition::Step2()
TypeIIRMLPosition::Step3()

Stores the original target position vector $ \vec{P}_i^{\,trgt} $.

In order to prevent from numerical inaccuracies, the algorithm internally transforms the current position vector $ \vec{P}_i $ and the target position vector $ \vec{P}_i^{\,trgt} $ to a difference vector. This vector of double values stores the original target position vector for the inverse transformation before the output values are returned to the user application.

See also:
TypeIIRMLPosition::GetNextStateOfMotion()

If the trajectory is time- or phase-synchronized, this attribute will contain the synchronization time $ t_i^{\,sync} $. Otherwise,is used for the execution time of the degree of freedom that requires the greatest time.

See also:
TypeIIRMLPosition::Step1()

Vector that contains the profiles that are used by Step 1A to calculate $ \vec{t}_i^{\,min} $.

See also:
TypeIIRMLPosition::Step1()
TypeIIRMLMath::TypeIIRMLDecisionTree1A()

A vector with $ K $ double elements, all of which are zero.


The documentation for this class was generated from the following files:
User documentation of the Reflexxes Motion Libraries by Reflexxes GmbH (Company Information, Impressum). This document was generated with Doxygen on Mon Jul 7 2014 13:21:09. Copyright 2010–2014.