68 double AnalizedPosition = 0.0
69 , TimeOfZeroVelocity1 = 0.0
70 , TimeOfZeroVelocity2 = 0.0
71 , TimeValueAtExtremumPosition = 0.0;
73 for (i = 0; i < this->NumberOfDOFs; i++)
75 if ((this->ModifiedSelectionVector->VecData)[i])
84 for (j = 0; j < ((this->Polynomials)[i].ValidPolynomials - 1); j++)
86 if ((this->Polynomials)[i].PolynomialTimes[j] > TimeValueInSeconds)
89 ? ((this->Polynomials)[i].VelocityPolynomial[j].CalculateValue(0.0))
90 : ((this->Polynomials)[i].VelocityPolynomial[j].CalculateValue(
91 (this->Polynomials)[i].PolynomialTimes[j - 1])))
93 Sign( (this->Polynomials)[i].VelocityPolynomial[j].CalculateValue(
94 (this->Polynomials)[i].PolynomialTimes[j])) )
96 (this->Polynomials)[i].VelocityPolynomial[j].CalculateRealRoots( &NumberOfRoots
97 , &TimeOfZeroVelocity1
98 , &TimeOfZeroVelocity2);
99 if ((NumberOfRoots == 1) && (TimeOfZeroVelocity1 > TimeValueInSeconds))
101 AnalizedPosition = (this->Polynomials)[i].PositionPolynomial[j].CalculateValue(TimeOfZeroVelocity1);
102 TimeValueAtExtremumPosition = TimeOfZeroVelocity1;
110 && (TimeValueAtExtremumPosition > TimeValueInSeconds) )
117 && (TimeValueAtExtremumPosition > TimeValueInSeconds) )
127 if ((this->Polynomials)[i].PolynomialTimes[(this->Polynomials)[i].ValidPolynomials - 2]
128 > TimeValueInSeconds)
130 if ( ((this->CurrentInputParameters->TargetPositionVector->VecData)[i]
136 (this->Polynomials)[i].PolynomialTimes[(this->Polynomials)[i].ValidPolynomials - 2]))
140 if (this->CurrentTrajectoryIsNotSynchronized)
150 if ( ((this->CurrentInputParameters->TargetPositionVector->VecData)[i]
156 (this->Polynomials)[i].PolynomialTimes[(this->Polynomials)[i].ValidPolynomials - 2]))
160 if (this->CurrentTrajectoryIsNotSynchronized)
172 for (k = 0; k < this->NumberOfDOFs; k++)
174 if ((this->ModifiedSelectionVector->VecData)[k])
178 if ( (this->Polynomials)[k].PolynomialTimes[l]
187 = (this->Polynomials)[k].PositionPolynomial[l].CalculateValue(
190 = (this->Polynomials)[k].VelocityPolynomial[l].CalculateValue(
193 = (this->Polynomials)[k].AccelerationPolynomial[l].CalculateValue(
197 = (this->CurrentInputParameters->TargetPositionVector->VecData)[k]
198 - ((this->StoredTargetPosition->VecData)[k]
203 if ( (this->Polynomials)[k].PolynomialTimes[l]
212 = (this->Polynomials)[k].PositionPolynomial[l].CalculateValue(
215 = (this->Polynomials)[k].VelocityPolynomial[l].CalculateValue(
218 = (this->Polynomials)[k].AccelerationPolynomial[l].CalculateValue(
224 = (this->CurrentInputParameters->TargetPositionVector->VecData)[k]
225 - ((this->StoredTargetPosition->VecData)[k]
231 = (this->CurrentInputParameters->CurrentPositionVector->VecData)[k];
233 = (this->CurrentInputParameters->CurrentVelocityVector->VecData)[k];
235 = (this->CurrentInputParameters->CurrentAccelerationVector->VecData)[k];
238 = (this->CurrentInputParameters->CurrentPositionVector->VecData)[k];
240 = (this->CurrentInputParameters->CurrentVelocityVector->VecData)[k];
242 = (this->CurrentInputParameters->CurrentAccelerationVector->VecData)[k];
267 for (k = 0; k < this->NumberOfDOFs; k++)
270 = (this->CurrentInputParameters->CurrentPositionVector->VecData)[k];
272 = (this->CurrentInputParameters->CurrentVelocityVector->VecData)[k];
274 = (this->CurrentInputParameters->CurrentAccelerationVector->VecData)[k];
277 = (this->CurrentInputParameters->CurrentPositionVector->VecData)[k];
279 = (this->CurrentInputParameters->CurrentVelocityVector->VecData)[k];
281 = (this->CurrentInputParameters->CurrentAccelerationVector->VecData)[k];
298 for (i = 0; i < this->NumberOfDOFs; i++)
300 for (k = 0; k < this->NumberOfDOFs; k++)
Header file for the class RMLPositionOutputParameters.
void CalculatePositionalExtrems(const double &TimeValueInSeconds, RMLPositionOutputParameters *OP) const
Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLPosition::Outp...
#define MAXIMAL_NO_OF_POLYNOMIALS
The maximum number of polynomials.
RMLDoubleVector ** MaxPosExtremaAccelerationVectorArray
A pointer to an array of pointers to RMLDoubleVector objects. The number of array elements equals the...
T * VecData
Pointer to the actual vector data, that is, an array of type T objects.
RMLDoubleVector * NewPositionVector
A pointer to the new position vector .
RMLDoubleVector ** MaxPosExtremaVelocityVectorArray
A pointer to an array of pointers to RMLDoubleVector objects. The number of array elements equals the...
RMLDoubleVector ** MinPosExtremaVelocityVectorArray
A pointer to an array of pointers to RMLDoubleVector objects. The number of array elements equals the...
Header file for functions and definitions of constant values and macros.
RMLDoubleVector * MaxExtremaTimesVector
A pointer to an RMLDoubleVector object that contains the times at which each degree of freedom reache...
Header file for the class TypeIIRMLPosition, which constitutes the actual interface of the Type II Re...
RMLDoubleVector * MinExtremaTimesVector
A pointer to an RMLDoubleVector object that contains the times at which each degree of freedom reache...
Header file for the class TypeIIRMLMath::TypeIIRMLPolynomial and the struct TypeIIRMLMath::MotionPoly...
Class for the output parameters of the position-based On-Line Trajectory Generation algorithm...
RMLDoubleVector * MinPosExtremaPositionVectorOnly
A pointer to an RMLDoubleVector object that contains the maximum positions for all degrees of freedom...
RMLDoubleVector * MaxPosExtremaPositionVectorOnly
A pointer to an RMLDoubleVector object that contains the maximum positions for all degrees of freedom...
RMLDoubleVector ** MinPosExtremaAccelerationVectorArray
A pointer to an array of pointers to RMLDoubleVector objects. The number of array elements equals the...
#define Sign(A)
Sign macro (integer)
RMLDoubleVector ** MinPosExtremaPositionVectorArray
A pointer to an array of pointers to RMLDoubleVector objects. The number of array elements equals the...
RMLDoubleVector ** MaxPosExtremaPositionVectorArray
A pointer to an array of pointers to RMLDoubleVector objects. The number of array elements equals the...
void SetPositionalExtremsToZero(RMLPositionOutputParameters *OP) const
Set all positional extremum parameters of the output values of the algorithm (TypeIIRMLPosition::Outp...