TypeIIRMLStep2WithoutSynchronization.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 
46 #include <TypeIIRMLStep1Profiles.h>
47 #include <TypeIIRMLDecisionTree2.h>
48 #include <TypeIIRMLMath.h>
49 #include <TypeIIRMLDecisions.h>
50 #include <TypeIIRMLStep2Profiles.h>
52 
53 
54 //****************************************************************************
55 // Step2WithoutSynchronization()
56 
57 void TypeIIRMLMath::Step2WithoutSynchronization( const double &CurrentPosition
58  , const double &CurrentVelocity
59  , const double &TargetPosition
60  , const double &TargetVelocity
61  , const double &MaxVelocity
62  , const double &MaxAcceleration
63  , const TypeIIRMLMath::Step1_Profile &UsedProfile
64  , const double &MinimumExecutionTime
65  , MotionPolynomials *PolynomialsInternal)
66 {
67  bool Inverted = false;
68 
69  double CurrentTime = 0.0
70  , ThisCurrentPosition = CurrentPosition
71  , ThisCurrentVelocity = CurrentVelocity
72  , ThisTargetPosition = TargetPosition
73  , ThisTargetVelocity = TargetVelocity ;
74 
75  if (!Decision_2___001(ThisCurrentVelocity))
76  {
77  NegateStep2( &ThisCurrentPosition
78  , &ThisCurrentVelocity
79  , &ThisTargetPosition
80  , &ThisTargetVelocity
81  , &Inverted );
82  }
83 
84  if (!Decision_2___002( ThisCurrentVelocity
85  , MaxVelocity ))
86  {
87  VToVMaxStep2( &CurrentTime
88  , &ThisCurrentPosition
89  , &ThisCurrentVelocity
90  , MaxVelocity
91  , MaxAcceleration
92  , &(*PolynomialsInternal)
93  , Inverted );
94  }
95 
96  if ( (UsedProfile == Step1_Profile_NegLinHldPosLin )
97  || (UsedProfile == Step1_Profile_NegLinPosLin )
98  || (UsedProfile == Step1_Profile_NegTrapPosLin )
99  || (UsedProfile == Step1_Profile_NegTriPosLin ) )
100  {
101  VToZeroStep2( &CurrentTime
102  , &ThisCurrentPosition
103  , &ThisCurrentVelocity
104  , MaxAcceleration
105  , &(*PolynomialsInternal)
106  , Inverted );
107 
108  NegateStep2( &ThisCurrentPosition
109  , &ThisCurrentVelocity
110  , &ThisTargetPosition
111  , &ThisTargetVelocity
112  , &Inverted );
113  }
114 
115  if ( (UsedProfile == Step1_Profile_PosLinHldNegLin )
116  || (UsedProfile == Step1_Profile_NegLinHldPosLin )
117  || (UsedProfile == Step1_Profile_PosLinNegLin )
118  || (UsedProfile == Step1_Profile_NegLinPosLin ) )
119  {
120  ProfileStep2PosLinHldNegLin( CurrentTime
121  , MinimumExecutionTime
122  , ThisCurrentPosition
123  , ThisCurrentVelocity
124  , ThisTargetPosition
125  , ThisTargetVelocity
126  , MaxAcceleration
127  , &(*PolynomialsInternal)
128  , Inverted );
129  }
130  else
131  {
132  ProfileStep2PosTrapNegLin( CurrentTime
133  , MinimumExecutionTime
134  , ThisCurrentPosition
135  , ThisCurrentVelocity
136  , ThisTargetPosition
137  , ThisTargetVelocity
138  , MaxAcceleration
139  , &(*PolynomialsInternal)
140  , Inverted );
141  }
142 
143  return;
144 }
145 
void ProfileStep2PosTrapNegLin(const double &CurrentTime, const double &SynchronizationTime, const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxAcceleration, MotionPolynomials *PolynomialsLocal, const bool &Inverted)
Parameterization of the Step 2 velocity profile PosTrapNegLin (leaf of the Step 2 decision tree) ...
void VToVMaxStep2(double *ThisCurrentTime, double *ThisCurrentPosition, double *ThisCurrentVelocity, const double &MaxVelocity, const double &MaxAcceleration, MotionPolynomials *PolynomialsLocal, const bool &Inverted)
One intermediate Step 2 trajectory segment: v -> vmax (NegLin)
Header file file for the declaration of the function TypeIIRMLMath::Step2WithoutSynchronization().
void NegateStep2(double *ThisCurrentPosition, double *ThisCurrentVelocity, double *ThisTargetPosition, double *ThisTargetVelocity, bool *Inverted)
Negate input values.
Header file for the Step 2 motion profiles.
bool Decision_2___002(const double &CurrentVelocity, const double &MaxVelocity)
Is (vi <= +vmax)?
Header file for decisions of the two decision trees of the Type II On-Line Trajectory Generation algo...
Three arrays of TypeIIRMLMath::TypeIIRMLPolynomial.
void ProfileStep2PosLinHldNegLin(const double &CurrentTime, const double &SynchronizationTime, const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxAcceleration, MotionPolynomials *PolynomialsLocal, const bool &Inverted)
Parameterization of the Step 2 velocity profile PosLinHldNegLin (leaf of the Step 2 decision tree) ...
Header file for functions and definitions of constant values and macros.
Header file for the Step 2 decision tree of the Type II On-Line Trajectory Generation algorithm (time...
bool Decision_2___001(const double &CurrentVelocity)
Is (vi >= 0)?
void VToZeroStep2(double *ThisCurrentTime, double *ThisCurrentPosition, double *ThisCurrentVelocity, const double &MaxAcceleration, MotionPolynomials *PolynomialsLocal, const bool &Inverted)
One intermediate Step 2 trajectory segment: v -> 0 (NegLin)
void Step2WithoutSynchronization(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxVelocity, const double &MaxAcceleration, const TypeIIRMLMath::Step1_Profile &UsedProfile, const double &MinimumExecutionTime, MotionPolynomials *PolynomialsInternal)
This function contains sets of trajectory parameters (i.e., all polynomial coefficients) in the case ...
Header file for intermediate profile segments of Step 2.
Header file for the Step 1 motion profiles.
Step1_Profile
Enumeration of all possible profiles of Step 1 (A, B, and C).


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