RMLVelocityInputParameters.h
Go to the documentation of this file.
1 // ---------------------- Doxygen info ----------------------
43 // ----------------------------------------------------------
44 // For a convenient reading of this file's source code,
45 // please use a tab width of four characters.
46 // ----------------------------------------------------------
47 
48 
49 #ifndef __RMLVelocityInputParameters__
50 #define __RMLVelocityInputParameters__
51 
52 
53 #include "RMLInputParameters.h"
54 #include <math.h>
55 
56 
57 // ---------------------- Doxygen info ----------------------
76 // ----------------------------------------------------------
78 {
79 public:
80 
81 
82 // ---------------------- Doxygen info ----------------------
94 // ----------------------------------------------------------
95  RMLVelocityInputParameters(const unsigned int DegreesOfFreedom) : RMLInputParameters(DegreesOfFreedom)
96  {
97  }
98 
99 
100 // ---------------------- Doxygen info ----------------------
112 // ----------------------------------------------------------
114  {
115  }
116 
117 
118 // ---------------------- Doxygen info ----------------------
123 // ----------------------------------------------------------
125  {
126  }
127 
128 
129 // ---------------------- Doxygen info ----------------------
137 // ----------------------------------------------------------
139  {
141 
142  return(*this);
143  }
144 
145 
146 
147 // #############################################################################
148 
149 
150 // ---------------------- Doxygen info ----------------------
158 // ----------------------------------------------------------
159  bool CheckForValidity(void) const
160  {
161  unsigned int i = 0;
162 
163  double MinimumOrderOfMagnitude = 0.0
164  , MaximumOrderOfMagnitude = 0.0;
165 
166  for (i = 0; i < this->NumberOfDOFs; i++)
167  {
168  if ((this->SelectionVector->VecData)[i])
169  {
170  if ( ((this->MaxAccelerationVector->VecData)[i] >= (this->MaxJerkVector->VecData) [i] )
171  && ((this->MaxAccelerationVector->VecData)[i] >= fabs((this->TargetVelocityVector->VecData) [i]))
172  && ((this->MaxAccelerationVector->VecData)[i] >= fabs((this->CurrentPositionVector->VecData) [i]))
173  && ((this->MaxAccelerationVector->VecData)[i] >= fabs((this->CurrentVelocityVector->VecData) [i]))
174  && ((this->MaxAccelerationVector->VecData)[i] >= fabs((this->CurrentAccelerationVector->VecData) [i])))
175  {
176  MaximumOrderOfMagnitude = (this->MaxAccelerationVector->VecData)[i];
177  }
178  else
179  {
180  if ( ((this->MaxJerkVector->VecData)[i] >= fabs((this->TargetVelocityVector->VecData) [i]))
181  && ((this->MaxJerkVector->VecData)[i] >= fabs((this->CurrentPositionVector->VecData) [i]))
182  && ((this->MaxJerkVector->VecData)[i] >= fabs((this->CurrentVelocityVector->VecData) [i]))
183  && ((this->MaxJerkVector->VecData)[i] >= fabs((this->CurrentAccelerationVector->VecData) [i])))
184  {
185  MaximumOrderOfMagnitude = (this->MaxJerkVector->VecData)[i];
186  }
187  else
188  {
189  if ( (fabs((this->TargetVelocityVector->VecData)[i]) >= fabs((this->CurrentPositionVector->VecData) [i]))
190  && (fabs((this->TargetVelocityVector->VecData)[i]) >= fabs((this->CurrentVelocityVector->VecData) [i]))
191  && (fabs((this->TargetVelocityVector->VecData)[i]) >= fabs((this->CurrentAccelerationVector->VecData) [i])))
192  {
193  MaximumOrderOfMagnitude = fabs((this->TargetVelocityVector->VecData)[i]);
194  }
195  else
196  {
197  if ( (fabs((this->CurrentPositionVector->VecData)[i]) >= fabs((this->CurrentVelocityVector->VecData) [i]))
198  && (fabs((this->CurrentPositionVector->VecData)[i]) >= fabs((this->CurrentAccelerationVector->VecData) [i])))
199  {
200  MaximumOrderOfMagnitude = fabs((this->CurrentPositionVector->VecData)[i]);
201  }
202  else
203  {
204  MaximumOrderOfMagnitude = fabs((this->CurrentAccelerationVector->VecData)[i]);
205  }
206  }
207  }
208  }
209 
210  if ((this->MaxAccelerationVector->VecData)[i] <= (this->MaxJerkVector->VecData)[i])
211  {
212  MinimumOrderOfMagnitude = (this->MaxAccelerationVector->VecData)[i];
213  }
214  else
215  {
216  MinimumOrderOfMagnitude = (this->MaxJerkVector->VecData)[i];
217  }
218 
219  // The value of MinimumOrderOfMagnitude is greater than
220  // zero:
221  if ( (MaximumOrderOfMagnitude / MinimumOrderOfMagnitude)
222  > (double)pow((float)10, (int)(RMLVelocityInputParameters::MAXIMUM_MAGNITUDE_RANGE)))
223  {
224  return(false);
225  }
226  }
227  }
228 
229  if (this->MinimumSynchronizationTime > 1e10)
230  {
231  return(false);
232  }
233 
234  return(true);
235  }
236 
237 
238 // ---------------------- Doxygen info ----------------------
246 // ----------------------------------------------------------
247  void Echo(FILE* FileHandler = stdout) const
248  {
249  RMLInputParameters::Echo(FileHandler);
250  return;
251  }
252 
253 protected:
254 
255 
256  enum
257  {
258 // ---------------------- Doxygen info ----------------------
262 // ----------------------------------------------------------
264  };
265 
266 
267 
268 };// class RMLVelocityInputParameters
269 
270 
271 
272 #endif
273 
274 
RMLDoubleVector * CurrentVelocityVector
A pointer to the current velocity vector .
void Echo(FILE *FileHandler=stdout) const
Prints the complete set of input parameters to *FileHandler.
unsigned int NumberOfDOFs
The number of degrees of freedom .
RMLDoubleVector * MaxAccelerationVector
A pointer to the maximum acceleration vector .
T * VecData
Pointer to the actual vector data, that is, an array of type T objects.
Definition: RMLVector.h:524
RMLVelocityInputParameters & operator=(const RMLVelocityInputParameters &IP)
Copy operator.
Specifies the maximum allowed range for the orders of magnitude of the input values.
double MinimumSynchronizationTime
Minimum trajectory execution time in seconds specified by the user (optional input parameter) ...
void Echo(FILE *FileHandler=stdout) const
Prints the complete set of input parameters to *FileHandler.
RMLBoolVector * SelectionVector
A pointer to the selection vector .
bool CheckForValidity(void) const
Checks the input parameters for validity.
RMLDoubleVector * TargetVelocityVector
A pointer to the target velocity vector .
RMLDoubleVector * MaxJerkVector
A pointer to the maximum jerk vector .
Class for the input parameters of the velocity-based On-Line Trajectory Generation algorithm...
RMLVelocityInputParameters(const unsigned int DegreesOfFreedom)
Constructor of class RMLVelocityInputParameters.
RMLDoubleVector * CurrentAccelerationVector
A pointer to the current acceleration vector .
RMLInputParameters & operator=(const RMLInputParameters &IP)
Copy operator.
Class for the input parameters of the On-Line Trajectory Generation algorithm.
RMLDoubleVector * CurrentPositionVector
A pointer to the current position vector .
Header file for the class RMLInputParameters.
~RMLVelocityInputParameters(void)
Destructor of class RMLVelocityInputParameters.
RMLVelocityInputParameters(const RMLVelocityInputParameters &IP)
Copy constructor of class RMLVelocityInputParameters.


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