Klamp't  0.8.1
Public Member Functions | Public Attributes | List of all members
TimeScaling Class Reference

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 > &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)
 
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 > &paramdivs, const vector< Vector > &dxs, Real ds0=-1, Real dsEnd=-1)
 convenience approximation function – assumes all segments are monotonic
 
void ConditionMinTime (vector< Real > &paramdivs, 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 > &paramdivs, 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 > &paramdivs, 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
 

Detailed Description

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.

Member Function Documentation

void 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 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:

  • vmin,vmax: velocity bounds
  • amin,amax: acceleration bounds
  • paramdivs: a list of path segment parameters s1,...,sN
  • dxMins,dxMaxs: a list of 1st derivative bounds on each of the N-1 segments [si,si+1]
  • ddxMins,ddxMaxs: a list of 2nd derivative bounds on each of the N-1 segments [si,si+1].
  • ds0, dsEnd: if nonnegative, constrains the start and end velocity s'(0) and s'(T), respectively
  • velocityLimitedVariables (out): if != NULL, returns a list of pairs (param,dim) where the velocity limit on dof dim is active at is params[param].
  • accelerationLimitedSegments (out): if != NULL, returns a list of pairs (seg,dim) where the acceleration limit on dof dim is active over the range of s from [params[seg],params[seg+1]]

Returns true if a time scaling that satisfies all constraints could be found

bool 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 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.


The documentation for this class was generated from the following file: