TypeIIRMLPosition.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 <TypeIIRMLStep1Profiles.h>
46 #include <TypeIIRMLMath.h>
49 #include <RMLVector.h>
50 #include <ReflexxesAPI.h>
51 #include <RMLPositionFlags.h>
52 
53 using namespace TypeIIRMLMath;
54 
55 
56 //****************************************************************************
57 // TypeIIRMLPosition()
58 
59 TypeIIRMLPosition::TypeIIRMLPosition( const unsigned int &DegreesOfFreedom
60  , const double &CycleTimeInSeconds)
61 {
62  this->CurrentTrajectoryIsPhaseSynchronized = false ;
63  this->CurrentTrajectoryIsNotSynchronized = false ;
64  this->CalculatePositionalExtremsFlag = false ;
65 
66  this->ReturnValue = ReflexxesAPI::RML_ERROR ;
67 
68  this->NumberOfDOFs = DegreesOfFreedom ;
69  this->GreatestDOFForPhaseSynchronization = 0 ;
70  this->MotionProfileForPhaseSynchronization = TypeIIRMLMath::Step1_Undefined ;
71 
72  this->CycleTime = CycleTimeInSeconds ;
73  this->SynchronizationTime = 0.0 ;
74  this->InternalClockInSeconds = 0.0 ;
75 
76  this->PhaseSynchronizationMagnitude = TypeIIRMLPosition::UNDEFINED ;
77 
78  this->ModifiedSelectionVector = new RMLBoolVector (this->NumberOfDOFs);
79 
80  this->UsedStep1AProfiles = new RMLVector<Step1_Profile> (this->NumberOfDOFs);
81 
82  this->StoredTargetPosition = new RMLDoubleVector (this->NumberOfDOFs);
83  this->MinimumExecutionTimes = new RMLDoubleVector (this->NumberOfDOFs);
84  this->BeginningsOfInoperativeTimeIntervals = new RMLDoubleVector (this->NumberOfDOFs);
85  this->EndingsOfInoperativeTimeIntervals = new RMLDoubleVector (this->NumberOfDOFs);
86  this->PhaseSynchronizationReferenceVector = new RMLDoubleVector (this->NumberOfDOFs);
87  this->PhaseSynchronizationCurrentPositionVector = new RMLDoubleVector (this->NumberOfDOFs);
88  this->PhaseSynchronizationTargetPositionVector = new RMLDoubleVector (this->NumberOfDOFs);
89  this->PhaseSynchronizationPositionDifferenceVector = new RMLDoubleVector (this->NumberOfDOFs);
90  this->PhaseSynchronizationCurrentVelocityVector = new RMLDoubleVector (this->NumberOfDOFs);
91  this->PhaseSynchronizationTargetVelocityVector = new RMLDoubleVector (this->NumberOfDOFs);
92  this->PhaseSynchronizationMaxVelocityVector = new RMLDoubleVector (this->NumberOfDOFs);
93  this->PhaseSynchronizationMaxAccelerationVector = new RMLDoubleVector (this->NumberOfDOFs);
94  this->PhaseSynchronizationTimeVector = new RMLDoubleVector (this->NumberOfDOFs);
95  this->PhaseSynchronizationCheckVector = new RMLDoubleVector (this->NumberOfDOFs);
96 
97  this->ArrayOfSortedTimes = new RMLDoubleVector (2 * this->NumberOfDOFs);
98  this->ZeroVector = new RMLDoubleVector (this->NumberOfDOFs);
99 
100  this->OldInputParameters = new RMLPositionInputParameters (this->NumberOfDOFs);
101  this->CurrentInputParameters = new RMLPositionInputParameters (this->NumberOfDOFs);
102 
103  this->OutputParameters = new RMLPositionOutputParameters (this->NumberOfDOFs);
104 
105  this->VelocityInputParameters = new RMLVelocityInputParameters (this->NumberOfDOFs);
106 
107  this->VelocityOutputParameters = new RMLVelocityOutputParameters (this->NumberOfDOFs);
108 
109  this->RMLVelocityObject = new TypeIIRMLVelocity( this->NumberOfDOFs
110  , this->CycleTime ) ;
111 
112  this->Polynomials = new MotionPolynomials [this->NumberOfDOFs];
113 
114  this->ZeroVector->Set(0.0);
115 }
116 
117 
118 //****************************************************************************
119 // ~TypeIIRMLPosition()
120 
122 {
123  delete this->OldInputParameters ;
124  delete this->CurrentInputParameters ;
125  delete this->OutputParameters ;
126  delete this->RMLVelocityObject ;
127  delete this->ModifiedSelectionVector ;
128  delete this->UsedStep1AProfiles ;
129  delete this->StoredTargetPosition ;
130  delete this->MinimumExecutionTimes ;
131  delete this->BeginningsOfInoperativeTimeIntervals ;
132  delete this->EndingsOfInoperativeTimeIntervals ;
133  delete this->PhaseSynchronizationReferenceVector ;
134  delete this->PhaseSynchronizationPositionDifferenceVector ;
135  delete this->PhaseSynchronizationCurrentPositionVector ;
136  delete this->PhaseSynchronizationTargetPositionVector ;
137  delete this->PhaseSynchronizationCurrentVelocityVector ;
138  delete this->PhaseSynchronizationTargetVelocityVector ;
139  delete this->PhaseSynchronizationMaxVelocityVector ;
140  delete this->PhaseSynchronizationMaxAccelerationVector ;
141  delete this->PhaseSynchronizationTimeVector ;
142  delete this->PhaseSynchronizationCheckVector ;
143  delete this->ArrayOfSortedTimes ;
144  delete this->ZeroVector ;
145  delete this->VelocityInputParameters ;
146  delete this->VelocityOutputParameters ;
147 
148  delete[] (MotionPolynomials*)this->Polynomials ;
149 
150  this->OldInputParameters = NULL ;
151  this->CurrentInputParameters = NULL ;
152  this->OutputParameters = NULL ;
153  this->RMLVelocityObject = NULL ;
154  this->ModifiedSelectionVector = NULL ;
155  this->UsedStep1AProfiles = NULL ;
156  this->StoredTargetPosition = NULL ;
157  this->MinimumExecutionTimes = NULL ;
158  this->BeginningsOfInoperativeTimeIntervals = NULL ;
159  this->EndingsOfInoperativeTimeIntervals = NULL ;
160  this->PhaseSynchronizationReferenceVector = NULL ;
161  this->PhaseSynchronizationCurrentPositionVector = NULL ;
162  this->PhaseSynchronizationTargetPositionVector = NULL ;
163  this->PhaseSynchronizationPositionDifferenceVector = NULL ;
164  this->PhaseSynchronizationCurrentVelocityVector = NULL ;
165  this->PhaseSynchronizationTargetVelocityVector = NULL ;
166  this->PhaseSynchronizationMaxVelocityVector = NULL ;
167  this->PhaseSynchronizationMaxAccelerationVector = NULL ;
168  this->PhaseSynchronizationTimeVector = NULL ;
169  this->PhaseSynchronizationCheckVector = NULL ;
170  this->ArrayOfSortedTimes = NULL ;
171  this->ZeroVector = NULL ;
172  this->VelocityInputParameters = NULL ;
173  this->VelocityOutputParameters = NULL ;
174 
175  this->Polynomials = NULL ;
176 }
177 
178 
179 //****************************************************************************
180 // GetNextStateOfMotion()
181 
183  , RMLPositionOutputParameters *OutputValues
184  , const RMLPositionFlags &Flags)
185 {
186  bool StartANewCalculation = false;
187 
188  unsigned int i = 0;
189 
190  if ( (OutputValues == NULL)
191  || (&InputValues == NULL)
192  || (&Flags == NULL) )
193  {
194  this->ReturnValue = ReflexxesAPI::RML_ERROR_NULL_POINTER;
195  return(this->ReturnValue);
196  }
197 
198  if ( (this->NumberOfDOFs != InputValues.GetNumberOfDOFs())
199  || (this->NumberOfDOFs != OutputValues->GetNumberOfDOFs()) )
200  {
201  FallBackStrategy( InputValues
202  , this->OutputParameters
203  , Flags);
204 
205  *OutputValues = *(this->OutputParameters);
206  this->ReturnValue = ReflexxesAPI::RML_ERROR_NUMBER_OF_DOFS;
207  return(this->ReturnValue);
208  }
209 
210  *(this->CurrentInputParameters) = InputValues;
211 
212  this->CalculatePositionalExtremsFlag = Flags.EnableTheCalculationOfTheExtremumMotionStates;
213 
214  if ( (this->ReturnValue == ReflexxesAPI::RML_FINAL_STATE_REACHED)
216  {
217  StartANewCalculation = true;
218  }
219  else
220  {
221  StartANewCalculation = false;
222  }
223 
224  //StartANewCalculation = true; //! \todo Remove (this is for debuggin only)
225 
226  if (Flags != this->OldFlags)
227  {
228  StartANewCalculation = true;
229  }
230 
231  if (!StartANewCalculation)
232  {
233  if ( *(this->CurrentInputParameters->SelectionVector)
234  !=
235  *(this->OldInputParameters->SelectionVector) )
236  {
237  StartANewCalculation = true;
238  }
239  else
240  {
241  for (i = 0; i < this->NumberOfDOFs; i++)
242  {
243  if ((this->CurrentInputParameters->SelectionVector->VecData)[i])
244  {
245  if (!( IsInputEpsilonEqual(
246  (this->CurrentInputParameters->CurrentVelocityVector->VecData)[i]
247  , (this->OutputParameters->NewVelocityVector->VecData)[i])
249  (this->CurrentInputParameters->MaxAccelerationVector->VecData)[i]
250  , (this->OldInputParameters->MaxAccelerationVector->VecData)[i])
252  (this->CurrentInputParameters->MaxVelocityVector->VecData)[i]
253  , (this->OldInputParameters->MaxVelocityVector->VecData)[i])
255  (this->CurrentInputParameters->TargetVelocityVector->VecData)[i]
256  , (this->OldInputParameters->TargetVelocityVector->VecData)[i])
258  ((this->CurrentInputParameters->TargetPositionVector->VecData)[i]
259  - (this->CurrentInputParameters->CurrentPositionVector->VecData)[i])
260  , ((this->OldInputParameters->TargetPositionVector->VecData)[i]
261  - (this->OutputParameters->NewPositionVector->VecData)[i]))))
262  {
263  StartANewCalculation = true;
264  break;
265  }
266  }
267  }
268  }
269  }
270 
271  if ( (StartANewCalculation)
272  || ( ( this->ReturnValue != ReflexxesAPI::RML_WORKING)
273  && ( this->ReturnValue != ReflexxesAPI::RML_FINAL_STATE_REACHED) ) )
274  {
275  this->InternalClockInSeconds = this->CycleTime;
276 
277  // if the values have changed, we have to start a
278  // trajectory computation
279  StartANewCalculation = true;
280 
281  this->SynchronizationTime = 0.0;
282 
283  for (i = 0; i < this->NumberOfDOFs; i++)
284  {
285  if ((this->CurrentInputParameters->SelectionVector->VecData)[i])
286  {
287  if ( ( fabs((this->CurrentInputParameters->TargetVelocityVector->VecData)[i])
288  >
289  (this->CurrentInputParameters->MaxVelocityVector->VecData)[i] )
290  || ((this->CurrentInputParameters->MaxVelocityVector->VecData)[i]
291  <=
292  0.0)
293  || ((this->CurrentInputParameters->MaxAccelerationVector->VecData)[i]
294  <=
295  0.0) )
296  {
297  FallBackStrategy( InputValues
298  , this->OutputParameters
299  , Flags);
300 
301  *OutputValues = *(this->OutputParameters);
303  return(this->ReturnValue);
304  }
305  }
306  }
307  }
308  else
309  {
310  StartANewCalculation = false;
311  }
312 
313  // From here on, we know whether a new calculation has to be performed or not
314 
315  *(this->OldInputParameters) = InputValues ;
316  this->OldFlags = Flags ;
317 
318  if (StartANewCalculation)
319  {
320  *(this->StoredTargetPosition) = *(this->CurrentInputParameters->TargetPositionVector);
321 
322  this->CompareInitialAndTargetStateofMotion();
323 
324  this->CurrentTrajectoryIsPhaseSynchronized = (( Flags.SynchronizationBehavior == RMLFlags::ONLY_PHASE_SYNCHRONIZATION )
326 
327  this->CurrentTrajectoryIsNotSynchronized = ( Flags.SynchronizationBehavior == RMLFlags::NO_SYNCHRONIZATION );
328 
329  // Within the call of the next method, the selection vector
330  // (TypeIIRMLPosition::CurrentInputParameters->SelectionVector)
331  // becomes modified to (TypeIIRMLPosition::ModifiedSelectionVector),
332  // which only contains the DOFs, for which a trajectory has to be
333  // calculated. In particular, this is important for the case of
334  // phase-synchronization: If a DOF has already reached its target
335  // state of motion AND if its target velocity is zero, it will not
336  // be considered for further calculations.
337 
338  Step1();
339 
341  && (!(this->CurrentTrajectoryIsPhaseSynchronized)) )
342  {
343  FallBackStrategy( InputValues
344  , this->OutputParameters
345  , Flags);
346 
347  *OutputValues = *(this->OutputParameters);
348  if (InputValues.CheckForValidity())
349  {
351  }
352  else
353  {
355  }
356  return(this->ReturnValue);
357  }
358 
359  if ( this->SynchronizationTime > RML_MAX_EXECUTION_TIME)
360  {
361  FallBackStrategy( InputValues
362  , this->OutputParameters
363  , Flags);
364 
365  *OutputValues = *(this->OutputParameters);
366  if (InputValues.CheckForValidity())
367  {
369  }
370  else
371  {
373  }
374  return(this->ReturnValue);
375  }
376 
377  for (i = 0; i < this->NumberOfDOFs; i++)
378  {
379  (this->Polynomials)[i].ValidPolynomials = 0;
380  }
381 
383  && (InputValues.MinimumSynchronizationTime > this->SynchronizationTime ))
384  {
385  for (i = 0; i < 2 * this->NumberOfDOFs; i++)
386  {
387  if ((this->ArrayOfSortedTimes->VecData)[i] > InputValues.MinimumSynchronizationTime)
388  {
389  break;
390  }
391  }
392 
393  this->SynchronizationTime = InputValues.MinimumSynchronizationTime;
394 
395  //calculate the minimal time, which is not in death-zone
396  while((IsWithinAnInoperativeTimeInterval( this->SynchronizationTime
397  , *(this->BeginningsOfInoperativeTimeIntervals)
398  , *(this->EndingsOfInoperativeTimeIntervals) ) )
399  && (i < 2 * this->NumberOfDOFs) )
400  {
401  this->SynchronizationTime = (this->ArrayOfSortedTimes->VecData)[i];
402  i++;
403  }
404  }
405 
406  Step2();
407  }
408  else
409  {
410  this->InternalClockInSeconds += this->CycleTime;
411  this->SynchronizationTime -= this->CycleTime;
412 
413  if (this->SynchronizationTime < 0.0)
414  {
415  this->SynchronizationTime = 0.0;
416  }
417  }
418 
419  if (this->GetNumberOfSelectedDOFs(*(this->ModifiedSelectionVector)) == 0)
420  {
421  this->SynchronizationTime = 0.0;
423  {
424  this->CurrentTrajectoryIsPhaseSynchronized = false;
425  }
426  else
427  {
428  this->CurrentTrajectoryIsPhaseSynchronized = true;
429  }
430  }
431 
432  this->ReturnValue = Step3( this->InternalClockInSeconds
433  , this->OutputParameters );
434 
435  this->OutputParameters->ANewCalculationWasPerformed = StartANewCalculation;
436 
437  this->OutputParameters->TrajectoryIsPhaseSynchronized = this->CurrentTrajectoryIsPhaseSynchronized;
438 
439  if (this->CurrentTrajectoryIsNotSynchronized)
440  {
441  this->OutputParameters->SynchronizationTime = 0.0;
442  this->OutputParameters->DOFWithTheGreatestExecutionTime = this->GreatestDOFForPhaseSynchronization;
443 
444  for (i = 0; i < this->NumberOfDOFs; i++)
445  {
446  if (this->CurrentInputParameters->SelectionVector->VecData[i])
447  {
448  this->OutputParameters->ExecutionTimes->VecData[i] = (this->MinimumExecutionTimes->VecData)[i]
449  - this->InternalClockInSeconds
450  + this->CycleTime;
451 
452  if (this->OutputParameters->ExecutionTimes->VecData[i] < 0.0)
453  {
454  this->OutputParameters->ExecutionTimes->VecData[i] = 0.0;
455  }
456  }
457  else
458  {
459  this->OutputParameters->ExecutionTimes->VecData[i] = 0.0;
460  }
461  }
462  }
463  else
464  {
465  this->OutputParameters->SynchronizationTime = this->SynchronizationTime;
466  this->OutputParameters->DOFWithTheGreatestExecutionTime = 0;
467 
468  for (i = 0; i < this->NumberOfDOFs; i++)
469  {
470  if (this->CurrentInputParameters->SelectionVector->VecData[i])
471  {
472  this->OutputParameters->ExecutionTimes->VecData[i] = this->SynchronizationTime;
473  }
474  else
475  {
476  this->OutputParameters->ExecutionTimes->VecData[i] = 0.0;
477  }
478  }
479  }
480 
481  if (this->CalculatePositionalExtremsFlag)
482  {
483  this->CalculatePositionalExtrems( this->InternalClockInSeconds - this->CycleTime
484  , this->OutputParameters );
485  }
486  else
487  {
488  this->SetPositionalExtremsToZero(this->OutputParameters);
489  }
490 
491  for (i = 0; i < this->NumberOfDOFs; i++)
492  {
493  if ( (this->ModifiedSelectionVector->VecData)[i] )
494  {
495  (this->OutputParameters->NewPositionVector->VecData)[i]
496  = (this->CurrentInputParameters->TargetPositionVector->VecData)[i]
497  - ((this->StoredTargetPosition->VecData)[i]
498  - (this->OutputParameters->NewPositionVector->VecData)[i] );
499  }
500  }
501 
502  if ((this->ReturnValue == ReflexxesAPI::RML_FINAL_STATE_REACHED) && (StartANewCalculation))
503  {
504  this->OutputParameters->SynchronizationTime = this->MinimumExecutionTimes->VecData[this->GreatestDOFForPhaseSynchronization];
505  }
506 
507  *OutputValues = *(this->OutputParameters);
508 
509  return(this->ReturnValue);
510 }
511 
512 
513 //****************************************************************************
514 // GetNextStateOfMotionAtTime()
515 
516 int TypeIIRMLPosition::GetNextStateOfMotionAtTime( const double &TimeValueInSeconds
517  , RMLPositionOutputParameters *OutputValues ) const
518 {
519  unsigned int i = 0;
520 
521  int ReturnValue = ReflexxesAPI::RML_ERROR;
522 
523  double InternalTime = TimeValueInSeconds
524  + this->InternalClockInSeconds
525  - this->CycleTime;
526 
527  if ( ( this->ReturnValue != ReflexxesAPI::RML_WORKING )
528  && ( this->ReturnValue != ReflexxesAPI::RML_FINAL_STATE_REACHED ) )
529  {
530  return(this->ReturnValue);
531  }
532 
533  if ( ( TimeValueInSeconds < 0.0 )
534  || ( InternalTime > RML_MAX_EXECUTION_TIME ) )
535  {
537  }
538 
539  if ( OutputValues == NULL )
540  {
542  }
543 
544  if (OutputValues->NumberOfDOFs != this->NumberOfDOFs)
545  {
547  }
548 
549  OutputValues->ANewCalculationWasPerformed = false;
550 
551  ReturnValue = Step3( InternalTime
552  , OutputValues);
553 
554  OutputValues->TrajectoryIsPhaseSynchronized = this->CurrentTrajectoryIsPhaseSynchronized;
555 
556  if (this->CurrentTrajectoryIsNotSynchronized)
557  {
558  OutputValues->SynchronizationTime = 0.0;
559  OutputValues->DOFWithTheGreatestExecutionTime = this->GreatestDOFForPhaseSynchronization;
560 
561  for (i = 0; i < this->NumberOfDOFs; i++)
562  {
563  if (this->CurrentInputParameters->SelectionVector->VecData[i])
564  {
565  OutputValues->ExecutionTimes->VecData[i] = (this->MinimumExecutionTimes->VecData)[i]
566  - TimeValueInSeconds;
567 
568  if (OutputValues->ExecutionTimes->VecData[i] < 0.0)
569  {
570  OutputValues->ExecutionTimes->VecData[i] = 0.0;
571  }
572  }
573  else
574  {
575  OutputValues->ExecutionTimes->VecData[i] = 0.0;
576  }
577  }
578  }
579  else
580  {
581  OutputValues->SynchronizationTime = this->SynchronizationTime - TimeValueInSeconds;
582  OutputValues->DOFWithTheGreatestExecutionTime = 0;
583 
584  for (i = 0; i < this->NumberOfDOFs; i++)
585  {
586  if (this->CurrentInputParameters->SelectionVector->VecData[i])
587  {
588  OutputValues->ExecutionTimes->VecData[i] = this->SynchronizationTime
589  - TimeValueInSeconds;
590 
591  if (OutputValues->ExecutionTimes->VecData[i] < 0.0)
592  {
593  OutputValues->ExecutionTimes->VecData[i] = 0.0;
594  }
595  }
596  else
597  {
598  OutputValues->ExecutionTimes->VecData[i] = 0.0;
599  }
600  }
601  }
602 
603  if (this->CalculatePositionalExtremsFlag)
604  {
605  this->CalculatePositionalExtrems( InternalTime
606  , OutputValues );
607  }
608  else
609  {
610  this->SetPositionalExtremsToZero(OutputValues);
611  }
612 
613  for (i = 0; i < this->NumberOfDOFs; i++)
614  {
615  if ( (this->ModifiedSelectionVector->VecData)[i] )
616  {
617  (OutputValues->NewPositionVector->VecData)[i]
618  = (this->CurrentInputParameters->TargetPositionVector->VecData)[i]
619  - ((this->StoredTargetPosition->VecData)[i]
620  - (OutputValues->NewPositionVector->VecData)[i] );
621  }
622  }
623 
624  return(ReturnValue);
625 }
626 
627 //****************************************************************************
628 // GetNumberOfSelectedDOFs()
629 
630 unsigned int TypeIIRMLPosition::GetNumberOfSelectedDOFs(const RMLBoolVector &BoolVector) const
631 {
632  unsigned int i = 0
633  , DOFCounter = 0;
634 
635  for (i = 0; i < this->NumberOfDOFs; i++)
636  {
637  if ((BoolVector.VecData)[i])
638  {
639  DOFCounter++;
640  }
641  }
642 
643  return(DOFCounter);
644 }
645 
646 
647 //****************************************************************************
648 // CompareInitialAndTargetStateofMotion()
649 
651 {
652 
653  unsigned int i = 0;
654 
655  for (i = 0; i < this->NumberOfDOFs; i++)
656  {
657  if ((this->CurrentInputParameters->SelectionVector->VecData)[i])
658  {
659  if (!(( (this->CurrentInputParameters->CurrentPositionVector->VecData) [i]
660  == (this->CurrentInputParameters->TargetPositionVector->VecData) [i] )
661  && ( (this->CurrentInputParameters->CurrentVelocityVector->VecData) [i]
662  == (this->CurrentInputParameters->TargetVelocityVector->VecData) [i] )
663  && ( (this->CurrentInputParameters->TargetVelocityVector->VecData) [i]
664  != 0.0 )))
665  {
666  return;
667  }
668  }
669  }
670 
671  for (i = 0; i < this->NumberOfDOFs; i++)
672  {
673  if ((this->CurrentInputParameters->SelectionVector->VecData)[i])
674  {
675  if ((this->CurrentInputParameters->CurrentPositionVector->VecData)[i] != 0.0)
676  {
677  (this->CurrentInputParameters->CurrentPositionVector->VecData)[i]
678  *= 1.0
679  + FSign((this->CurrentInputParameters->CurrentVelocityVector->VecData)[i])
681  }
682  else
683  {
684  (this->CurrentInputParameters->CurrentPositionVector->VecData)[i]
685  += FSign((this->CurrentInputParameters->CurrentVelocityVector->VecData)[i])
687  }
688  }
689  }
690 
691  return;
692 }
Header file for the class RMLPositionOutputParameters.
Header file for the dynamic vector class used for the Reflexxes Motion Libraries. ...
RMLVector< double > RMLDoubleVector
Type definition for vectors of double elements.
Definition: RMLVector.h:548
Header file for the class ReflexxesAPI (API of the Reflexxes Motion Libraries)
Header file for the class RMLPositionFlags.
double SynchronizationTime
The synchronization time in seconds.
Data structure containing flags to parameterize the execution of the position-based On-Line Trajector...
The profile is undefined.
RMLDoubleVector * ExecutionTimes
A pointer to an RMLDoubleVector object that contains the execution times of all selected degrees of f...
T * VecData
Pointer to the actual vector data, that is, an array of type T objects.
Definition: RMLVector.h:524
Three arrays of TypeIIRMLMath::TypeIIRMLPolynomial.
unsigned int GetNumberOfSelectedDOFs(const RMLBoolVector &BoolVector) const
Returns the number of elements in BoolVector that are true.
unsigned int NumberOfDOFs
The number of degrees of freedom .
After the final state of motion is reached, a new trajectory will be computed, such that the desired ...
RMLDoubleVector * NewPositionVector
A pointer to the new position vector .
double MinimumSynchronizationTime
Minimum trajectory execution time in seconds specified by the user (optional input parameter) ...
Header file for functions and definitions of constant values and macros.
unsigned int GetNumberOfDOFs(void) const
Returns the number of degrees of freedom.
Header file for the class RMLPositionInputParameters.
#define RML_ADDITIONAL_ABSOLUTE_POSITION_ERROR_IN_CASE_OF_EQUALITY
If the initial state of motion exactly equals the target state of motion, a negligible position error...
unsigned int GetNumberOfDOFs(void) const
Returns the number of degrees of freedom.
int GetNextStateOfMotionAtTime(const double &TimeValueInSeconds, RMLPositionOutputParameters *OutputValues) const
Once the method of TypeIIRMLPosition::GetNextStateOfMotion() was successfully called to compute a tra...
Header file for the class TypeIIRMLPosition, which constitutes the actual interface of the Type II Re...
unsigned char SynchronizationBehavior
This value specifies the desired synchronization behavior.
Definition: RMLFlags.h:192
unsigned int DOFWithTheGreatestExecutionTime
Index of the degree of freedom that requires the greatest execution time to reach its desired target ...
No value has been assigned yet.
Class for the output parameters of the velocity-based On-Line Trajectory Generation algorithm...
Even if it is possible to calculate a phase-synchronized trajectory, only a time-synchronized traject...
Definition: RMLFlags.h:152
bool ANewCalculationWasPerformed
Indicates, whether a new computation was performed in the last cycle.
int BehaviorAfterFinalStateOfMotionIsReached
This flag defines the behavior for the time after the final state of motion was reached.
void CompareInitialAndTargetStateofMotion(void)
If the initial state of motion exactly equals the target state of motion, an adaptation is performed...
bool CheckForValidity(void) const
Checks the input parameters for validity.
Only phase-synchronized trajectories are allowed. If it is not possible calculate a phase-synchronize...
Definition: RMLFlags.h:159
TypeIIRMLPosition(const unsigned int &DegreesOfFreedom, const double &CycleTimeInSeconds)
Constructor of the class TypeIIRMLPosition.
This is the default value. If it is possible to calculate a phase-synchronized (i.e., homothetic) trajectory, the algorithm will generate it. A more detailed description of this flag can be found on the page page_PSIfPossible.
Definition: RMLFlags.h:146
#define FSign(A)
Sign macro (floating point)
No synchronization will be performed, and all selected degrees of freedom are treated independently...
Definition: RMLFlags.h:163
~TypeIIRMLPosition(void)
Destructor of the class TypeIIRMLPosition.
Header file for the Step 1 motion profiles.
#define RML_MAX_EXECUTION_TIME
Maximum value for the for the minimum trajectory execution time .
Class for the output parameters of the position-based On-Line Trajectory Generation algorithm...
bool TrajectoryIsPhaseSynchronized
Boolean flag that indicates whether the current trajectory is phase-synchronized. ...
Class for the input parameters of the position-based On-Line Trajectory Generation algorithm...
Class for the input parameters of the velocity-based On-Line Trajectory Generation algorithm...
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 Trajec...
RMLVector< bool > RMLBoolVector
Type definition for vectors of bool elements.
Definition: RMLVector.h:570
#define RML_ADDITIONAL_RELATIVE_POSITION_ERROR_IN_CASE_OF_EQUALITY
If the initial state of motion exactly equals the target state of motion, a negligible position error...
#define IsInputEpsilonEqual(A, B)
A macro that checks, whether the difference between the values &#39;A&#39; and &#39;B&#39; is less than RML_INPUT_VAL...
This class constitutes the user interface of velocity-based the Type II On-Line Trajectory Generation...
bool EnableTheCalculationOfTheExtremumMotionStates
A flag to enable or disable the calculation of the extremum states of motion of the currently calcula...
Definition: RMLFlags.h:227


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