TypeIIRMLDecisionTree1C.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 <TypeIIRMLMath.h>
48 #include <TypeIIRMLDecisions.h>
50 #include <TypeIIRMLStep1Profiles.h>
51 
52 
53 //************************************************************************************
54 // TypeIIRMLDecisionTree1C()
55 
56 void TypeIIRMLMath::TypeIIRMLDecisionTree1C( const double &CurrentPosition
57  , const double &CurrentVelocity
58  , const double &TargetPosition
59  , const double &TargetVelocity
60  , const double &MaxVelocity
61  , const double &MaxAcceleration
62  , double *AlternativeExecutionTime)
63 {
64  double ThisCurrentPosition = CurrentPosition
65  , ThisCurrentVelocity = CurrentVelocity
66  , ThisTargetPosition = TargetPosition
67  , ThisTargetVelocity = TargetVelocity ;
68 
69  *AlternativeExecutionTime = 0.0;
70 
71  // ********************************************************************
72  if (Decision_1C__001(ThisCurrentVelocity))
73  {
74  goto MDecision_1C__002;
75  }
76  else
77  {
78  NegateStep1( &ThisCurrentPosition
79  , &ThisCurrentVelocity
80  , &ThisTargetPosition
81  , &ThisTargetVelocity );
82 
83  goto MDecision_1C__002;
84  }
85  // ********************************************************************
86 MDecision_1C__002:
87  if (Decision_1C__002( ThisCurrentVelocity
88  , MaxVelocity ))
89  {
90  goto MDecision_1C__003;
91  }
92  else
93  {
94  VToVMaxStep1( AlternativeExecutionTime
95  , &ThisCurrentPosition
96  , &ThisCurrentVelocity
97  , MaxVelocity
98  , MaxAcceleration );
99 
100  goto MDecision_1C__003;
101  }
102  // ********************************************************************
103 MDecision_1C__003:
104 
105  VToZeroStep1( AlternativeExecutionTime
106  , &ThisCurrentPosition
107  , &ThisCurrentVelocity
108  , MaxAcceleration );
109 
110  NegateStep1( &ThisCurrentPosition
111  , &ThisCurrentVelocity
112  , &ThisTargetPosition
113  , &ThisTargetVelocity );
114 
115 
116  if (Decision_1C__003( ThisCurrentPosition
117  , ThisCurrentVelocity
118  , ThisTargetPosition
119  , ThisTargetVelocity
120  , MaxVelocity
121  , MaxAcceleration ))
122  {
123  *AlternativeExecutionTime += ProfileStep1PosTriNegLin( ThisCurrentPosition
124  , ThisCurrentVelocity
125  , ThisTargetPosition
126  , ThisTargetVelocity
127  , MaxAcceleration );
128  }
129  else
130  {
131  *AlternativeExecutionTime += ProfileStep1PosTrapNegLin( ThisCurrentPosition
132  , ThisCurrentVelocity
133  , ThisTargetPosition
134  , ThisTargetVelocity
135  , MaxVelocity
136  , MaxAcceleration );
137  }
138  // ********************************************************************
139 
140  return;
141 }
bool Decision_1C__001(const double &CurrentVelocity)
Is (vi >= 0)?
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)
bool Decision_1C__002(const double &CurrentVelocity, const double &MaxVelocity)
Is (vi <= +vmax)?
double ProfileStep1PosTriNegLin(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxAcceleration)
Calculates the execution time of the PosTriNegLin velocity profile.
Header file for decisions of the two decision trees of the Type II On-Line Trajectory Generation algo...
void NegateStep1(double *ThisCurrentPosition, double *ThisCurrentVelocity, double *ThisTargetPosition, double *ThisTargetVelocity)
Negate input values during Step 1.
Header file for functions and definitions of constant values and macros.
Header file for the Step 1 decision tree 1C of the Type II On-Line Trajectory Generation algorithm...
void VToZeroStep1(double *TotalTime, double *ThisCurrentPosition, double *ThisCurrentVelocity, const double &MaxAcceleration)
One intermediate Step 1 trajectory segment: v -> 0 (NegLin)
double ProfileStep1PosTrapNegLin(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxVelocity, const double &MaxAcceleration)
Calculates the execution time of the PosTrapNegLin velocity profile.
Header file for the Step 1 motion profiles.
void TypeIIRMLDecisionTree1C(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxVelocity, const double &MaxAcceleration, double *AlternativeExecutionTime)
This function contains the decision tree 1C of the Step 1 of the Type II On-Line Trajectory Generatio...
bool Decision_1C__003(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxVelocity, const double &MaxAcceleration)
If v->vmax->0->vtrgt, is p>=ptrgt?


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