Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

CubicPoly.h

Go to the documentation of this file.
00001 
00002 //
00003 //       Title           : CubicPoly.h
00004 //       Project         : OSCAR 2.0
00005 //       Created         : 8/05/04
00006 //       Author          : Peter S. March
00007 //       Platforms       : All
00026 //       Access          : Company Confidential
00027 //       Purpose         :
00028 //
00029 //----------------------------------------------------------------------------
00030 //
00031 //       Classes:
00032 //               <none>
00033 //
00034 //       Global Functions:
00035 //               <none>
00036 //
00037 //       Global Variables:
00038 //               <none>
00039 //
00040 //----------------------------------------------------------------------------
00041 //
00042 //       $Revisions$
00043 //
00044 //
00045 //
00047 #ifndef OSCARCubicPoly_hpp
00048 #define OSCARCubicPoly_hpp
00049 
00050 #if _MSC_VER >= 1000
00051 #pragma once
00052 #endif // _MSC_VER >= 1000
00053 
00054 
00055 #include "Math/HandPose.h"
00056 #include "Math/Matrix.h"
00057 #include "MotionPlanning/MotionPlanErrors.h"
00058 #include <vector>
00059 
00061 namespace OSCAR {
00062 
00071     class CubicPoly : public virtual Base
00072     {
00073     public:
00086             CubicPoly(const Vector& initialPos, const Vector& finalPos, const Vector& initialVel, const Vector& finalVec, const double SampleTime, OSCARError& err = DUMMY_ERROR(noError));
00087 
00088 
00096     CubicPoly(const CubicPoly& rhs);
00097 
00105     CubicPoly& operator=(const CubicPoly& rhs);
00106 
00114       bool SetPositionConditions(const Vector& initialPos, const Vector& finalPos);
00115 
00123       bool SetVelocityConditions(const Vector& initialVel, const Vector& finalVel);
00124 
00130       bool GenerateTrajectory(double deltaTime);
00131 
00137       bool GetTrajectory(std::vector<Vector>& Trajectory) const;
00138 
00146       bool GetTrajectoryPoint(unsigned int i, Vector& point);
00147 
00153       unsigned int GetTrajectorySize();
00154 
00155       virtual ~CubicPoly(){}
00156 
00157     protected:
00158       void initialize();
00159 
00160       unsigned int dof;
00161 
00162       Vector initialPosition;
00163       Vector finalPosition;
00164       Vector initialVelocity;
00165       Vector finalVelocity;
00166 
00167       Vector a0;
00168       Vector a1;
00169       Vector a2;
00170       Vector a3;
00171 
00172       double sampleTime;
00173 
00174       std::vector<Vector> trajectory;
00175     };
00176 
00177 }
00178 
00179 #endif
00180 
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations