TypeIIRMLStep3.cpp
Go to the documentation of this file.
1 // ---------------------- Doxygen info ----------------------
38 // ----------------------------------------------------------
39 // For a convenient reading of this file's source code,
40 // please use a tab width of four characters.
41 // ----------------------------------------------------------
42 
43 
44 #include <TypeIIRMLPosition.h>
45 #include <TypeIIRMLMath.h>
48 #include <ReflexxesAPI.h>
49 
50 
51 //*******************************************************************************************
52 // Step3
53 
54 int TypeIIRMLPosition::Step3( const double &TimeValueInSeconds
55  , RMLPositionOutputParameters *OP ) const
56 {
57  unsigned int i = 0;
58 
59  int j = 0
60  , ReturnValueForThisMethod = ReflexxesAPI::RML_FINAL_STATE_REACHED;
61 
62  for (i = 0; i < this->NumberOfDOFs; i++)
63  {
64  if ( (this->ModifiedSelectionVector->VecData)[i] )
65  {
66  j = 0;
67 
68  while ( (TimeValueInSeconds > (this->Polynomials)[i].PolynomialTimes[j]) && (j < MAXIMAL_NO_OF_POLYNOMIALS - 1))
69  {
70  j++;
71  }
72 
73  (OP->NewPositionVector->VecData) [i]
74  = (this->Polynomials)[i].PositionPolynomial[j].CalculateValue(TimeValueInSeconds);
75  (OP->NewVelocityVector->VecData) [i]
76  = (this->Polynomials)[i].VelocityPolynomial[j].CalculateValue(TimeValueInSeconds);
78  = (this->Polynomials)[i].AccelerationPolynomial[j].CalculateValue(TimeValueInSeconds);
79 
80  if ( j < ((this->Polynomials)[i].ValidPolynomials) - 1)
81  {
82  ReturnValueForThisMethod = ReflexxesAPI::RML_WORKING;
83  }
84  }
85  else
86  {
87  (OP->NewPositionVector->VecData) [i]
89  (OP->NewVelocityVector->VecData) [i]
93  }
94  }
95 
96  return(ReturnValueForThisMethod);
97 }
Header file for the class RMLPositionOutputParameters.
Header file for the class ReflexxesAPI (API of the Reflexxes Motion Libraries)
RMLDoubleVector * NewAccelerationVector
A pointer to the new acceleration vector .
#define MAXIMAL_NO_OF_POLYNOMIALS
The maximum number of polynomials.
RMLDoubleVector * CurrentVelocityVector
A pointer to the current velocity vector .
T * VecData
Pointer to the actual vector data, that is, an array of type T objects.
Definition: RMLVector.h:524
RMLDoubleVector * NewPositionVector
A pointer to the new position vector .
Header file for functions and definitions of constant values and macros.
MotionPolynomials * Polynomials
Pointer to an MotionPolynomials object, which contains the actual trajectory . It is a two-dimensiona...
Header file for the class RMLPositionInputParameters.
RMLPositionInputParameters * CurrentInputParameters
Pointer to an RMLPositionInputParameters object. This object contains a complete set of input values ...
Header file for the class TypeIIRMLPosition, which constitutes the actual interface of the Type II Re...
RMLBoolVector * ModifiedSelectionVector
Boolean vector, which contains the modified selection vector that is based on the original selection ...
Class for the output parameters of the position-based On-Line Trajectory Generation algorithm...
int Step3(const double &TimeValueInSeconds, RMLPositionOutputParameters *OP) const
Step 3 of the On-Line Trajectory Generation algorithm: calculate output values.
RMLDoubleVector * NewVelocityVector
A pointer to the new velocity vector .
unsigned int NumberOfDOFs
The number of degrees of freedom .
RMLDoubleVector * CurrentAccelerationVector
A pointer to the current acceleration vector .
RMLDoubleVector * CurrentPositionVector
A pointer to the current position vector .


libreflexxestype2
Author(s):
autogenerated on Sat Nov 21 2020 03:17:34