RMLVelocityOutputParameters.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 __RMLVelocityOutputParameters__
50 #define __RMLVelocityOutputParameters__
51 
52 
53 #include "RMLOutputParameters.h"
54 
55 
56 // ---------------------- Doxygen info ----------------------
72 // ----------------------------------------------------------
74 {
75 
76 public:
77 
78 // ---------------------- Doxygen info ----------------------
90 // ----------------------------------------------------------
91  RMLVelocityOutputParameters(const unsigned int DegreesOfFreedom) : RMLOutputParameters(DegreesOfFreedom)
92  {
93  this->PositionValuesAtTargetVelocity = new RMLDoubleVector (DegreesOfFreedom) ;
94 
95  memset(this->PositionValuesAtTargetVelocity->VecData , 0x0 , DegreesOfFreedom * sizeof(double)) ;
96  }
97 
98 
99 // ---------------------- Doxygen info ----------------------
111 // ----------------------------------------------------------
113  {
115 
117  }
118 
119 
120 // ---------------------- Doxygen info ----------------------
125 // ----------------------------------------------------------
127  {
128  delete this->PositionValuesAtTargetVelocity ;
129 
130  this->PositionValuesAtTargetVelocity = NULL ;
131  }
132 
133 
134 // ---------------------- Doxygen info ----------------------
142 // ----------------------------------------------------------
144  {
146 
148 
149  return(*this);
150  }
151 
152 
153 // #############################################################################
154 
155 
156 // ---------------------- Doxygen info ----------------------
171 // ----------------------------------------------------------
172  inline void GetPositionValuesAtTargetVelocity(RMLDoubleVector *OutputVector) const
173  {
174  *OutputVector = *(this->PositionValuesAtTargetVelocity);
175  }
176 
177 
178 // ---------------------- Doxygen info ----------------------
201 // ----------------------------------------------------------
202  inline void GetPositionValuesAtTargetVelocity( double *OutputVector
203  , const unsigned int &SizeInBytes) const
204  {
205  memcpy( (void*)OutputVector
207  , SizeInBytes );
208  }
209 
210 
211 // ---------------------- Doxygen info ----------------------
232 // ----------------------------------------------------------
233  inline void GetPositionValuesAtTargetVelocityElement( double *OutputValue
234  , const unsigned int &Index) const
235  {
236  if ( ( Index + 1 ) > ((unsigned int) this->PositionValuesAtTargetVelocity->GetVecDim() ) )
237  {
238  *OutputValue = 0.0;
239  }
240  else
241  {
242  *OutputValue = (*this->PositionValuesAtTargetVelocity)[Index];
243  }
244  }
245 
246 
247 // ---------------------- Doxygen info ----------------------
262 // ----------------------------------------------------------
263  inline double GetPositionValuesAtTargetVelocityElement(const unsigned int &Index) const
264  {
265  if ( ( Index + 1 ) > ((unsigned int) this->PositionValuesAtTargetVelocity->GetVecDim() ) )
266  {
267  return(0.0);
268  }
269  else
270  {
271  return( (*this->PositionValuesAtTargetVelocity)[Index] );
272  }
273  }
274 
275 
276 // ---------------------- Doxygen info ----------------------
284 // ----------------------------------------------------------
285  void Echo(FILE* FileHandler = stdout) const
286  {
287  unsigned int i = 0;
288 
289  if (FileHandler == NULL)
290  {
291  return;
292  }
293 
294  RMLOutputParameters::Echo(FileHandler);
295 
296  fprintf(FileHandler, "Position vector at trgt. vel. : ");
297  for (i = 0; i < this->NumberOfDOFs; i++)
298  {
299  fprintf(FileHandler, " %.20le ", this->PositionValuesAtTargetVelocity->VecData[i]);
300  }
301  fprintf(FileHandler, "\n");
302 
303  return;
304  }
305 
306 
307 // ---------------------- Doxygen info ----------------------
321 // ----------------------------------------------------------
323 
324 
325 };// class RMLVelocityOutputParameters
326 
327 
328 
329 #endif
330 
331 
RMLVector< double > RMLDoubleVector
Type definition for vectors of double elements.
Definition: RMLVector.h:548
~RMLVelocityOutputParameters(void)
Destructor of class RMLVelocityOutputParameters.
RMLVelocityOutputParameters(const unsigned int DegreesOfFreedom)
Constructor of class RMLVelocityOutputParameters.
T * VecData
Pointer to the actual vector data, that is, an array of type T objects.
Definition: RMLVector.h:524
Header file for the class RMLOutputParameters.
unsigned int NumberOfDOFs
The number of degrees of freedom .
void Echo(FILE *FileHandler=stdout) const
Prints the new state of motion of the output parameters to *FileHandler.
RMLVelocityOutputParameters(const RMLVelocityOutputParameters &OP)
Copy constructor of class RMLVelocityOutputParameters.
double GetPositionValuesAtTargetVelocityElement(const unsigned int &Index) const
Returns one single element of the position values for each degree of freedom, at which the desired ta...
Class for the output parameters of the velocity-based On-Line Trajectory Generation algorithm...
void Echo(FILE *FileHandler=stdout) const
Prints the new state of motion of the output parameters to *FileHandler.
void GetPositionValuesAtTargetVelocity(double *OutputVector, const unsigned int &SizeInBytes) const
Copies the array of double values representing the position values for each degree of freedom...
RMLVelocityOutputParameters & operator=(const RMLVelocityOutputParameters &OP)
Copy operator.
void GetPositionValuesAtTargetVelocity(RMLDoubleVector *OutputVector) const
Copies the contents of the RMLDoubleVector object containing the position values for each degree of f...
RMLDoubleVector * PositionValuesAtTargetVelocity
A pointer to an RMLDoubleVector object that contains the position values at the instants the desired ...
RMLOutputParameters & operator=(const RMLOutputParameters &OP)
Copy operator.
unsigned int GetVecDim(void) const
Returns the dimension of the vector.
Definition: RMLVector.h:497
Class for the output parameters of the On-Line Trajectory Generation algorithm.
void GetPositionValuesAtTargetVelocityElement(double *OutputValue, const unsigned int &Index) const
Copies one element of the position values for each degree of freedom, at which the desired target vel...
This is a minimalistic dynamic vector class implementation used for the Reflexxes Motion Libraries...
Definition: RMLVector.h:77


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