Libbarrett
1.2.4
|
00001 /* 00002 * trapezoidal_velocity_profile.h 00003 * 00004 * Created on: Dec 23, 2009 00005 * Author: dc 00006 */ 00007 00008 #ifndef BARRETT_MATH_TRAPEZOIDAL_VELOCITY_PROFILE_H_ 00009 #define BARRETT_MATH_TRAPEZOIDAL_VELOCITY_PROFILE_H_ 00010 00011 00012 #include <barrett/detail/ca_macro.h> 00013 00014 00015 // forward declaration from <barrett/profile/profile.h> 00016 struct bt_profile; 00017 00018 00019 namespace barrett { 00020 namespace math { 00021 00022 00023 class TrapezoidalVelocityProfile { 00024 public: 00025 TrapezoidalVelocityProfile(double velocity, double acceleration, 00026 double initialVelocity, double pathLength); 00027 ~TrapezoidalVelocityProfile(); 00028 00029 double finalT() const; 00030 00031 double eval(double t) const; 00032 00033 typedef double result_type; 00034 result_type operator() (double t) const { 00035 return eval(t); 00036 } 00037 00038 protected: 00039 double v, a, v_0, l; 00040 struct bt_profile* impl; 00041 00042 private: 00043 DISALLOW_COPY_AND_ASSIGN(TrapezoidalVelocityProfile); 00044 }; 00045 00046 00047 } 00048 } 00049 00050 00051 #endif /* BARRETT_MATH_TRAPEZOIDAL_VELOCITY_PROFILE_H_ */