KrisLibrary
1.0.0
|
A sequence of locally planned paths between milestones. More...
#include <Path.h>
Public Member Functions | |
virtual void | Eval (Real u, Config &q) const |
virtual Real | Length () const |
virtual const Config & | Start () const |
virtual const Config & | End () const |
const Config & | GetMilestone (int milestone) const |
void | SetMilestone (int milestone, const Config &x) |
bool | CheckSetMilestone (int milestone, const Config &x) |
CSpace * | Space (int i=0) const |
int | NumMilestones () const |
int | NumEdges () const |
bool | IsValid () |
void | Concat (const MilestonePath &path) |
Adds the path onto the end of this one. | |
void | CreateEdgesFromMilestones (CSpace *space, const std::vector< Config > &milestones) |
Create the path that connects the milestones in the given workspace. | |
bool | InitializeEdgePlans () |
Checks the feasibility of all edges, returns true if they all succeed. | |
bool | IsFeasible () |
Checks the feasibility of all milestones and edges, returns true if so. | |
int | Eval2 (Real t, Config &c) const |
int | Shortcut () |
int | Shortcut (ObjectiveFunctionalBase *objective) |
int | Reduce (int numIters) |
int | Reduce (int numIters, ObjectiveFunctionalBase *objective) |
void | Splice (int start, int goal, const MilestonePath &path) |
void | Discretize (Real h) |
int | DiscretizeEdge (int e, Real h) |
Discretizes only the given edge. Returns the number of new segments. | |
void | DiscretizeEdge (int e, const std::vector< Real > &u) |
Discretizes the given edge with the specified interpolation. | |
bool | Load (std::istream &in, CSpace *space) |
Loads the intermediate milestones, and creates the edges from the given space. | |
bool | Save (std::ostream &out) |
Saves the intermediate milestones. | |
Public Member Functions inherited from Interpolator | |
virtual Real | ParamStart () const |
virtual Real | ParamEnd () const |
Public Attributes | |
std::vector< EdgePlannerPtr > | edges |
A sequence of locally planned paths between milestones.
Milestones are indexed M0...Mn+1, such that segment k goes from Mk to Mk+1
Note that the parameterization of the path is uniform on the range [0,1].
bool MilestonePath::CheckSetMilestone | ( | int | milestone, |
const Config & | x | ||
) |
Sets the milestone to x only if x and the paths to adjoining milestones are feasible
void MilestonePath::Discretize | ( | Real | h | ) |
Discretizes the path such that each edge is no longer than h. Assumes straight-line path segments.
int MilestonePath::Eval2 | ( | Real | t, |
Config & | c | ||
) | const |
Supposing all milestones have equal time spacings, evaluates the point on the path at time t in [0,1]. Returns the edge of time t.
int MilestonePath::Reduce | ( | int | numIters | ) |
Tries to shorten the path by connecting random points with a shortcut, for numIters iterations. Returns # of shortcuts
References Math::Rand().
Referenced by ShortcutMotionPlanner::Plan().
int MilestonePath::Reduce | ( | int | numIters, |
ObjectiveFunctionalBase * | objective | ||
) |
Tries to reduce the path cost by connecting random points with a shortcut, for numIters iterations. Returns # of shortcuts
References ObjectiveFunctionalBase::IncrementalCost(), and Math::Rand().
int MilestonePath::Shortcut | ( | ) |
Tries to shorten the path by connecting subsequent milestones. Returns # of shortcuts made.
int MilestonePath::Shortcut | ( | ObjectiveFunctionalBase * | objective | ) |
Tries to reduce path cost by connecting subsequent milestones. Returns # of shortcuts made.
References ObjectiveFunctionalBase::IncrementalCost().
void MilestonePath::Splice | ( | int | start, |
int | goal, | ||
const MilestonePath & | 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.