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

A motion queue that runs on a piecewise polynomial path. Can be commanded to reach configurations (with or without velocities specified) smoothly using piecewise linear or cubic curves. More...

#include <PathController.h>

Inheritance diagram for PolynomialMotionQueue:
PolynomialPathController

Public Member Functions

void SetLimits (const Robot &robot)
 
void SetConstant (const Config &x)
 Sets a constant trajectory.
 
void SetPath (const Spline::PiecewisePolynomialND &path)
 Sets the trajectory from a PiecewisePolynomialND.
 
void SetPath (const ParabolicRamp::DynamicPath &path)
 Sets the trajectory from a DynamicPath.
 
void SetPiecewiseLinear (const vector< Config > &milestones, const vector< Real > &times)
 
void SetPiecewiseCubic (const vector< Config > &milestones, const vector< Vector > &velocities, const vector< Real > &times)
 
void SetPiecewiseLinearRamp (const vector< Config > &milestones)
 
void Advance (Real dt)
 Moves forward the internal time marker.
 
void Append (const Spline::PiecewisePolynomialND &path)
 
void Append (const ParabolicRamp::DynamicPath &path)
 Appends a DynamicPath.
 
void AppendLinear (const Config &config, Real dt)
 
void AppendCubic (const Config &x, const Config &v, Real dt)
 
void AppendRamp (const Config &x)
 Appends a time-optimal ramp from the end configuration/velocity to x.
 
void AppendLinearRamp (const Config &x)
 
void AppendRamp (const Config &x, const Vector &v)
 
void GetPath (Spline::PiecewisePolynomialND &path) const
 Retrieves the path, defined on the range [t0,t0+T].
 
void Cut (Real time, bool relative=true)
 
Real CurTime () const
 Returns the current time t0.
 
Config CurConfig () const
 Returns the configuration at the current time y(t0)
 
Config CurVelocity () const
 Returns the velocity at the current time y'(t0)
 
Config Endpoint () const
 Returns the configuration at the end time y(t0+T)
 
Vector EndpointVelocity () const
 Returns the velocity at the end time y'(t0+T)
 
void Eval (Real time, Config &x, bool relative=true) const
 
void Deriv (Real time, Config &dx, bool relative=true) const
 
bool Done () const
 Returns true if there is no more trajectory to be executed.
 
Real TimeRemaining () const
 Returns the duration of the trajectory remaining to be executed.
 

Public Attributes

Real pathOffset
 
Spline::PiecewisePolynomialND path
 
Vector qMin
 
Vector qMax
 
Vector velMax
 
Vector accMax
 

Detailed Description

A motion queue that runs on a piecewise polynomial path. Can be commanded to reach configurations (with or without velocities specified) smoothly using piecewise linear or cubic curves.

The motion queue stores a trajectory y(t) and an offset t0 designating the parameter along the trajectory at the current time. The current configuration will be y(t0)

y(t) is defined on the range [t0,t0+T] where T is the time remaining to be executed. Relative time is specified relative to t0, and "absolute" time is specified relative to t=0 (which may not have any relation to true time). As time advances, call Advance(dt) to shift the

Note: discontinuity checking is not performed. As a result, the caller must be careful about SetConstant, SetPath, SetPiecewise[X], and Append functions to make sure the endpoint of the queue matches the beginning of the new path.

The [X]Ramp functions allow you to add time-optimal acceleration-bounded "ramps". Configuration bounds are also handled. In order to use these functions you will first need to fill out the accMax and velMax members. If you wish ramps to obey joint limits, fill out qMin and qMax. Or, you can just call SetLimits(robot) for your robot model to set these limits from your robot..

Member Function Documentation

void PolynomialMotionQueue::Append ( const Spline::PiecewisePolynomialND &  path)

Appends a PiecewisePolynomialND. Performed as a relative append; Assumes the spline is defined on the domain [0,x] and the duration of the current trajectory by x

void PolynomialMotionQueue::AppendCubic ( const Config &  x,
const Config &  v,
Real  dt 
)

Appends a cubic interpolation from the end configuration/velocity to reach config x at velocity v over duration dt

void PolynomialMotionQueue::AppendLinear ( const Config &  config,
Real  dt 
)

Appends a linear interpolation from the end configuration to config over duration dt

void PolynomialMotionQueue::AppendLinearRamp ( const Config &  x)

Appends a time-optimal ramp from the end configuration to x along a straight line joint-space path.

void PolynomialMotionQueue::AppendRamp ( const Config &  x,
const Vector &  v 
)

Appends a time-optimal ramp from the end configuration/velocity to x with velocity v.

void PolynomialMotionQueue::Cut ( Real  time,
bool  relative = true 
)

Cuts off the portion of the path after y(t0+time) if relative=true, or y(time) if relative=false

void PolynomialMotionQueue::Deriv ( Real  time,
Config &  dx,
bool  relative = true 
) const

Evaluates the derivative dx=y'(t0+time) if relative=true, or dx=y'(time) if relative=false

void PolynomialMotionQueue::Eval ( Real  time,
Config &  x,
bool  relative = true 
) const

Evaluates the trajectory x=y(t0+time) if relative=true, or x=y(time) if relative=false

void PolynomialMotionQueue::SetLimits ( const Robot robot)

Automatically sets the velocity/acceleration/joint limits for the given robot model

void PolynomialMotionQueue::SetPiecewiseCubic ( const vector< Config > &  milestones,
const vector< Vector > &  velocities,
const vector< Real > &  times 
)

Sets a piecewise cubic path using Hermite interpolation, interpolating the given milestones and velocities at the given times

void PolynomialMotionQueue::SetPiecewiseLinear ( const vector< Config > &  milestones,
const vector< Real > &  times 
)

Sets a piecewise linear path interpolating the given milestones at the given times

void PolynomialMotionQueue::SetPiecewiseLinearRamp ( const vector< Config > &  milestones)

Sets a piecewise cubic path that moves along straight-line paths between the given milestones, but starting and stopping using optimal accelerations.

Member Data Documentation

Vector PolynomialMotionQueue::qMin

Limits that are used for [X]Ramp functions. velMax and accMax are mandatory; qMin and qMax are optional.


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