Klamp't
0.9.0
|
Maps time into a given path parameter range (e.g., [0,1]) with joint space velocity and acceleration bounds. Stores a piecewise quadratic time scaling. Most users will use the TimeScaledBezierCurve class or OptimizeTimeScaling methods instead. More...
#include <TimeScaling.h>
Public Member Functions | |
int | TimeToSegment (Real t) const |
evaluation (params and times structures must be set up first) | |
Real | TimeToParam (Real t) const |
Real | TimeToParam (int segment, Real t) const |
Real | TimeToParamDeriv (int segment, Real t) const |
Real | TimeToParamAccel (int segment, Real t) const |
int | ParamToSegment (Real s) const |
Real | ParamToTime (Real s) const |
Real | ParamToTime (int segment, Real s) const |
bool | SolveMinTime (const Vector &vmin, const Vector &vmax, const Vector &amin, const Vector &amax, const vector< Real > ¶mdivs, const vector< Vector > &dxMins, const vector< Vector > &dxMaxs, const vector< Vector > &ddxMins, const vector< Vector > &ddxMaxs, Real ds0=-1, Real dsEnd=-1, vector< pair< int, int > > *velocityLimitedVariables=NULL, vector< pair< int, int > > *accelerationLimitedSegments=NULL) |
bool | SolveMinTime (const Vector &vmin, const Vector &vmax, const Vector &amin, const Vector &amax, const GeneralizedCubicBezierSpline &path, Real ds0=-1, Real dsEnd=-1) |
bool | SolveMinTime (const Vector &vmin, const Vector &vmax, const Vector &amin, const Vector &amax, const vector< Real > ¶mdivs, const vector< Vector > &dxs, Real ds0=-1, Real dsEnd=-1) |
convenience approximation function – assumes all segments are monotonic | |
void | ConditionMinTime (vector< Real > ¶mdivs, vector< Vector > &dxs, vector< Vector > &dxMins, vector< Vector > &dxMaxs, vector< Vector > &ddxMins, vector< Vector > &ddxMaxs) |
bool | SolveMinTimeArcLength (const Vector &vmin, const Vector &vmax, const Vector &amin, const Vector &amax, const vector< Real > ¶mdivs, const vector< Vector > &dxMins, const vector< Vector > &dxMaxs, const vector< Vector > &ddxMins, const vector< Vector > &ddxMaxs, Real ds0=-1, Real dsEnd=-1) |
bool | SolveMinTimeArcLength (const Vector &vmin, const Vector &vmax, const Vector &amin, const Vector &amax, const vector< Real > ¶mdivs, const vector< Vector > &dxs, Real ds0=-1, Real dsEnd=-1) |
convenience approximation function – assumes all segments are monotonic | |
void | GetTimeToParam (Spline::PiecewisePolynomial &poly) const |
Retreives the piecewise polynomial time-to-parameter mapping. | |
Public Attributes | |
Spline::TimeSegmentation | params |
Spline::TimeSegmentation | times |
vector< Real > | ds |
Maps time into a given path parameter range (e.g., [0,1]) with joint space velocity and acceleration bounds. Stores a piecewise quadratic time scaling. Most users will use the TimeScaledBezierCurve class or OptimizeTimeScaling methods instead.
The optimization techniques are numerically stable.
Usage: call any of the SolveMinTime routines. Then, either evaluate the time scale s(t) using the TimeToSegment/TimeToParam routines, or extract s(t) completely as a a piecewise polynomial function using the GetTimeToParam routine.
Note: most Klamp't users will want to use the much more convenient functions in RobotTimeScaling.h.
void Klampt::TimeScaling::ConditionMinTime | ( | vector< Real > & | paramdivs, |
vector< Vector > & | dxs, | ||
vector< Vector > & | dxMins, | ||
vector< Vector > & | dxMaxs, | ||
vector< Vector > & | ddxMins, | ||
vector< Vector > & | ddxMaxs | ||
) |
Sort of improves the conditioning of the time scaling near singularities – support is experimental
bool Klampt::TimeScaling::SolveMinTime | ( | const Vector & | vmin, |
const Vector & | vmax, | ||
const Vector & | amin, | ||
const Vector & | amax, | ||
const vector< Real > & | paramdivs, | ||
const vector< Vector > & | dxMins, | ||
const vector< Vector > & | dxMaxs, | ||
const vector< Vector > & | ddxMins, | ||
const vector< Vector > & | ddxMaxs, | ||
Real | ds0 = -1 , |
||
Real | dsEnd = -1 , |
||
vector< pair< int, int > > * | velocityLimitedVariables = NULL , |
||
vector< pair< int, int > > * | accelerationLimitedSegments = NULL |
||
) |
Finds an optimal time parameterization s(t) of a path with bounded velocity and acceleration. Stores the result in this->params, times, and ds.
Arguments:
Returns true if a time scaling that satisfies all constraints could be found
bool Klampt::TimeScaling::SolveMinTime | ( | const Vector & | vmin, |
const Vector & | vmax, | ||
const Vector & | amin, | ||
const Vector & | amax, | ||
const GeneralizedCubicBezierSpline & | path, | ||
Real | ds0 = -1 , |
||
Real | dsEnd = -1 |
||
) |
Same as above, but uses a more effective derivative bounding technique assuming a cartesian space.
bool Klampt::TimeScaling::SolveMinTimeArcLength | ( | const Vector & | vmin, |
const Vector & | vmax, | ||
const Vector & | amin, | ||
const Vector & | amax, | ||
const vector< Real > & | paramdivs, | ||
const vector< Vector > & | dxMins, | ||
const vector< Vector > & | dxMaxs, | ||
const vector< Vector > & | ddxMins, | ||
const vector< Vector > & | ddxMaxs, | ||
Real | ds0 = -1 , |
||
Real | dsEnd = -1 |
||
) |
Same as above except that the time parameterization is on the arc-length version of the given path. The user must take care of the arc-length separately.