00001 00002 // 00003 // Title : BSpline.h 00004 // Project : OSCAR 2.0 00005 // Created : 5/25/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 BSpline_hpp 00048 #define BSpline_hpp 00049 00050 #if _MSC_VER >= 1000 00051 #pragma once 00052 #endif // _MSC_VER >= 1000 00053 00054 00055 #include <vector> 00056 #include "Math/Vector3.h" 00057 #include "MotionPlanning/MotionPlanErrors.h" 00058 #include "MotionPlanning/Spline.h" 00059 00060 00062 namespace OSCAR { 00072 class BSpline : public virtual Spline 00073 { 00074 public: 00083 BSpline(double stepsize, OSCARError& err = DUMMY_ERROR(noError)); 00084 00085 BSpline(OSCARError& err = DUMMY_ERROR(noError)); 00093 BSpline(const BSpline& rhs); 00094 00103 BSpline& operator=(const BSpline& rhs); 00104 00112 virtual bool GenerateTrajectory(); 00113 00121 bool SetOrder(unsigned int order); 00122 00127 double GetOrder(); 00128 00137 bool SetKnots(std::vector<double>& knots); 00138 00147 virtual bool GetParameterRange(double& tInitial, double& tFinal); 00148 00158 virtual bool GetCurvePoint(double t, Vector3& curvePoint); 00159 00160 virtual ~BSpline(){} 00161 00162 protected: 00163 double bsplineFunc(unsigned int i,unsigned int k,double t); 00164 void calculateKnots(); 00165 00166 std::vector<double> knotVector; 00167 unsigned int knotSize; 00168 unsigned int order; 00169 }; 00170 00171 } 00172 00173 #endif 00174
| RRG Homepage | OSCAR Overview | OSCAR Tutorials | Simulations |