Reflexxes Motion Libraries  Manual and Documentation (Type II, Version 1.2.6)
include/RMLOutputParameters.h
Go to the documentation of this file.
00001 //  ---------------------- Doxygen info ----------------------
00043 //  ----------------------------------------------------------
00044 //   For a convenient reading of this file's source code,
00045 //   please use a tab width of four characters.
00046 //  ----------------------------------------------------------
00047
00048
00049 #ifndef __RMLOutputParameters__
00050 #define __RMLOutputParameters__
00051 
00052
00053 #include <RMLVector.h>
00054 #include <string.h>
00055
00056
00057 //  ---------------------- Doxygen info ----------------------
00074 //  ----------------------------------------------------------
00075 class RMLOutputParameters
00076 {
00077 public:
00078
00079
00080 //  ---------------------- Doxygen info ----------------------
00085 //  ----------------------------------------------------------
00086     enum ReturnValue
00087     {
00088         RETURN_SUCCESS  =   0,
00089         RETURN_ERROR    =   -1
00090     };
00091
00092
00093 protected:
00094
00095 //  ---------------------- Doxygen info ----------------------
00115 //  ----------------------------------------------------------
00116     RMLOutputParameters(const unsigned int DegreesOfFreedom)
00117     {
00118         unsigned int    i                           =   0                                       ;
00119
00120         this->TrajectoryIsPhaseSynchronized         =   false                                   ;
00121
00122         this->NumberOfDOFs                          =   DegreesOfFreedom                        ;
00123
00124         this->SynchronizationTime                   =   0.0                                     ;
00125
00126         this->ANewCalculationWasPerformed           =   false                                   ;
00127
00128         this->DOFWithTheGreatestExecutionTime       =   0                                       ;
00129
00130         this->NewPositionVector                     =   new RMLDoubleVector(DegreesOfFreedom)   ;
00131         this->NewVelocityVector                     =   new RMLDoubleVector(DegreesOfFreedom)   ;
00132         this->NewAccelerationVector                 =   new RMLDoubleVector(DegreesOfFreedom)   ;
00133         this->MinExtremaTimesVector                 =   new RMLDoubleVector(DegreesOfFreedom)   ;
00134         this->MaxExtremaTimesVector                 =   new RMLDoubleVector(DegreesOfFreedom)   ;
00135         this->MinPosExtremaPositionVectorOnly       =   new RMLDoubleVector(DegreesOfFreedom)   ;
00136         this->MaxPosExtremaPositionVectorOnly       =   new RMLDoubleVector(DegreesOfFreedom)   ;
00137         this->ExecutionTimes                        =   new RMLDoubleVector(DegreesOfFreedom)   ;
00138
00139         memset(this->NewPositionVector->VecData                 ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00140         memset(this->NewVelocityVector->VecData                 ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00141         memset(this->NewAccelerationVector->VecData             ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00142         memset(this->MinExtremaTimesVector->VecData             ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00143         memset(this->MaxExtremaTimesVector->VecData             ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00144         memset(this->MinPosExtremaPositionVectorOnly->VecData   ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00145         memset(this->MaxPosExtremaPositionVectorOnly->VecData   ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00146         memset(this->ExecutionTimes->VecData                    ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00147
00148         this->MinPosExtremaPositionVectorArray      =   new RMLDoubleVector*[DegreesOfFreedom]  ;
00149         this->MinPosExtremaVelocityVectorArray      =   new RMLDoubleVector*[DegreesOfFreedom]  ;
00150         this->MinPosExtremaAccelerationVectorArray  =   new RMLDoubleVector*[DegreesOfFreedom]  ;
00151         this->MaxPosExtremaPositionVectorArray      =   new RMLDoubleVector*[DegreesOfFreedom]  ;
00152         this->MaxPosExtremaVelocityVectorArray      =   new RMLDoubleVector*[DegreesOfFreedom]  ;
00153         this->MaxPosExtremaAccelerationVectorArray  =   new RMLDoubleVector*[DegreesOfFreedom]  ;
00154
00155         for (i = 0; i < DegreesOfFreedom; i++)
00156         {
00157             (this->MinPosExtremaPositionVectorArray)        [i] =   new RMLDoubleVector(DegreesOfFreedom);
00158             (this->MinPosExtremaVelocityVectorArray)        [i] =   new RMLDoubleVector(DegreesOfFreedom);
00159             (this->MinPosExtremaAccelerationVectorArray)    [i] =   new RMLDoubleVector(DegreesOfFreedom);
00160             (this->MaxPosExtremaPositionVectorArray)        [i] =   new RMLDoubleVector(DegreesOfFreedom);
00161             (this->MaxPosExtremaVelocityVectorArray)        [i] =   new RMLDoubleVector(DegreesOfFreedom);
00162             (this->MaxPosExtremaAccelerationVectorArray)    [i] =   new RMLDoubleVector(DegreesOfFreedom);
00163
00164             memset(((this->MinPosExtremaPositionVectorArray)            [i])->VecData       ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00165             memset(((this->MinPosExtremaVelocityVectorArray)            [i])->VecData       ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00166             memset(((this->MinPosExtremaAccelerationVectorArray)        [i])->VecData       ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00167             memset(((this->MaxPosExtremaPositionVectorArray)            [i])->VecData       ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00168             memset(((this->MaxPosExtremaVelocityVectorArray)            [i])->VecData       ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00169             memset(((this->MaxPosExtremaAccelerationVectorArray)        [i])->VecData       ,   0x0 ,       DegreesOfFreedom * sizeof(double))  ;
00170         }
00171
00172     }
00173
00174
00175 //  ---------------------- Doxygen info ----------------------
00195 //  ----------------------------------------------------------
00196     RMLOutputParameters(const RMLOutputParameters &OP)
00197     {
00198         unsigned int    i                           =   0                                                       ;
00199
00200         this->TrajectoryIsPhaseSynchronized         =   OP.IsTrajectoryPhaseSynchronized()                      ;
00201
00202         this->NumberOfDOFs                          =   OP.GetNumberOfDOFs()                                    ;
00203
00204         this->SynchronizationTime                   =   OP.GetSynchronizationTime()                             ;
00205
00206         this->ANewCalculationWasPerformed           =   OP.WasACompleteComputationPerformedDuringTheLastCycle() ;
00207
00208         this->DOFWithTheGreatestExecutionTime       =   OP.GetDOFWithTheGreatestExecutionTime()                 ;
00209
00210         this->NewPositionVector                     =   new RMLDoubleVector(this->NumberOfDOFs)                 ;
00211         this->NewVelocityVector                     =   new RMLDoubleVector(this->NumberOfDOFs)                 ;
00212         this->NewAccelerationVector                 =   new RMLDoubleVector(this->NumberOfDOFs)                 ;
00213         this->MinExtremaTimesVector                 =   new RMLDoubleVector(this->NumberOfDOFs)                 ;
00214         this->MaxExtremaTimesVector                 =   new RMLDoubleVector(this->NumberOfDOFs)                 ;
00215         this->MinPosExtremaPositionVectorOnly       =   new RMLDoubleVector(this->NumberOfDOFs)                 ;
00216         this->MaxPosExtremaPositionVectorOnly       =   new RMLDoubleVector(this->NumberOfDOFs)                 ;
00217         this->ExecutionTimes                        =   new RMLDoubleVector(this->NumberOfDOFs)                 ;
00218
00219         this->MinPosExtremaPositionVectorArray      =   new RMLDoubleVector *[this->NumberOfDOFs]               ;
00220         this->MinPosExtremaVelocityVectorArray      =   new RMLDoubleVector *[this->NumberOfDOFs]               ;
00221         this->MinPosExtremaAccelerationVectorArray  =   new RMLDoubleVector *[this->NumberOfDOFs]               ;
00222         this->MaxPosExtremaPositionVectorArray      =   new RMLDoubleVector *[this->NumberOfDOFs]               ;
00223         this->MaxPosExtremaVelocityVectorArray      =   new RMLDoubleVector *[this->NumberOfDOFs]               ;
00224         this->MaxPosExtremaAccelerationVectorArray  =   new RMLDoubleVector *[this->NumberOfDOFs]               ;
00225
00226         for (i = 0; i < this->NumberOfDOFs; i++)
00227         {
00228             (this->MinPosExtremaPositionVectorArray)        [i] =   new RMLDoubleVector(this->NumberOfDOFs)     ;
00229             (this->MinPosExtremaVelocityVectorArray)        [i] =   new RMLDoubleVector(this->NumberOfDOFs)     ;
00230             (this->MinPosExtremaAccelerationVectorArray)    [i] =   new RMLDoubleVector(this->NumberOfDOFs)     ;
00231             (this->MaxPosExtremaPositionVectorArray)        [i] =   new RMLDoubleVector(this->NumberOfDOFs)     ;
00232             (this->MaxPosExtremaVelocityVectorArray)        [i] =   new RMLDoubleVector(this->NumberOfDOFs)     ;
00233             (this->MaxPosExtremaAccelerationVectorArray)    [i] =   new RMLDoubleVector(this->NumberOfDOFs)     ;
00234         }
00235
00236         *this               =   OP                                                                              ;
00237     }
00238
00239
00240 //  ---------------------- Doxygen info ----------------------
00251 //  ----------------------------------------------------------
00252     void Echo(FILE* FileHandler = stdout) const
00253     {
00254         unsigned int        i   =   0;
00255
00256         if (FileHandler == NULL)
00257         {
00258             return;
00259         }
00260
00261         fprintf(FileHandler,   "New position vector        : ");
00262         for (i = 0; i < this->NumberOfDOFs; i++)
00263         {
00264             fprintf(FileHandler, " %.20le ", this->NewPositionVector->VecData[i]);
00265         }
00266         fprintf(FileHandler, "\nNew velocity vector        : ");
00267         for (i = 0; i < this->NumberOfDOFs; i++)
00268         {
00269             fprintf(FileHandler, " %.20le ", this->NewVelocityVector->VecData[i]);
00270         }
00271         fprintf(FileHandler, "\nNew acceleration vector    : ");
00272         for (i = 0; i < this->NumberOfDOFs; i++)
00273         {
00274             fprintf(FileHandler, " %.20le ", this->NewAccelerationVector->VecData[i]);
00275         }
00276         fprintf(FileHandler, "\n");
00277         return;
00278     }
00279
00280
00281 public:
00282
00283 //  ---------------------- Doxygen info ----------------------
00288 //  ----------------------------------------------------------
00289     ~RMLOutputParameters(void)
00290     {
00291         unsigned int        i   =   0;
00292
00293         for (i = 0; i < this->NumberOfDOFs; i++)
00294         {
00295             delete ((this->MinPosExtremaPositionVectorArray)        [i])    ;
00296             delete ((this->MinPosExtremaVelocityVectorArray)        [i])    ;
00297             delete ((this->MinPosExtremaAccelerationVectorArray)    [i])    ;
00298             delete ((this->MaxPosExtremaPositionVectorArray)        [i])    ;
00299             delete ((this->MaxPosExtremaVelocityVectorArray)        [i])    ;
00300             delete ((this->MaxPosExtremaAccelerationVectorArray)    [i])    ;
00301         }
00302
00303         delete this->NewPositionVector                                      ;
00304         delete this->NewVelocityVector                                      ;
00305         delete this->NewAccelerationVector                                  ;
00306         delete this->MinPosExtremaPositionVectorArray                       ;
00307         delete this->MinPosExtremaVelocityVectorArray                       ;
00308         delete this->MinPosExtremaAccelerationVectorArray                   ;
00309         delete this->MaxPosExtremaPositionVectorArray                       ;
00310         delete this->MaxPosExtremaVelocityVectorArray                       ;
00311         delete this->MaxPosExtremaAccelerationVectorArray                   ;
00312         delete this->MinExtremaTimesVector                                  ;
00313         delete this->MaxExtremaTimesVector                                  ;
00314         delete this->MinPosExtremaPositionVectorOnly                        ;
00315         delete this->MaxPosExtremaPositionVectorOnly                        ;
00316         delete this->ExecutionTimes                                         ;
00317
00318         this->NewPositionVector                     =   NULL                ;
00319         this->NewVelocityVector                     =   NULL                ;
00320         this->NewAccelerationVector                 =   NULL                ;
00321         this->MinPosExtremaPositionVectorArray      =   NULL                ;
00322         this->MinPosExtremaVelocityVectorArray      =   NULL                ;
00323         this->MinPosExtremaAccelerationVectorArray  =   NULL                ;
00324         this->MaxPosExtremaPositionVectorArray      =   NULL                ;
00325         this->MaxPosExtremaVelocityVectorArray      =   NULL                ;
00326         this->MaxPosExtremaAccelerationVectorArray  =   NULL                ;
00327         this->MinExtremaTimesVector                 =   NULL                ;
00328         this->MaxExtremaTimesVector                 =   NULL                ;
00329         this->MinPosExtremaPositionVectorOnly       =   NULL                ;
00330         this->MaxPosExtremaPositionVectorOnly       =   NULL                ;
00331         this->ExecutionTimes                        =   NULL                ;
00332
00333         this->NumberOfDOFs                          =   0                   ;
00334     }
00335
00336
00337 //  ---------------------- Doxygen info ----------------------
00345 //  ----------------------------------------------------------
00346     RMLOutputParameters &operator = (const RMLOutputParameters &OP)
00347     {
00348         unsigned int        i                   =   0                                   ;
00349
00350         this->NumberOfDOFs                      =   OP.NumberOfDOFs                     ;
00351         this->TrajectoryIsPhaseSynchronized     =   OP.TrajectoryIsPhaseSynchronized    ;
00352         this->ANewCalculationWasPerformed       =   OP.ANewCalculationWasPerformed      ;
00353         this->SynchronizationTime               =   OP.SynchronizationTime              ;
00354         this->DOFWithTheGreatestExecutionTime   =   OP.DOFWithTheGreatestExecutionTime  ;
00355
00356         OP.GetNewPositionVector     (this->NewPositionVector                    )       ;
00357         OP.GetNewVelocityVector     (this->NewVelocityVector                    )       ;
00358         OP.GetNewAccelerationVector (this->NewAccelerationVector                )       ;
00359         OP.GetTimesAtMinPosition    (this->MinExtremaTimesVector                )       ;
00360         OP.GetTimesAtMaxPosition    (this->MaxExtremaTimesVector                )       ;
00361         OP.GetExecutionTimes        (this->ExecutionTimes                       )       ;
00362
00363         OP.GetPositionalExtrema(    this->MinPosExtremaPositionVectorOnly
00364                                 ,   this->MaxPosExtremaPositionVectorOnly       )       ;
00365
00366         for (i = 0; i < this->NumberOfDOFs; i++)
00367         {
00368             OP.GetMotionStateAtMinPosForOneDOF(     i
00369                                                 ,   (this->MinPosExtremaPositionVectorArray)[i]
00370                                                 ,   (this->MinPosExtremaVelocityVectorArray)[i]
00371                                                 ,   (this->MinPosExtremaAccelerationVectorArray)[i]);
00372
00373             OP.GetMotionStateAtMaxPosForOneDOF(     i
00374                                                 ,   (this->MaxPosExtremaPositionVectorArray)[i]
00375                                                 ,   (this->MaxPosExtremaVelocityVectorArray)[i]
00376                                                 ,   (this->MaxPosExtremaAccelerationVectorArray)[i]);
00377         }
00378
00379         return(*this);
00380     }
00381
00382
00383 //  ---------------------- Doxygen info ----------------------
00397 //  ----------------------------------------------------------
00398     inline void GetNewPositionVector(RMLDoubleVector *OutputVector) const
00399     {
00400         *OutputVector   =   *(this->NewPositionVector);
00401     }
00402
00403
00404 //  ---------------------- Doxygen info ----------------------
00426 //  ----------------------------------------------------------
00427     inline void GetNewPositionVector(       double              *OutputVector
00428                                         ,   const unsigned int  &SizeInBytes) const
00429     {
00430         memcpy(     (void*)OutputVector
00431                 ,   (void*)this->NewPositionVector->VecData
00432                 ,   SizeInBytes );
00433     }
00434
00435
00436 //  ---------------------- Doxygen info ----------------------
00456 //  ----------------------------------------------------------
00457     inline void GetNewPositionVectorElement(    double              *OutputValue
00458                                             ,   const unsigned int  &Index) const
00459     {
00460         if ( ( Index + 1 ) > ((unsigned int) this->NewPositionVector->GetVecDim() ) )
00461         {
00462             *OutputValue    =   0.0;
00463         }
00464         else
00465         {
00466             *OutputValue    =   (*this->NewPositionVector)[Index];
00467         }
00468     }
00469
00470
00471 //  ---------------------- Doxygen info ----------------------
00485 //  ----------------------------------------------------------
00486     inline double GetNewPositionVectorElement(const unsigned int &Index) const
00487     {
00488         if ( ( Index + 1 ) > ((unsigned int) this->NewPositionVector->GetVecDim() ) )
00489         {
00490             return(0.0);
00491         }
00492         else
00493         {
00494             return( (*this->NewPositionVector)[Index] );
00495         }
00496     }
00497
00498
00499 // #############################################################################
00500
00501
00502 //  ---------------------- Doxygen info ----------------------
00516 //  ----------------------------------------------------------
00517     inline void GetNewVelocityVector(RMLDoubleVector *OutputVector) const
00518     {
00519         *OutputVector   =   *(this->NewVelocityVector);
00520     }
00521
00522
00523 //  ---------------------- Doxygen info ----------------------
00545 //  ----------------------------------------------------------
00546     inline void GetNewVelocityVector(       double              *OutputVector
00547                                         ,   const unsigned int  &SizeInBytes) const
00548     {
00549         memcpy(     (void*)OutputVector
00550                 ,   (void*)this->NewVelocityVector->VecData
00551                 ,   SizeInBytes );
00552     }
00553
00554
00555 //  ---------------------- Doxygen info ----------------------
00575 //  ----------------------------------------------------------
00576     inline void GetNewVelocityVectorElement(    double              *OutputValue
00577                                             ,   const unsigned int  &Index) const
00578     {
00579         if ( ( Index + 1 ) > ((unsigned int) this->NewVelocityVector->GetVecDim() ) )
00580         {
00581             *OutputValue    =   0.0;
00582         }
00583         else
00584         {
00585             *OutputValue    =   (*this->NewVelocityVector)[Index];
00586         }
00587     }
00588
00589
00590 //  ---------------------- Doxygen info ----------------------
00604 //  ----------------------------------------------------------
00605     inline double GetNewVelocityVectorElement(const unsigned int &Index) const
00606     {
00607         if ( ( Index + 1 ) > ((unsigned int) this->NewVelocityVector->GetVecDim() ) )
00608         {
00609             return(0.0);
00610         }
00611         else
00612         {
00613             return( (*this->NewVelocityVector)[Index] );
00614         }
00615     }
00616
00617
00618 // #############################################################################
00619
00620
00621 //  ---------------------- Doxygen info ----------------------
00635 //  ----------------------------------------------------------
00636     inline void GetNewAccelerationVector(RMLDoubleVector *OutputVector) const
00637     {
00638         *OutputVector   =   *(this->NewAccelerationVector);
00639     }
00640
00641
00642 //  ---------------------- Doxygen info ----------------------
00664 //  ----------------------------------------------------------
00665     inline void GetNewAccelerationVector(       double              *OutputVector
00666                                             ,   const unsigned int  &SizeInBytes) const
00667     {
00668         memcpy(     (void*)OutputVector
00669                 ,   (void*)this->NewAccelerationVector->VecData
00670                 ,   SizeInBytes );
00671     }
00672
00673
00674 //  ---------------------- Doxygen info ----------------------
00694 //  ----------------------------------------------------------
00695     inline void GetNewAccelerationVectorElement(    double              *OutputValue
00696                                                 ,   const unsigned int  &Index) const
00697     {
00698         if ( ( Index + 1 ) > ((unsigned int) this->NewAccelerationVector->GetVecDim() ) )
00699         {
00700             *OutputValue    =   0.0;
00701         }
00702         else
00703         {
00704             *OutputValue    =   (*this->NewAccelerationVector)[Index];
00705         }
00706     }
00707
00708
00709 //  ---------------------- Doxygen info ----------------------
00723 //  ----------------------------------------------------------
00724     inline double GetNewAccelerationVectorElement(const unsigned int &Index) const
00725     {
00726         if ( ( Index + 1 ) > ((unsigned int) this->NewAccelerationVector->GetVecDim() ) )
00727         {
00728             return(0.0);
00729         }
00730         else
00731         {
00732             return( (*this->NewAccelerationVector)[Index] );
00733         }
00734     }
00735
00736
00737 //  ---------------------- Doxygen info ----------------------
00756 //  ----------------------------------------------------------
00757     inline void GetPositionalExtrema(       RMLDoubleVector     *MinimumPositionVector
00758                                         ,   RMLDoubleVector     *MaximumPositionVector) const
00759     {
00760         *MinimumPositionVector  =   *(this->MinPosExtremaPositionVectorOnly);
00761         *MaximumPositionVector  =   *(this->MaxPosExtremaPositionVectorOnly);
00762     }
00763
00764
00765 //  ---------------------- Doxygen info ----------------------
00791 //  ----------------------------------------------------------
00792     inline void GetPositionalExtrema(       double              *MinimumPositionVector
00793                                         ,   double              *MaximumPositionVector
00794                                         ,   const unsigned int  &SizeInBytes)  const
00795     {
00796         memcpy(     (void*)MinimumPositionVector
00797                 ,   (void*)(this->MinPosExtremaPositionVectorOnly->VecData)
00798                 ,   SizeInBytes                                                     );
00799
00800         memcpy(     (void*)MaximumPositionVector
00801                 ,   (void*)(this->MaxPosExtremaPositionVectorOnly->VecData)
00802                 ,   SizeInBytes                                                     );
00803     }
00804
00805
00806 //  ---------------------- Doxygen info ----------------------
00822 //  ----------------------------------------------------------
00823     inline void GetTimesAtMinPosition(RMLDoubleVector *ExtremaTimes) const
00824     {
00825         *ExtremaTimes   =   *(this->MinExtremaTimesVector);
00826     }
00827
00828
00829 //  ---------------------- Doxygen info ----------------------
00845 //  ----------------------------------------------------------
00846     inline void GetTimesAtMaxPosition(RMLDoubleVector *ExtremaTimes) const
00847     {
00848         *ExtremaTimes   =   *(this->MaxExtremaTimesVector);
00849     }
00850
00851
00852 //  ---------------------- Doxygen info ----------------------
00874 //  ----------------------------------------------------------
00875     inline void GetTimesAtMinPosition(      double              *ExtremaTimes
00876                                         ,   const unsigned int  &SizeInBytes) const
00877     {
00878         memcpy(     (void*)ExtremaTimes
00879                 ,   (void*)(this->MinExtremaTimesVector->VecData)
00880                 ,   SizeInBytes                                         );
00881     }
00882
00883
00884 //  ---------------------- Doxygen info ----------------------
00906 //  ----------------------------------------------------------
00907     inline void GetTimesAtMaxPosition(      double              *ExtremaTimes
00908                                         ,   const unsigned int  &SizeInBytes) const
00909     {
00910         memcpy(     (void*)ExtremaTimes
00911                 ,   (void*)(this->MaxExtremaTimesVector->VecData)
00912                 ,   SizeInBytes                                         );
00913     }
00914
00915
00916 //  ---------------------- Doxygen info ----------------------
00955 //  ----------------------------------------------------------
00956     inline int GetMotionStateAtMinPosForOneDOF(     const unsigned int  &DOF
00957                                                 ,   RMLDoubleVector     *PositionVector
00958                                                 ,   RMLDoubleVector     *VelocityVector
00959                                                 ,   RMLDoubleVector     *AccelerationVector) const
00960     {
00961         if (DOF >= this->NumberOfDOFs)
00962         {
00963             return(RMLOutputParameters::RETURN_ERROR);
00964         }
00965
00966         *PositionVector     =   *((this->MinPosExtremaPositionVectorArray       )[DOF]) ;
00967         *VelocityVector     =   *((this->MinPosExtremaVelocityVectorArray       )[DOF]) ;
00968         *AccelerationVector =   *((this->MinPosExtremaAccelerationVectorArray   )[DOF]) ;
00969
00970         return(RMLOutputParameters::RETURN_SUCCESS);
00971     }
00972
00973
00974 //  ---------------------- Doxygen info ----------------------
01022 //  ----------------------------------------------------------
01023     inline int GetMotionStateAtMinPosForOneDOF(     const unsigned int  &DOF
01024                                                 ,   double              *PositionVector
01025                                                 ,   double              *VelocityVector
01026                                                 ,   double              *AccelerationVector
01027                                                 ,   const unsigned int  &SizeInBytes) const
01028     {
01029         if (DOF >= this->NumberOfDOFs)
01030         {
01031             return(RMLOutputParameters::RETURN_ERROR);
01032         }
01033
01034         memcpy(     (void*)PositionVector
01035                 ,   (void*)(((this->MinPosExtremaPositionVectorArray)[DOF])->VecData)
01036                 ,   SizeInBytes                                                             );
01037
01038         memcpy(     (void*)VelocityVector
01039                 ,   (void*)(((this->MinPosExtremaVelocityVectorArray)[DOF])->VecData)
01040                 ,   SizeInBytes                                                             );
01041
01042         memcpy(     (void*)AccelerationVector
01043                 ,   (void*)(((this->MinPosExtremaAccelerationVectorArray)[DOF])->VecData)
01044                 ,   SizeInBytes                                                                 );
01045
01046         return(RMLOutputParameters::RETURN_SUCCESS);
01047     }
01048
01049
01050 //  ---------------------- Doxygen info ----------------------
01089 //  ----------------------------------------------------------
01090     inline int GetMotionStateAtMaxPosForOneDOF(     const unsigned int  &DOF
01091                                                 ,   RMLDoubleVector     *PositionVector
01092                                                 ,   RMLDoubleVector     *VelocityVector
01093                                                 ,   RMLDoubleVector     *AccelerationVector) const
01094     {
01095         if (DOF >= this->NumberOfDOFs)
01096         {
01097             return(RMLOutputParameters::RETURN_ERROR);
01098         }
01099
01100         *PositionVector     =   *((this->MaxPosExtremaPositionVectorArray       )[DOF]) ;
01101         *VelocityVector     =   *((this->MaxPosExtremaVelocityVectorArray       )[DOF]) ;
01102         *AccelerationVector =   *((this->MaxPosExtremaAccelerationVectorArray   )[DOF]) ;
01103
01104         return(RMLOutputParameters::RETURN_SUCCESS);
01105     }
01106
01107
01108 //  ---------------------- Doxygen info ----------------------
01156 //  ----------------------------------------------------------
01157     inline int GetMotionStateAtMaxPosForOneDOF(     const unsigned int  &DOF
01158                                                 ,   double              *PositionVector
01159                                                 ,   double              *VelocityVector
01160                                                 ,   double              *AccelerationVector
01161                                                 ,   const unsigned int  &SizeInBytes) const
01162     {
01163         if (DOF >= this->NumberOfDOFs)
01164         {
01165             return(RMLOutputParameters::RETURN_ERROR);
01166         }
01167
01168         memcpy(     (void*)PositionVector
01169                 ,   (void*)(((this->MaxPosExtremaPositionVectorArray)[DOF])->VecData)
01170                 ,   SizeInBytes                                                             );
01171
01172         memcpy(     (void*)VelocityVector
01173                 ,   (void*)(((this->MaxPosExtremaVelocityVectorArray)[DOF])->VecData)
01174                 ,   SizeInBytes                                                             );
01175
01176         memcpy(     (void*)AccelerationVector
01177                 ,   (void*)(((this->MaxPosExtremaAccelerationVectorArray)[DOF])->VecData)
01178                 ,   SizeInBytes                                                                 );
01179
01180         return(RMLOutputParameters::RETURN_SUCCESS);
01181     }
01182
01183
01184 //  ---------------------- Doxygen info ----------------------
01192 //  ----------------------------------------------------------
01193     inline unsigned int GetNumberOfDOFs(void) const
01194     {
01195         return(this->NumberOfDOFs);
01196     }
01197
01198
01199 //  ---------------------- Doxygen info ----------------------
01212 //  ----------------------------------------------------------
01213     inline bool WasACompleteComputationPerformedDuringTheLastCycle(void) const
01214     {
01215         return(this->ANewCalculationWasPerformed);
01216     }
01217
01218
01219 //  ---------------------- Doxygen info ----------------------
01229 //  ----------------------------------------------------------
01230     inline bool IsTrajectoryPhaseSynchronized(void) const
01231     {
01232         return(this->TrajectoryIsPhaseSynchronized);
01233     }
01234
01235 //  ---------------------- Doxygen info ----------------------
01255 //  ----------------------------------------------------------
01256     inline double GetSynchronizationTime(void) const
01257     {
01258         return(this->SynchronizationTime);
01259     }
01260
01261
01262 //  ---------------------- Doxygen info ----------------------
01270 //  ----------------------------------------------------------
01271     inline unsigned int GetDOFWithTheGreatestExecutionTime(void) const
01272     {
01273         return(this->DOFWithTheGreatestExecutionTime);
01274     }
01275
01276
01277 //  ---------------------- Doxygen info ----------------------
01293 //  ----------------------------------------------------------
01294     inline void GetExecutionTimes(RMLDoubleVector *OutputVector) const
01295     {
01296         *OutputVector   =   *(this->ExecutionTimes);
01297     }
01298
01299
01300 //  ---------------------- Doxygen info ----------------------
01324 //  ----------------------------------------------------------
01325     inline void GetExecutionTimes(      double              *OutputVector
01326                                     ,   const unsigned int  &SizeInBytes) const
01327     {
01328         memcpy(     (void*)OutputVector
01329                 ,   (void*)this->ExecutionTimes->VecData
01330                 ,   SizeInBytes );
01331     }
01332
01333
01334 //  ---------------------- Doxygen info ----------------------
01356 //  ----------------------------------------------------------
01357     inline void GetExecutionTimesElement(       double              *OutputValue
01358                                             ,   const unsigned int  &Index) const
01359     {
01360         if ( ( Index + 1 ) > ((unsigned int) this->ExecutionTimes->GetVecDim() ) )
01361         {
01362             *OutputValue    =   0.0;
01363         }
01364         else
01365         {
01366             *OutputValue    =   (*this->ExecutionTimes)[Index];
01367         }
01368     }
01369
01370
01371 //  ---------------------- Doxygen info ----------------------
01387 //  ----------------------------------------------------------
01388     inline double GetExecutionTimesElement(const unsigned int &Index) const
01389     {
01390         if ( ( Index + 1 ) > ((unsigned int) this->ExecutionTimes->GetVecDim() ) )
01391         {
01392             return(0.0);
01393         }
01394         else
01395         {
01396             return( (*this->ExecutionTimes)[Index] );
01397         }
01398     }
01399
01400
01401 //  ---------------------- Doxygen info ----------------------
01409 //  ----------------------------------------------------------
01410     inline double GetGreatestExecutionTime(void) const
01411     {
01412         return((this->ExecutionTimes->VecData)[this->DOFWithTheGreatestExecutionTime]);
01413     }
01414
01415
01416 //  ---------------------- Doxygen info ----------------------
01434 //  ----------------------------------------------------------
01435     bool                    ANewCalculationWasPerformed;
01436
01437
01438 //  ---------------------- Doxygen info ----------------------
01448 //  ----------------------------------------------------------
01449     bool                    TrajectoryIsPhaseSynchronized;
01450
01451
01452 //  ---------------------- Doxygen info ----------------------
01462 //  ----------------------------------------------------------
01463     unsigned int            NumberOfDOFs;
01464
01465
01466 //  ---------------------- Doxygen info ----------------------
01490 //  ----------------------------------------------------------
01491     unsigned int            DOFWithTheGreatestExecutionTime;
01492
01493
01494 //  ---------------------- Doxygen info ----------------------
01506 //  ----------------------------------------------------------
01507     double                  SynchronizationTime;
01508
01509
01510 //  ---------------------- Doxygen info ----------------------
01522 //  ----------------------------------------------------------
01523     RMLDoubleVector         *NewPositionVector                      ;
01524
01525
01526 //  ---------------------- Doxygen info ----------------------
01538 //  ----------------------------------------------------------
01539     RMLDoubleVector         *NewVelocityVector                      ;
01540
01541
01542 //  ---------------------- Doxygen info ----------------------
01554 //  ----------------------------------------------------------
01555     RMLDoubleVector         *NewAccelerationVector                  ;
01556
01557
01558 //  ---------------------- Doxygen info ----------------------
01570 //  ----------------------------------------------------------
01571     RMLDoubleVector         *MinExtremaTimesVector                  ;
01572
01573
01574 //  ---------------------- Doxygen info ----------------------
01586 //  ----------------------------------------------------------
01587     RMLDoubleVector         *MaxExtremaTimesVector                  ;
01588
01589
01590 //  ---------------------- Doxygen info ----------------------
01602 //  ----------------------------------------------------------
01603     RMLDoubleVector         *MinPosExtremaPositionVectorOnly        ;
01604
01605
01606 //  ---------------------- Doxygen info ----------------------
01618 //  ----------------------------------------------------------
01619     RMLDoubleVector         *MaxPosExtremaPositionVectorOnly        ;
01620
01621
01622 //  ---------------------- Doxygen info ----------------------
01645 //  ----------------------------------------------------------
01646     RMLDoubleVector         *ExecutionTimes;
01647
01648
01649 //  ---------------------- Doxygen info ----------------------
01665 //  ----------------------------------------------------------
01666     RMLDoubleVector         **MinPosExtremaPositionVectorArray      ;
01667
01668
01669 //  ---------------------- Doxygen info ----------------------
01685 //  ----------------------------------------------------------
01686     RMLDoubleVector         **MinPosExtremaVelocityVectorArray      ;
01687
01688
01689 //  ---------------------- Doxygen info ----------------------
01705 //  ----------------------------------------------------------
01706     RMLDoubleVector         **MinPosExtremaAccelerationVectorArray  ;
01707
01708
01709 //  ---------------------- Doxygen info ----------------------
01725 //  ----------------------------------------------------------
01726     RMLDoubleVector         **MaxPosExtremaPositionVectorArray      ;
01727
01728
01729 //  ---------------------- Doxygen info ----------------------
01745 //  ----------------------------------------------------------
01746     RMLDoubleVector         **MaxPosExtremaVelocityVectorArray      ;
01747
01748
01749 //  ---------------------- Doxygen info ----------------------
01765 //  ----------------------------------------------------------
01766     RMLDoubleVector         **MaxPosExtremaAccelerationVectorArray  ;
01767
01768 };// class RMLOutputParameters
01769
01770
01771
01772 #endif
01773 
01774
User documentation of the Reflexxes Motion Libraries by Reflexxes GmbH (Company Information, Impressum). This document was generated with Doxygen on Mon Jul 7 2014 13:21:08. Copyright 2010–2014.