TypeIIRMLStep1IntermediateProfiles.cpp
Go to the documentation of this file.
1 // ---------------------- Doxygen info ----------------------
39 // ----------------------------------------------------------
40 // For a convenient reading of this file's source code,
41 // please use a tab width of four characters.
42 // ----------------------------------------------------------
43 
44 
45 
47 
48 
49 using namespace TypeIIRMLMath;
50 
51 
52 //****************************************************************************
53 // NegateStep1()
54 
55 void TypeIIRMLMath::NegateStep1( double *ThisCurrentPosition
56  , double *ThisCurrentVelocity
57  , double *ThisTargetPosition
58  , double *ThisTargetVelocity)
59 {
60  *ThisCurrentPosition = -(*ThisCurrentPosition ) ;
61  *ThisCurrentVelocity = -(*ThisCurrentVelocity ) ;
62  *ThisTargetPosition = -(*ThisTargetPosition ) ;
63  *ThisTargetVelocity = -(*ThisTargetVelocity ) ;
64 
65  return;
66 }
67 
68 
69 //****************************************************************************
70 // VToVMaxStep1()
71 
72 void TypeIIRMLMath::VToVMaxStep1( double *TotalTime
73  , double *ThisCurrentPosition
74  , double *ThisCurrentVelocity
75  , const double &MaxVelocity
76  , const double &MaxAcceleration)
77 {
78  double TimeForCurrentStep = (*ThisCurrentVelocity - MaxVelocity)
79  / MaxAcceleration;
80 
81  *TotalTime += TimeForCurrentStep;
82  *ThisCurrentPosition += 0.5 * (*ThisCurrentVelocity + MaxVelocity)
83  * TimeForCurrentStep;
84  *ThisCurrentVelocity = MaxVelocity;
85 
86  return;
87 }
88 
89 
90 //****************************************************************************
91 // VToZeroStep1()
92 
93 void TypeIIRMLMath::VToZeroStep1( double *TotalTime
94  , double *ThisCurrentPosition
95  , double *ThisCurrentVelocity
96  , const double &MaxAcceleration)
97 {
98  double TimeForCurrentStep = *ThisCurrentVelocity / MaxAcceleration;
99 
100  *TotalTime += TimeForCurrentStep;
101  *ThisCurrentPosition += 0.5 * (*ThisCurrentVelocity) * TimeForCurrentStep;
102  *ThisCurrentVelocity = 0.0;
103 
104  return;
105 }
Header file for intermediate profile segments of Step 1.
void VToVMaxStep1(double *TotalTime, double *ThisCurrentPosition, double *ThisCurrentVelocity, const double &MaxVelocity, const double &MaxAcceleration)
One intermediate Step 1 trajectory segment: v -> +vmax (NegLin)
void NegateStep1(double *ThisCurrentPosition, double *ThisCurrentVelocity, double *ThisTargetPosition, double *ThisTargetVelocity)
Negate input values during Step 1.
void VToZeroStep1(double *TotalTime, double *ThisCurrentPosition, double *ThisCurrentVelocity, const double &MaxAcceleration)
One intermediate Step 1 trajectory segment: v -> 0 (NegLin)


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