TypeIIRMLDecisionTree1B.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 <TypeIIRMLMath.h>
47 #include <TypeIIRMLDecisions.h>
49 #include <TypeIIRMLStep1Profiles.h>
50 
51 
52 //************************************************************************************
53 // TypeIIRMLDecisionTree1B()
54 
55 void TypeIIRMLMath::TypeIIRMLDecisionTree1B( const double &CurrentPosition
56  , const double &CurrentVelocity
57  , const double &TargetPosition
58  , const double &TargetVelocity
59  , const double &MaxVelocity
60  , const double &MaxAcceleration
61  , double *MaximalExecutionTime)
62 {
63  double ThisCurrentPosition = CurrentPosition
64  , ThisCurrentVelocity = CurrentVelocity
65  , ThisTargetPosition = TargetPosition
66  , ThisTargetVelocity = TargetVelocity ;
67 
68  *MaximalExecutionTime = 0.0;
69 
70  // ********************************************************************
71  if (Decision_1B__001(ThisCurrentVelocity))
72  {
73  goto MDecision_1B__002;
74  }
75  else
76  {
77  NegateStep1( &ThisCurrentPosition
78  , &ThisCurrentVelocity
79  , &ThisTargetPosition
80  , &ThisTargetVelocity );
81 
82  goto MDecision_1B__002;
83  }
84  // ********************************************************************
85 MDecision_1B__002:
86  if (Decision_1B__002( ThisCurrentVelocity
87  , MaxVelocity ))
88  {
89  goto MDecision_1B__003;
90  }
91  else
92  {
93  VToVMaxStep1( MaximalExecutionTime
94  , &ThisCurrentPosition
95  , &ThisCurrentVelocity
96  , MaxVelocity
97  , MaxAcceleration );
98 
99  goto MDecision_1B__003;
100  }
101  // ********************************************************************
102 MDecision_1B__003:
103  if (Decision_1B__003(ThisTargetVelocity))
104  {
105  goto MDecision_1B__004;
106  }
107  else
108  {
109  *MaximalExecutionTime = RML_INFINITY;
110  goto END_OF_THIS_FUNCTION;
111  }
112  // ********************************************************************
113 MDecision_1B__004:
114  if (Decision_1B__004( ThisCurrentVelocity
115  , ThisTargetVelocity ))
116  {
117  goto MDecision_1B__005;
118  }
119  else
120  {
121  goto MDecision_1B__007;
122  }
123  // ********************************************************************
124 MDecision_1B__005:
125  if (Decision_1B__005( ThisCurrentPosition
126  , ThisCurrentVelocity
127  , ThisTargetPosition
128  , ThisTargetVelocity
129  , MaxAcceleration ))
130  {
131  goto MDecision_1B__006;
132  }
133  else
134  {
135  *MaximalExecutionTime = RML_INFINITY;
136  goto END_OF_THIS_FUNCTION;
137  }
138  // ********************************************************************
139 MDecision_1B__006:
140  if (Decision_1B__006( ThisCurrentPosition
141  , ThisCurrentVelocity
142  , ThisTargetPosition
143  , ThisTargetVelocity
144  , MaxAcceleration ))
145  {
146  *MaximalExecutionTime = RML_INFINITY;
147  goto END_OF_THIS_FUNCTION;
148  }
149  else
150  {
151  *MaximalExecutionTime += ProfileStep1NegLinPosLin( ThisCurrentPosition
152  , ThisCurrentVelocity
153  , ThisTargetPosition
154  , ThisTargetVelocity
155  , MaxAcceleration );
156  goto END_OF_THIS_FUNCTION;
157  }
158  // ********************************************************************
159 MDecision_1B__007:
160  if (Decision_1B__007( ThisCurrentPosition
161  , ThisCurrentVelocity
162  , ThisTargetPosition
163  , ThisTargetVelocity
164  , MaxAcceleration ))
165  {
166  *MaximalExecutionTime = RML_INFINITY;
167  goto END_OF_THIS_FUNCTION;
168  }
169  else
170  {
171  goto MDecision_1B__006;
172  }
173  // ********************************************************************
174 END_OF_THIS_FUNCTION:
175 
176  return;
177 }
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)
Header file for decisions of the two decision trees of the Type II On-Line Trajectory Generation algo...
bool Decision_1B__004(const double &CurrentVelocity, const double &TargetVelocity)
Is (vi <= vtrgt)?
void NegateStep1(double *ThisCurrentPosition, double *ThisCurrentVelocity, double *ThisTargetPosition, double *ThisTargetVelocity)
Negate input values during Step 1.
bool Decision_1B__001(const double &CurrentVelocity)
Is (vi >= 0)?
Header file for functions and definitions of constant values and macros.
void TypeIIRMLDecisionTree1B(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxVelocity, const double &MaxAcceleration, double *MaximalExecutionTime)
This function contains the decision tree 1B of the Step 1 of the Type II On-Line Trajectory Generatio...
#define RML_INFINITY
A value for infinity .
double ProfileStep1NegLinPosLin(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxAcceleration)
Calculates the execution time of the NegLinPosLin velocity profile.
bool Decision_1B__006(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxAcceleration)
If v->0->vtrgt, is p<=ptrgt?
bool Decision_1B__002(const double &CurrentVelocity, const double &MaxVelocity)
Is (vi <= +vmax)?
Header file for the Step 1 decision tree 1B of the Type II On-Line Trajectory Generation algorithm...
bool Decision_1B__003(const double &TargetVelocity)
Is (vtrgt >= 0)?
bool Decision_1B__005(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxAcceleration)
If v->vtrgt, is p<=ptrgt?
Header file for the Step 1 motion profiles.
bool Decision_1B__007(const double &CurrentPosition, const double &CurrentVelocity, const double &TargetPosition, const double &TargetVelocity, const double &MaxAcceleration)
If v->vtrgt, is p>=ptrgt?


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