Reflexxes Motion Libraries
Manual and Documentation (Type II, Version 1.2.6)
|
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>
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 . | |
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 . | |
unsigned int | GreatestDOFForPhaseSynchronization |
Contains the index of the degree of freedom that was used to compute the reference vector for phase-synchronization, . | |
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 . 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. | |
RMLBoolVector * | ModifiedSelectionVector |
Boolean vector, which contains the modified selection vector that is based on the original selection vector . | |
RMLVector< Step1_Profile > * | UsedStep1AProfiles |
Vector that contains the profiles that are used by Step 1A to calculate . | |
RMLDoubleVector * | StoredTargetPosition |
Stores the original target position vector . | |
RMLDoubleVector * | MinimumExecutionTimes |
Vector that contains the minimum execution times in seconds, . | |
RMLDoubleVector * | BeginningsOfInoperativeTimeIntervals |
Vector that contains the beginnings of inoperative time intervals in seconds, . | |
RMLDoubleVector * | EndingsOfInoperativeTimeIntervals |
Vector that contains the endings of inoperative time intervals in seconds, . | |
RMLDoubleVector * | PhaseSynchronizationReferenceVector |
Reference vector for phase-synchronized trajectories, with . | |
RMLDoubleVector * | PhaseSynchronizationCurrentPositionVector |
Current position vector used for the calculation of phase-synchronized motion trajectories. | |
RMLDoubleVector * | PhaseSynchronizationTargetPositionVector |
Target position vector used for the calculation of phase-synchronized motion trajectories. | |
RMLDoubleVector * | PhaseSynchronizationPositionDifferenceVector |
Position difference vector used for the calculation of phase-synchronized motion trajectories. | |
RMLDoubleVector * | PhaseSynchronizationCurrentVelocityVector |
Current velocity vector used for the calculation of phase-synchronized motion trajectories. | |
RMLDoubleVector * | PhaseSynchronizationTargetVelocityVector |
Target velocity vector used for the calculation of phase-synchronized motion trajectories. | |
RMLDoubleVector * | PhaseSynchronizationMaxVelocityVector |
Contains the adapted maximum velocity vector for phase-synchronized trajectories. | |
RMLDoubleVector * | PhaseSynchronizationMaxAccelerationVector |
Contains the adapted maximum acceleration vector for phase-synchronized trajectories. | |
RMLDoubleVector * | PhaseSynchronizationTimeVector |
A vector of execution time values in seconds for all selected degrees of freedom used for phase-synchronized motion trajectories. | |
RMLDoubleVector * | PhaseSynchronizationCheckVector |
Candidate for a reference vector used for phase-synchronized motion trajectories. | |
RMLDoubleVector * | ArrayOfSortedTimes |
An array of possible synchronization times in seconds. It contains all values of , , and . The array contains elements. | |
RMLDoubleVector * | ZeroVector |
A vector with double elements, all of which are zero. | |
RMLPositionInputParameters * | OldInputParameters |
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. | |
RMLPositionInputParameters * | CurrentInputParameters |
Pointer to an RMLPositionInputParameters object. This object contains a complete set of input values . | |
RMLPositionOutputParameters * | OutputParameters |
Pointer to an RMLPositionOutputParameters object. This object contains the output parameters of the method TypeIIRMLPosition::GetNextStateOfMotion(). Besides the new desired state of motion , further complementary values for positional extremes are provided. | |
TypeIIRMLVelocity * | RMLVelocityObject |
Pointer to an TypeIIRMLVelocity object. The velocity-based On-Line Trajectory Generation algorithm is used in the second layer of the safety concept. | |
RMLVelocityInputParameters * | VelocityInputParameters |
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. | |
RMLVelocityOutputParameters * | VelocityOutputParameters |
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. | |
MotionPolynomials * | Polynomials |
Pointer to an MotionPolynomials object, which contains the actual trajectory . 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 ( ) |
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 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:
enum TypeIIRMLPosition::DominatValueForPhaseSync [protected] |
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.
enum TypeIIRMLPosition::FunctionResults [protected] |
TypeIIRMLPosition::TypeIIRMLPosition | ( | const unsigned int & | DegreesOfFreedom, |
const double & | CycleTimeInSeconds | ||
) |
Constructor of the class TypeIIRMLPosition.
The two tasks of the constructor are
DegreesOfFreedom | Specifies the number of degrees of freedom |
CycleTimeInSeconds | Specifies the cycle time in seconds |
Destructor of the class TypeIIRMLPosition.
All the heap memory that was allocated by the constructor is freed again.
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 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).
TimeValueInSeconds | Time value in seconds, at which the next state of motion is calculated. The positional extremes are calculated with respect to this value. |
OP | Pointer to an object of the class RMLPositionOutputParameters. The positional extreme values will be calculated for these data. |
false
when the method TypeIIRMLPosition::GetNextStateOfMotion() is called.void TypeIIRMLPosition::CompareInitialAndTargetStateofMotion | ( | void | ) | [protected] |
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
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.
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 for the velocity-based On-Line Trajectory Generation algorithm is either set
false
ortrue
.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.
InputValues | The current input values of the position-based On-Line Trajectory Generation algorithm. These values are casted to an RMLVelocityInputParameters as described above |
OutputValues | Pointer to an RMLVelocityOutputParameters object. The method writes the resulting output values of the velocity-based On-Line Trajectory Generation algorithm into this object. |
InputsFlags | The current input flags of the position-based On-Line Trajectory Generation algorithm. |
false
, and the alternative target velocity vector 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.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
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
For a detailed description, please refer to TypeIIRMLPosition and to the start page Start Page.
InputValues | Input 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. |
OutputValues | Output 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. |
Flags | A 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. |
The On-Line Trajectory Generation algorithm is working; the final state of motion has not been reached yet.
The desired final state of motion has been reached.
The applied input values are invalid (cf. RMLPositionInputParameters::CheckForValidity() RMLVelocityInputParameters::CheckForValidity()).
The number of degree of freedom of th input parameters, the output parameters, and the On-Line Trajectory Generation algorithm do not match.
If the input flag RMLFlags::ONLY_PHASE_SYNCHRONIZATION is set and it is not possible to calculate a physically (and mathematically) correct phase-synchronized (i.e., homothetic) trajectory, this error value will be returned. Please note: Even if this error message is returned, feasible, steady, and continuous output values will be computed in any case.
If one of the pointers to objects of the classes
is NULL, this error value will be returned.
To ensure numerical stability, the value of the minimum trajectory execution time is limited to a value of RML_MAX_EXECUTION_TIME ( seconds).
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 ( seconds).
For further information, please refer to the documentation of TypeIIRMLPosition::GetNextStateOfMotion().
TimeValueInSeconds | Time value in seconds, at which the desired state of motion is calculated. |
OutputValues | Output 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. |
The On-Line Trajectory Generation algorithm is working; the final state of motion has not been reached yet.
The desired final state of motion has been reached.
The applied input values are invalid (cf. RMLPositionInputParameters::CheckForValidity() RMLVelocityInputParameters::CheckForValidity()).
The number of degree of freedom of th input parameters, the output parameters, and the On-Line Trajectory Generation algorithm do not match.
If the input flag RMLFlags::ONLY_PHASE_SYNCHRONIZATION is set and it is not possible to calculate a physically (and mathematically) correct phase-synchronized (i.e., homothetic) trajectory, this error value will be returned. Please note: Even if this error message is returned, feasible, steady, and continuous output values will be computed in any case.
If one of the pointers to objects of the classes
is NULL, this error value will be returned.
To ensure numerical stability, the value of the minimum trajectory execution time is limited to a value of RML_MAX_EXECUTION_TIME ( seconds).
If either
was used, the value of the parameter is negative or larger than the value of RML_MAX_EXECUTION_TIME
( ).
unsigned int TypeIIRMLPosition::GetNumberOfSelectedDOFs | ( | const RMLBoolVector & | BoolVector | ) | const [protected] |
Returns the number of elements in BoolVector
that are true
.
BoolVector | An RMLBoolVector object (cf. RMLVector) |
BoolVector
that are true
bool TypeIIRMLPosition::IsPhaseSynchronizationPossible | ( | RMLDoubleVector * | ReferenceVector | ) | [protected] |
Checks, whether the motion trajectory can be phase-synchronized.
After all minimum execution times 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
are collinear to each other. If this is the case,
true
will be returned,ReferenceVector
( ) will be calculated, andIf this is not the case,
false
will be returned,ReferenceVector
remains unchangedFor all these computations, the attributes
are used. Further information about time- and phase-synchronization can be found in the section on Synchronization Behavior.
ReferenceVector | Pointer to an RMLDoubleVector object. If all mentioned conditions are fulfilled, such that the motion trajectory can be phase-synchronized, the reference vector will be written to this RMLDoubleVector object. If the motion cannot be phase-synchronized, the RMLDoubleVector object will not be changed. |
true
if phase-synchronization is possiblefalse
otherwisebool 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 , all inoperative time interval beginnings , and inoperative time interval endings are calculated be the decision trees 1A, 1B, and 1C, it has to be checked for each possible candidate for , whether it is within an inoperative time interval where all inoperative intervals are described by .
SynchronizationTimeCandidate | Possible candidate for that will be checked by this method. The value is given in seconds. |
MaximalExecutionTime | Beginning of an inoperative time interval in seconds |
AlternativeExecutionTime | Ending of an inoperative time interval in seconds |
true
if SynchronizationTimeCandidate
lies within the inoperative time intervalfalse
otherwisevoid TypeIIRMLPosition::SetPositionalExtremsToZero | ( | RMLPositionOutputParameters * | OP | ) | const [protected] |
Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLPosition::OutputParameters) to zero.
If the input flag RMLPositionFlags::EnableTheCalculationOfTheExtremumMotionStates is set to false
, this method is used to set all output values that are related to the calculation of the positional extremum values to zero in order to obtain defined output values:
If the input flag RMLPositionFlags::EnableTheCalculationOfTheExtremumMotionStates is set to true
, the method TypeIIRMLPosition::CalculatePositionalExtrems() is used to compute this part of the output values.
OP | Pointer to an object of the class RMLPositionOutputParameters. The values of this data structure will be set to zero. |
void TypeIIRMLPosition::SetupModifiedSelectionVector | ( | void | ) | [protected] |
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 consists of a velocity value of zero are removed from the selection vector , 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.
void TypeIIRMLPosition::Step1 | ( | void | ) | [protected] |
Step 1 of the On-Line Trajectory Generation algorithm: Calculate the synchronization time .
The only result of this method is a value for the synchronization time (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.
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 (cf. TypeIIRMLPosition::SynchronizationTime) was calculated by the method TypeIIRMLPosition::Step1(), this method computes all trajectory parameters 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):
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 (TypeIIRMLPosition::GreatestDOFForPhaseSynchronization), all trajectory parameters are calculated. The trajectory parameters for all other degrees of freedom are calculated using the reference vector TypeIIRMLPosition::PhaseSynchronizationReferenceVector.
In order to compensate numerical inaccuracies, the resulting polynomials for the degrees of freedom are adapted. Therefore, a first-order polynomial is added to the polynomials represented by TypeIIRMLPosition::Polynomials.
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 (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 at intstant (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.
TimeValueInSeconds | Time value in seconds, at which the next state of motion is calculated. |
OP | Pointer to an object of the class RMLPositionOutputParameters. All output values will be written into this data structure. |
RMLDoubleVector * TypeIIRMLPosition::ArrayOfSortedTimes [protected] |
An array of possible synchronization times in seconds. It contains all values of , , and . The array contains elements.
Vector that contains the beginnings of inoperative time intervals in seconds, .
bool TypeIIRMLPosition::CalculatePositionalExtremsFlag [protected] |
Indicates, whether the positional extremes are to be calculated.
Pointer to an RMLPositionInputParameters object. This object contains a complete set of input values .
bool TypeIIRMLPosition::CurrentTrajectoryIsNotSynchronized [protected] |
Indicates that no synchronization is required for the current set of input values, that is, the input flag RMLFlags::NO_SYNCHRONIZATION is set.
bool TypeIIRMLPosition::CurrentTrajectoryIsPhaseSynchronized [protected] |
Indicates, whether the current trajectory is phase-synchronized.
double TypeIIRMLPosition::CycleTime [protected] |
Contains the cycle time in seconds.
Vector that contains the endings of inoperative time intervals in seconds, .
unsigned int TypeIIRMLPosition::GreatestDOFForPhaseSynchronization [protected] |
Contains the index of the degree of freedom that was used to compute the reference vector for phase-synchronization, .
double TypeIIRMLPosition::InternalClockInSeconds [protected] |
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.
RMLDoubleVector * TypeIIRMLPosition::MinimumExecutionTimes [protected] |
Vector that contains the minimum execution times in seconds, .
RMLBoolVector * TypeIIRMLPosition::ModifiedSelectionVector [protected] |
Boolean vector, which contains the modified selection vector that is based on the original selection vector .
unsigned int TypeIIRMLPosition::MotionProfileForPhaseSynchronization [protected] |
Contains the ID of the profile that is used for phase-synchronization.
unsigned int TypeIIRMLPosition::NumberOfDOFs [protected] |
The number of degrees of freedom .
RMLPositionFlags TypeIIRMLPosition::OldFlags [protected] |
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.
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.
Pointer to an RMLPositionOutputParameters object. This object contains the output parameters of the method TypeIIRMLPosition::GetNextStateOfMotion(). Besides the new desired state of motion , further complementary values for positional extremes are provided.
Candidate for a reference vector used for phase-synchronized motion trajectories.
Current position vector used for the calculation of phase-synchronized motion trajectories.
Current velocity vector used for the calculation of phase-synchronized motion trajectories.
Value indicating, which of input vectors was used to compute the reference vector for phase-synchronization TypeIIRMLPosition::PhaseSynchronizationReferenceVector ( )
Contains the adapted maximum acceleration vector for phase-synchronized trajectories.
Contains the adapted maximum velocity vector for phase-synchronized trajectories.
Position difference vector used for the calculation of phase-synchronized motion trajectories.
Reference vector for phase-synchronized trajectories, with .
Target position vector used for the calculation of phase-synchronized motion trajectories.
Target velocity vector used for the calculation of phase-synchronized motion trajectories.
A vector of execution time values in seconds for all selected degrees of freedom used for phase-synchronized motion trajectories.
MotionPolynomials * TypeIIRMLPosition::Polynomials [protected] |
Pointer to an MotionPolynomials object, which contains the actual trajectory . It is a two-dimensional array of polynomial functions.
int TypeIIRMLPosition::ReturnValue [protected] |
Contains the return value of the method TypeIIRMLPosition::GetNextStateOfMotion()
TypeIIRMLVelocity * TypeIIRMLPosition::RMLVelocityObject [protected] |
Pointer to an TypeIIRMLVelocity object. The velocity-based On-Line Trajectory Generation algorithm is used in the second layer of the safety concept.
RMLDoubleVector * TypeIIRMLPosition::StoredTargetPosition [protected] |
Stores the original target position vector .
In order to prevent from numerical inaccuracies, the algorithm internally transforms the current position vector and the target position vector 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.
double TypeIIRMLPosition::SynchronizationTime [protected] |
If the trajectory is time- or phase-synchronized, this attribute will contain the synchronization time . Otherwise,is used for the execution time of the degree of freedom that requires the greatest time.
RMLVector< Step1_Profile > * TypeIIRMLPosition::UsedStep1AProfiles [protected] |
Vector that contains the profiles that are used by Step 1A to calculate .
RMLVelocityFlags TypeIIRMLPosition::VelocityFlags [protected] |
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.
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.
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.
RMLDoubleVector * TypeIIRMLPosition::ZeroVector [protected] |
A vector with double
elements, all of which are zero.