This class constitutes the user interface of velocity-based the Type II On-Line Trajectory Generation algorithm More...
#include <TypeIIRMLVelocity.h>
Public Member Functions | |
int | GetNextStateOfMotion (const RMLVelocityInputParameters &InputValues, RMLVelocityOutputParameters *OutputValues, const RMLVelocityFlags &Flags) |
The main method of the class TypeIIRMLVelocity. It executes the velocity-based Type II On-Line Trajectory Generation algorithm More... | |
int | GetNextStateOfMotionAtTime (const double &TimeValueInSeconds, RMLVelocityOutputParameters *OutputValues) const |
Once the method of TypeIIRMLVelocity::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. More... | |
TypeIIRMLVelocity & | operator= (const TypeIIRMLVelocity &TypeIIRMLObject) |
Copy operator. More... | |
TypeIIRMLVelocity (const unsigned int &DegreesOfFreedom, const double &CycleTimeInSeconds) | |
Constructor of the class TypeIIRMLVelocity. More... | |
TypeIIRMLVelocity (const TypeIIRMLVelocity &TypeIIRMLObject) | |
Copy constructor of class TypeIIRMLVelocity. More... | |
~TypeIIRMLVelocity (void) | |
Destructor of the class TypeIIRMLVelocity. More... | |
Protected Types | |
enum | FunctionResults { FUNC_SUCCESS = false, FUNC_ERROR_OCCURRED = true } |
For class-internal use only: return values of boolean methods. More... | |
Protected Member Functions | |
void | CalculateExecutionTimes (void) |
Calculates the minimum execution times and corresponding motion profiles of each selected degree of freedom. More... | |
void | CalculatePositionalExtrems (const double &TimeValueInSeconds, RMLVelocityOutputParameters *OP) const |
Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLVelocity::OutputParameters) More... | |
int | ComputeAndSetOutputParameters (const double &TimeValueInSeconds, RMLVelocityOutputParameters *OP) const |
Computes the output values of the velocity-based On-line Trajectory Generation algorithm, that is, the state of motion for the next control cycle. More... | |
void | ComputePhaseSynchronizationParameters (void) |
Checks, whether phase-synchronization is possible. If possible the corresponding vectors are computed. More... | |
void | ComputeTimeSynchronizedTrajectoryParameters (void) |
Computes all trajectory parameters for time-synchronized trajectories. More... | |
void | ComputeTrajectoryParameters (void) |
Computes all trajectory parameters for non- and phase- synchronized trajectories. More... | |
void | FallBackStrategy (const RMLVelocityInputParameters &InputValues, RMLVelocityOutputParameters *OutputValues) |
In case of an error, this method triggers the next layer of the safety concept. More... | |
bool | IsPhaseSynchronizationPossible (void) |
Checks, whether the motion trajectory can be phase-synchronized. More... | |
void | SetPositionalExtremsToZero (RMLVelocityOutputParameters *OP) const |
Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLVelocity::OutputParameters) to zero. More... | |
void | SetupPhaseSyncSelectionVector (void) |
Modify the current selection vector and exclude unnecessary degrees of freedom. More... | |
Protected Attributes | |
bool | CalculatePositionalExtremsFlag |
Indicates, whether the positional extremes are to be calculated. More... | |
RMLVelocityInputParameters * | CurrentInputParameters |
Pointer to an RMLVelocityInputParameters object. This object contains a complete set of input values . More... | |
bool | CurrentTrajectoryIsNotSynchronized |
Indicates, that the current trajectory is not synchronized. More... | |
bool | CurrentTrajectoryIsPhaseSynchronized |
Indicates, whether the current trajectory is phase-synchronized. More... | |
double | CycleTime |
Contains the cycle time in seconds. More... | |
unsigned int | DOFWithGreatestExecutionTime |
Index of the degree of freedom that requires the greatest execution time. More... | |
RMLDoubleVector * | ExecutionTimes |
Vector of double values, each of which represents an execution time that is used internally. More... | |
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. More... | |
unsigned int | NumberOfDOFs |
The number of degrees of freedom . More... | |
RMLVelocityFlags | 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. More... | |
RMLVelocityInputParameters * | OldInputParameters |
Pointer to an RMLVelocityInputParameters 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. More... | |
RMLVelocityOutputParameters * | OutputParameters |
Pointer to an RMLVelocityOutputParameters object. This object contains the output parameters of the method TypeIIRMLVelocity::GetNextStateOfMotion(). Besides the new desired state of motion , further complementary values for positional extremes are provided. More... | |
RMLDoubleVector * | PhaseSynchronizationCurrentVelocityVector |
Current velocity vector used for the calculation of phase-synchronized motion trajectories. More... | |
RMLDoubleVector * | PhaseSynchronizationMaxAccelerationVector |
Contains the adapted maximum acceleration vector for phase-synchronized trajectories. More... | |
RMLDoubleVector * | PhaseSynchronizationReferenceVector |
Reference vector for phase-synchronized trajectories, with . More... | |
RMLDoubleVector * | PhaseSynchronizationTargetVelocityVector |
Target velocity vector used for the calculation of phase-synchronized motion trajectories. More... | |
RMLBoolVector * | PhaseSyncSelectionVector |
Boolean vector, which contains the modified selection vector that is based on the original selection vector in order to enable numerically robust phase-synchronization. More... | |
MotionPolynomials * | Polynomials |
Pointer to an array of MotionPolynomials objects, which contains the actual trajectory . It is a two-dimensional array of polynomial functions. More... | |
int | ReturnValue |
Contains the return value of the method TypeIIRMLVelocity::GetNextStateOfMotion() More... | |
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. More... | |
This class constitutes the user interface of velocity-based the Type II On-Line Trajectory Generation algorithm
The class has to purposes:
The algorithm is capable to generate phase-synchronized and non-synchronized motions. The only interface for the user application is the method
Definition at line 103 of file TypeIIRMLVelocity.h.
|
protected |
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. |
Definition at line 321 of file TypeIIRMLVelocity.h.
TypeIIRMLVelocity::TypeIIRMLVelocity | ( | const unsigned int & | DegreesOfFreedom, |
const double & | CycleTimeInSeconds | ||
) |
Constructor of the class TypeIIRMLVelocity.
DegreesOfFreedom | Specifies the number of degrees of freedom |
CycleTimeInSeconds | Specifies the cycle time in seconds |
Definition at line 61 of file TypeIIRMLVelocity.cpp.
TypeIIRMLVelocity::TypeIIRMLVelocity | ( | const TypeIIRMLVelocity & | TypeIIRMLObject | ) |
Copy constructor of class TypeIIRMLVelocity.
TypeIIRMLObject | Object to be copied |
Definition at line 533 of file TypeIIRMLVelocity.cpp.
TypeIIRMLVelocity::~TypeIIRMLVelocity | ( | void | ) |
Destructor of the class TypeIIRMLVelocity.
Definition at line 96 of file TypeIIRMLVelocity.cpp.
|
protected |
Calculates the minimum execution times and corresponding motion profiles of each selected degree of freedom.
This method selects an velocity profile of the set RMLMath::FinalAccelerationProfilesForVelocityCtrl and computes the minimum execution for each single degree of freedom in seconds and writes the values into the attributes
This computation step is comparable to Step 1 of the position-based On-line Trajectory Generation algorithm.
Definition at line 61 of file TypeIIRMLVelocityMethods.cpp.
|
protected |
Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLVelocity::OutputParameters)
After all trajectory parameters have been computed in TypeIIRMLVelocity::GetNextStateOfMotion(), they are stored in the attribute TypeIIRMLVelocity::Polynomials. Using this attribute, this method computes all positional extremum values and corresponding states of motion and writes the results to TypeIIRMLVelocity::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 RMLVelocityOutputParameters. The positional extreme values will be calculated for these data. |
false
when the method TypeIIRMLVelocity::GetNextStateOfMotion() is called.Definition at line 58 of file TypeIIRMLVelocityCalculatePositionalExtrems.cpp.
|
protected |
Computes the output values of the velocity-based On-line Trajectory Generation algorithm, that is, the state of motion for the next control cycle.
After either
calculated all coefficients of the polynomials that piecewise describe the desired trajectory, this method computes the actual output values of algorithm, that is, the state of motion at the instant TimeValueInSeconds
(commonly for the next control cycle). This part is the pendent of TypeIIRMLPosition::Step3() in the position-based On-line Trajectory Generation algorithm. The resulting values are written into the object pointed to by OP
(output parameters).
The methods TypeIIRMLVelocity::GetNextStateOfMotion() and TypeIIRMLVelocity::GetNextStateOfMotionAtTime() make use of this functionality.
TimeValueInSeconds | Time value in seconds, at which the desired state of motion is calculated. |
OP | Pointer to an object of the class RMLVelocityOutputParameters, to which the resulting output values will be written to. |
Definition at line 282 of file TypeIIRMLVelocityMethods.cpp.
|
protected |
Checks, whether phase-synchronization is possible. If possible the corresponding vectors are computed.
This method checks, whether a phase-synchronized trajectory can be generated. If all input vectors are collinear, it is checks, a homothetic trajectory can be computed that meets all kinematic motion constraints. If this is the case, the constraints will be adapted such that is also collinear to all other input values. This vectors is stored in the attribute
Definition at line 170 of file TypeIIRMLVelocityMethods.cpp.
|
protected |
Computes all trajectory parameters for time-synchronized trajectories.
This method computes the coefficients of all pieces of polynomials that are used to represent the trajectory. This part is comparable to Step 2 of the position-based On-Line Trajectory Generation algorithm.
|
protected |
Computes all trajectory parameters for non- and phase- synchronized trajectories.
This method computes the coefficients of all pieces of polynomials that are used to represent the trajectory. This part is comparable to Step 2 of the position-based On-Line Trajectory Generation algorithm. Based on the profile that was determined by the method TypeIIRMLVelocity::CalculateExecutionTimes() (and the change of kinematic motion constraints in case of phase-synchronized trajectories; cf. TypeIIRMLVelocity::ComputePhaseSynchronizationParameters()), the actual parameters are set-up, such that a new state of motion can be computed by calling TypeIIRMLVelocity::ComputeAndSetOutputParameters().
Definition at line 83 of file TypeIIRMLVelocityMethods.cpp.
|
protected |
In case of an error, this method triggers the next layer of the safety concept.
Depending on how the class TypeIIRMLVelocity is used, two different purposes are achieved by this method.
This method uses the current state of motion and continues the current motion with . Concretely, is calculated this way:
A detailed description of the three-layered safety mechanism of the Reflexxes Motion Libraries can be found at page_ErrorHandling.
InputValues | Current set of input parameters |
OutputValues | Current set of output parameters the will be generated by this method |
Definition at line 55 of file TypeIIRMLVelocityFallBackStrategy.cpp.
int TypeIIRMLVelocity::GetNextStateOfMotion | ( | const RMLVelocityInputParameters & | InputValues, |
RMLVelocityOutputParameters * | OutputValues, | ||
const RMLVelocityFlags & | Flags | ||
) |
The main method of the class TypeIIRMLVelocity. It executes the velocity-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 velocity-based Type II On-Line Trajectory Generation algorithm and provides a set of OutputValues
, which contain
For a detailed description, please refer to TypeIIRMLVelocity and to the start page index.
InputValues | Input values of the velocity-based Type II On-Line Trajectory Generation algorithm. For detailed information, please refer to the class RMLVelocityInputParameters and to the page page_InputValues. |
OutputValues | Output values of the velocity-based Type II On-Line Trajectory Generation algorithm. For detailed information, please refer to the class RMLVelocityOutputParameters and to the page page_OutputValues. |
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 RMLVelocityFlags. |
Definition at line 130 of file TypeIIRMLVelocity.cpp.
int TypeIIRMLVelocity::GetNextStateOfMotionAtTime | ( | const double & | TimeValueInSeconds, |
RMLVelocityOutputParameters * | OutputValues | ||
) | const |
Once the method of TypeIIRMLVelocity::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. RMLVelocityOutputParameters).
If the method TypeIIRMLVelocity::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 TypeIIRMLVelocity::GetNextStateOfMotion().
TimeValueInSeconds | Time value in seconds, at which the desired state of motion is calculated. |
OutputValues | Output values of the velocity-based Type II On-Line Trajectory Generation algorithm. For detailed information, please refer to the class RMLVelocityOutputParameters and to the page page_OutputValues. |
Definition at line 385 of file TypeIIRMLVelocity.cpp.
|
protected |
Checks, whether the motion trajectory can be phase-synchronized.
It is 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, andReferenceVector
( ) will be calculated, and copied to TypeIIRMLVelocity::PhaseSynchronizationReferenceVector.If this is not the case,
false
will be returned, andFor all these computations, the attributes
are used.
true
if phase-synchronization is possiblefalse
otherwiseDefinition at line 62 of file TypeIIRMLVelocityIsPhaseSynchronizationPossible.cpp.
TypeIIRMLVelocity & TypeIIRMLVelocity::operator= | ( | const TypeIIRMLVelocity & | TypeIIRMLObject | ) |
Copy operator.
TypeIIRMLObject | TypeIIRMLVelocity object to be copied |
Definition at line 491 of file TypeIIRMLVelocity.cpp.
|
protected |
Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLVelocity::OutputParameters) to zero.
If the input flag RMLVelocityFlags::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 RMLVelocityFlags::EnableTheCalculationOfTheExtremumMotionStates is set to true
, the method TypeIIRMLVelocity::CalculatePositionalExtrems() is used to compute this part of the output values.
OP | Pointer to an object of the class RMLVelocityOutputParameters. The values of this data structure will be set to zero. |
Definition at line 261 of file TypeIIRMLVelocityCalculatePositionalExtrems.cpp.
|
protected |
Modify the current selection vector and exclude unnecessary degrees of freedom.
This method modifies the selection vector RMLVelocityInputParameters::SelectionVector of TypeIIRMLVelocity::CurrentInputParameters to TypeIIRMLVelocity::PhaseSyncSelectionVector. Degrees of freedom , whose
are zero, can be excluded from the selection vector in order correctly determine, whether phase-synchronization is possible and to ensure numerical stability.
Definition at line 57 of file TypeIIRMLVelocitySetupPhaseSyncSelectionVector.cpp.
|
protected |
Indicates, whether the positional extremes are to be calculated.
Definition at line 728 of file TypeIIRMLVelocity.h.
|
protected |
Pointer to an RMLVelocityInputParameters object. This object contains a complete set of input values .
Definition at line 929 of file TypeIIRMLVelocity.h.
|
protected |
Indicates, that the current trajectory is not synchronized.
Definition at line 717 of file TypeIIRMLVelocity.h.
|
protected |
Indicates, whether the current trajectory is phase-synchronized.
Definition at line 704 of file TypeIIRMLVelocity.h.
|
protected |
Contains the cycle time in seconds.
Definition at line 773 of file TypeIIRMLVelocity.h.
|
protected |
Index of the degree of freedom that requires the greatest execution time.
Definition at line 762 of file TypeIIRMLVelocity.h.
|
protected |
Vector of double
values, each of which represents an execution time that is used internally.
Definition at line 844 of file TypeIIRMLVelocity.h.
|
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.
Definition at line 798 of file TypeIIRMLVelocity.h.
|
protected |
The number of degrees of freedom .
Definition at line 751 of file TypeIIRMLVelocity.h.
|
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.
Definition at line 816 of file TypeIIRMLVelocity.h.
|
protected |
Pointer to an RMLVelocityInputParameters 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.
Definition at line 916 of file TypeIIRMLVelocity.h.
|
protected |
Pointer to an RMLVelocityOutputParameters object. This object contains the output parameters of the method TypeIIRMLVelocity::GetNextStateOfMotion(). Besides the new desired state of motion , further complementary values for positional extremes are provided.
Definition at line 946 of file TypeIIRMLVelocity.h.
|
protected |
Current velocity vector used for the calculation of phase-synchronized motion trajectories.
Definition at line 870 of file TypeIIRMLVelocity.h.
|
protected |
Contains the adapted maximum acceleration vector for phase-synchronized trajectories.
Definition at line 897 of file TypeIIRMLVelocity.h.
|
protected |
Reference vector for phase-synchronized trajectories, with .
Definition at line 857 of file TypeIIRMLVelocity.h.
|
protected |
Target velocity vector used for the calculation of phase-synchronized motion trajectories.
Definition at line 883 of file TypeIIRMLVelocity.h.
|
protected |
Boolean vector, which contains the modified selection vector that is based on the original selection vector in order to enable numerically robust phase-synchronization.
Definition at line 832 of file TypeIIRMLVelocity.h.
|
protected |
Pointer to an array of MotionPolynomials objects, which contains the actual trajectory . It is a two-dimensional array of polynomial functions.
Definition at line 962 of file TypeIIRMLVelocity.h.
|
protected |
Contains the return value of the method TypeIIRMLVelocity::GetNextStateOfMotion()
Definition at line 740 of file TypeIIRMLVelocity.h.
|
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.
Definition at line 785 of file TypeIIRMLVelocity.h.