53 duration(0), t1(0), t2(0),
54 maxvel(_maxvel),maxacc(_maxacc),
55 startpos(0), endpos(0)
92 double pos1,
double pos2,
double newduration) {
97 double factor =
duration/newduration;
112 double pos1,
double pos2,
double newvelocity) {
116 double factor = newvelocity;
117 if (1.0 < factor) factor = 1.0;
142 }
else if (time<
t1) {
143 return a1+time*(
a2+
a3*time);
144 }
else if (time<
t2) {
145 return b1+time*(
b2+
b3*time);
147 return c1+time*(
c2+
c3*time);
155 }
else if (time<
t1) {
157 }
else if (time<
t2) {
169 }
else if (time<
t1) {
171 }
else if (time<
t2) {
virtual double Vel(double time) const
virtual double Pos(double time) const
virtual ~VelocityProfile_Trap()
VelocityProfile_Trap(double _maxvel=0, double _maxacc=0)
virtual double Acc(double time) const
INLINE Rall1d< T, V, S > sqr(const Rall1d< T, V, S > &arg)
virtual void Write(std::ostream &os) const
virtual void SetProfileDuration(double pos1, double pos2, double newduration)
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
virtual void SetProfileVelocity(double pos1, double pos2, double newvelocity)
virtual void SetMax(double _maxvel, double _maxacc)
virtual void SetProfile(double pos1, double pos2)
virtual VelocityProfile * Clone() const
virtual double Duration() const