KrisLibrary
1.0.0
|
A planner that minimizes the the number of violated constraints using a RRT-like strategy. More...
#include <MCRPlanner.h>
Classes | |
struct | Edge |
struct | Milestone |
struct | Mode |
struct | Transition |
Public Types | |
typedef Graph::UndirectedGraph< Milestone, Edge > | Roadmap |
typedef Graph::UndirectedGraph< Mode, Transition > | ModeGraph |
Public Member Functions | |
MCRPlanner (CSpace *space) | |
void | Init (const Config &start, const Config &goal) |
void | Expand (Real maxExplanationCost, std::vector< int > &newNodes) |
Performs one iteration of planning given a limit on the explanation size. | |
void | Expand2 (Real maxExplanationCost, std::vector< int > &newNodes) |
void | Plan (int initialLimit, const std::vector< int > &expansionSchedule, std::vector< int > &bestPath, Subset &cover) |
Performs bottom-up planning according to a given limit expansion schedule. | |
void | BuildRoadmap (Real maxExplanationCost, RoadmapPlanner &prm) |
Outputs the graph with the given explanation limit. | |
void | BuildCCGraph (Graph::UndirectedGraph< Subset, int > &G) |
bool | CoveragePath (int s, int t, const Subset &cover, std::vector< int > &path, Subset &pathCover) |
A search that finds a path subject to a coverage constraint. | |
bool | GreedyPath (int s, int t, std::vector< int > &path, Subset &pathCover) |
A greedy heuristic that performs smallest cover given predecessor. | |
bool | OptimalPath (int s, int t, std::vector< int > &path, Subset &pathCover) |
An optimal search. | |
void | Completion (int s, int node, int t, Subset &pathCover) |
Real | Cost (const Subset &s) const |
int | AddNode (const Config &q, int parent=-1) |
int | AddNode (const Config &q, const Subset &subset, int parent=-1) |
bool | AddEdge (int i, int j, int depth=0) |
int | AddEdge (int i, const Config &q, Real maxExplanationCost) |
void | AddEdgeRaw (int i, int j) |
int | ExtendToward (int i, const Config &qdest, Real maxExplanationCost) |
void | KNN (const Config &q, int k, std::vector< int > &neighbors, std::vector< Real > &distances) |
void | KNN (const Config &q, Real maxExplanationCost, int k, std::vector< int > &neighbors, std::vector< Real > &distances) |
void | UpdatePathsGreedy () |
void | UpdatePathsComplete () |
void | UpdatePathsGreedy2 (int nstart=-1) |
void | UpdatePathsComplete2 (int nstart=-1) |
bool | CanImproveConnectivity (const Mode &ma, const Mode &mb, Real maxExplanationCost) |
void | UpdateMinCost (Mode &m) |
bool | ExceedsCostLimit (const Config &q, Real limit, Subset &violations) |
bool | ExceedsCostLimit (const Config &a, const Config &b, Real limit, Subset &violations) |
void | GetCover (const std::vector< int > &path, Subset &cover) const |
Computes the cover of the path. | |
Real | GetLength (const std::vector< int > &path) const |
Computes the length of the path. | |
void | GetMilestonePath (const std::vector< int > &path, MilestonePath &mpath) const |
Returns the MilestonePath. | |
Public Attributes | |
Config | start |
Config | goal |
CSpace * | space |
std::vector< Real > | obstacleWeights |
int | numConnections |
Real | connectThreshold |
Real | expandDistance |
Real | goalConnectThreshold |
Real | goalBiasProbability |
bool | bidirectional |
bool | updatePathsComplete |
bool | updatePathsDynamic |
int | updatePathsMax |
For complete planning, keep at most this number of covers. | |
Roadmap | roadmap |
ModeGraph | modeGraph |
int | numExpands |
int | numRefinementAttempts |
int | numRefinementSuccesses |
int | numExplorationAttempts |
int | numEdgeChecks |
int | numConfigChecks |
int | numUpdatePaths |
int | numUpdatePathsIterations |
double | timeNearestNeighbors |
double | timeRefine |
double | timeExplore |
double | timeUpdatePaths |
double | timeOverhead |
A planner that minimizes the the number of violated constraints using a RRT-like strategy.
Usage: //first, set up ExplicitCSpace cspace. MCRPlanner planner(&cspace); planner.Init(start,goal);
//do planning with a given expansion schedule vector<int> schedule; schedule.push_back(limit1); ... schedule.push_back(limitN); Subset cover; vector<int> bestPlan; planner.Plan(0,schedule,bestPlan,cover);
//output best path MilestonePath path; planner.GetMilestonePath(bestPlan,path);
void MCRPlanner::BuildCCGraph | ( | Graph::UndirectedGraph< Subset, int > & | G | ) |
Outputs the CC graph. Each node is a connected component of the roadmap within the same subset.
References Graph::Graph< Node, Edge >::AddNode().
void MCRPlanner::Completion | ( | int | s, |
int | node, | ||
int | t, | ||
Subset & | pathCover | ||
) |
Returns the cover of the path from s->node + completion(node,goal) where the path cover is determined using the greedy heuristic
References AI::GeneralizedAStar< S, C >::goal, and AI::GeneralizedAStar< S, C >::Search().
bool MCRPlanner::updatePathsComplete |
If true: use the slower complete, exact cover update. If false: use the faster greedy one.
Referenced by MCRPlannerGoalSet::Expand().
bool MCRPlanner::updatePathsDynamic |
If true: do dynamic shortest paths update If false: do batch updates when needed
Referenced by MCRPlannerGoalSet::Expand().