31 #ifndef PARABOLIC_RAMP_H 32 #define PARABOLIC_RAMP_H 39 typedef Math::Real Real;
40 typedef std::vector<Real> Vector;
76 Real
Accel(Real t)
const;
80 void Dilate(Real timeScale);
86 void Bounds(Real& xmin,Real& xmax)
const;
88 void Bounds(Real ta,Real tb,Real& xmin,Real& xmax)
const;
92 void DerivBounds(Real ta,Real tb,Real& vmin,Real& vmax)
const;
114 void SetLinear(
const Vector&
x0,
const Vector& x1,Real t);
115 bool SolveMinTimeLinear(
const Vector& amax,
const Vector& vmax);
116 bool SolveMinTime(
const Vector& amax,
const Vector& vmax);
118 bool SolveMinAccelLinear(
const Vector& vmax,Real time);
120 void Evaluate(Real t,Vector& x)
const;
122 void Accel(Real t,Vector& ddx)
const;
123 void Output(Real dt,std::vector<Vector>& path)
const;
124 void Dilate(Real timeScale);
127 void Bounds(Vector& xmin,Vector& xmax)
const;
128 void Bounds(Real ta,Real tb,Vector& xmin,Vector& xmax)
const;
130 void DerivBounds(Real ta,Real tb,Vector& vmin,Vector& vmax)
const;
139 std::vector<ParabolicRamp1D> ramps;
144 bool SolveMinTimeBounded(Real
x0,Real v0,Real x1,Real v1,
145 Real amax,Real vmax,Real xmin,Real xmax,
151 bool SolveMinAccelBounded(Real
x0,Real v0,Real x1,Real v1,
152 Real endTime,Real vmax,Real xmin,Real xmax,
153 std::vector<ParabolicRamp1D>& ramps);
157 Real SolveMinTimeBounded(
const Vector&
x0,
const Vector& v0,
const Vector& x1,
const Vector& v1,
158 const Vector& amax,
const Vector& vmax,
const Vector& xmin,
const Vector& xmax,
159 std::vector<std::vector<ParabolicRamp1D> >& ramps);
163 bool SolveMinAccelBounded(
const Vector&
x0,
const Vector& v0,
const Vector& x1,
const Vector& v1,
164 Real endTime,
const Vector& vmax,
const Vector& xmin,
const Vector& xmax,
165 std::vector<std::vector<ParabolicRamp1D> >& ramps);
168 void CombineRamps(
const std::vector<std::vector<ParabolicRamp1D> >& ramps,std::vector<ParabolicRampND>& ndramps);
Common math typedefs, constants, functions.
void Bounds(Real &xmin, Real &xmax) const
Returns the x bounds on the path.
Definition: ParabolicRamp.cpp:1773
Real endTime
Calculated upon SolveX.
Definition: ParabolicRamp.h:138
bool IsValid() const
Sanity check.
Definition: ParabolicRamp.cpp:1877
void DerivBounds(Real &vmin, Real &vmax) const
Returns the v bounds on the path.
Definition: ParabolicRamp.cpp:1835
Solves for optimal trajectores for a velocity-bounded ND system.
Definition: ParabolicRamp.h:110
Real SolveMinAccel2(Real endTime, Real vmax)
Same, but if fails, returns the minimum time > endTime.
Definition: ParabolicRamp.cpp:39
Real Derivative(Real t) const
Evaluates the derivative of the trajectory.
Definition: ParabolicRamp.cpp:1361
void Dilate(Real timeScale)
Scales time to slow down (value > 1) or speed up (< 1) the trajectory.
Definition: ParabolicRamp.cpp:1731
Real Accel(Real t) const
Evaluates the second derivative of the trajectory.
Definition: ParabolicRamp.cpp:1373
Real Evaluate(Real t) const
Evaluates the trajectory.
Definition: ParabolicRamp.cpp:1348
Real x0
Input.
Definition: ParabolicRamp.h:97
void TrimBack(Real tcut)
Trims off the front [T-tcut,T] of the trajectory.
Definition: ParabolicRamp.cpp:1762
bool SolveMinTime2(Real amax, Real vmax, Real tLowerBound)
Solves for minimum time given acceleration and velocity bounds, min time.
Definition: ParabolicRamp.cpp:1614
bool SolveMinAccel(Real endTime, Real vmax)
Solves for minimum acceleration given end time and velocity bounds.
Definition: ParabolicRamp.cpp:1382
Vector x0
Input.
Definition: ParabolicRamp.h:134
Stores optimal trajectores for an acceleration and velocity-bounded 1D system.
Definition: ParabolicRamp.h:54
bool SolveMinTime(Real amax, Real vmax)
Solves for minimum time given acceleration and velocity bounds.
Definition: ParabolicRamp.cpp:1501
void SetConstant(Real x, Real t=0)
Sets the ramp to a constant function for time t.
Definition: ParabolicRamp.cpp:1328
void SetLinear(Real x0, Real x1, Real t)
Sets the ramp to a linear function from x0 to x1 with time t.
Definition: ParabolicRamp.cpp:1336
void TrimFront(Real tcut)
Trims off the front [0,tcut] of the trajectory.
Definition: ParabolicRamp.cpp:1744
void SolveBraking(Real amax)
Solves for the minimum-time braking trajectory starting from x0,dx0.
Definition: ParabolicRamp.cpp:1715
Real tswitch1
Calculated upon SolveX.
Definition: ParabolicRamp.h:101
Real EndTime() const
Returns the time at which x1 is reached.
Definition: ParabolicRamp.h:78