KrisLibrary
1.0.0
|
Stores a kinodynamic path with piecewise constant controls. More...
#include <KinodynamicPath.h>
Public Member Functions | |
KinodynamicMilestonePath (const ControlInput &u, const InterpolatorPtr &path) | |
virtual const Config & | Start () const |
virtual const Config & | End () const |
virtual void | Eval (Real u, Config &q) const |
virtual Real | Length () const |
bool | Empty () const |
bool | IsConstant () const |
CSpace * | Space () const |
int | NumMilestones () const |
const Config & | GetMilestone (int i) const |
void | Clear () |
void | SimulateFromControls (KinodynamicSpace *space) |
Given milestones and controls, creates the paths and path checkers. | |
void | MakePaths (ControlSpace *space) |
Given existing milestones and controls, creates the paths. | |
void | MakePaths (KinodynamicSpace *space) |
void | MakeEdges (KinodynamicSpace *space) |
void | Append (const ControlInput &u, KinodynamicSpace *space) |
void | Append (const ControlInput &u, const InterpolatorPtr &path, KinodynamicSpace *space) |
void | Append (const ControlInput &u, const InterpolatorPtr &path, const EdgePlannerPtr &e) |
void | Concat (const KinodynamicMilestonePath &suffix) |
bool | IsValid () const |
bool | IsFeasible () |
int | Eval2 (Real u, Config &q) const |
Real | StartTime (int timeindex=0) const |
For timed path, returns the start time. | |
Real | EndTime (int timeindex=0) const |
For timed path, returns the end time. | |
Real | Duration (int timeIndex=0) const |
For timed path, returns the duration of the known path. | |
int | EvalTime (Real t, Config &q, int timeIndex=0) const |
void | SplitTime (Real t, KinodynamicMilestonePath &before, KinodynamicMilestonePath &after, int timeIndex=0) const |
bool | IsValidTime (int timeIndex=0) const |
int | Shortcut (KinodynamicSpace *space, SteeringFunction *fn) |
int | Reduce (KinodynamicSpace *space, SteeringFunction *fn, int numIters) |
void | Splice (Real u1, Real u2, const KinodynamicMilestonePath &path, KinodynamicSpace *space=NULL) |
void | Splice2 (int start, int goal, const KinodynamicMilestonePath &path) |
Public Member Functions inherited from Interpolator | |
virtual Real | ParamStart () const |
virtual Real | ParamEnd () const |
Public Attributes | |
std::vector< State > | milestones |
std::vector< ControlInput > | controls |
std::vector< InterpolatorPtr > | paths |
std::vector< EdgePlannerPtr > | edges |
Stores a kinodynamic path with piecewise constant controls.
Must satisfy the property that milestones[i+1] = f(milestones[i],controls[i]), and the simulation trace is stored in paths[i]. Optionally, edges[i] can store the trajectory checker.
The Duration and Time methods assume there's some state variable that indexes time. This variable must be monotonically nondecreasing along the path. by default it is element 0, which is compatible with all the SpaceTime* spaces in TimeCSpace.h
void KinodynamicMilestonePath::MakeEdges | ( | KinodynamicSpace * | space | ) |
Given existing milestones, controls, and (optionally) paths, creates the path checkers. If paths are not filled out, SimulateFromControls is called.
References KinodynamicSpace::Simulate(), and KinodynamicSpace::TrajectoryChecker().
Referenced by KinodynamicTree::DeleteSubTree(), Reduce(), and Splice().
int KinodynamicMilestonePath::Reduce | ( | KinodynamicSpace * | space, |
SteeringFunction * | fn, | ||
int | numIters | ||
) |
Tries to shorten the path by connecting random points with a shortcut, for numIters iterations. Returns # of shortcuts The steering function must be exact!
References MakeEdges(), and Math::Rand().
Referenced by Duration().
int KinodynamicMilestonePath::Shortcut | ( | KinodynamicSpace * | space, |
SteeringFunction * | fn | ||
) |
Tries to shorten the path by connecting subsequent milestones. Returns # of shortcuts made. The steering function must be exact!
References SimulateFromControls().
Referenced by Duration().
void KinodynamicMilestonePath::Splice | ( | Real | u1, |
Real | u2, | ||
const KinodynamicMilestonePath & | path, | ||
KinodynamicSpace * | space = NULL |
||
) |
Replaces the section of the path between parameters u1 and u2 with a new path. If u1 < 0 or u2 > Length(), erases the corresponding start/goal milestones too. If the edges of this path are made, the space needs to be passed in in the 4th argument.
assume it the control scales
assume it the control scales
References MakeEdges().
Referenced by Duration().
void KinodynamicMilestonePath::Splice2 | ( | int | start, |
int | goal, | ||
const KinodynamicMilestonePath & | path | ||
) |
Replaces the section of the path between milestones start and goal with a new path. If the index is negative, erases the corresponding start/goal milestones too.
Referenced by Duration().