KrisLibrary  1.0.0
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
MCRPlannerGoalSet Class Reference

A planner that minimizes the the number of violated constraints using a RRT-like strategy. More...

#include <MCRPlannerGoalSet.h>

Classes

struct  Edge
 
struct  Milestone
 
struct  Mode
 
struct  Transition
 

Public Types

typedef Graph::UndirectedGraph< Milestone, EdgeRoadmap
 
typedef Graph::UndirectedGraph< Mode, TransitionModeGraph
 

Public Member Functions

 MCRPlannerGoalSet (CSpace *space)
 
void Init (const Config &start, CSet *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.
 
bool GreedyPath (std::vector< int > &path, Subset &pathCover)
 Returns the best GreedyPath out of any start->goal path.
 
bool OptimalPath (std::vector< int > &path, Subset &pathCover)
 Returns the best OptimalPath out of any start->goal path.
 
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
 
CSpacespace
 
CSetgoalSet
 
Optimization::NonlinearProgramgoalNumeric
 
std::vector< int > goalNodes
 
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
 

Detailed Description

A planner that minimizes the the number of violated constraints using a RRT-like strategy.

Usage: //first, set up CSpace cspace. MCRPlannerGoalSet 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);

Member Function Documentation

void MCRPlannerGoalSet::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().

Member Data Documentation

bool MCRPlannerGoalSet::updatePathsComplete

If true: use the slower complete, exact cover update. If false: use the faster greedy one.

bool MCRPlannerGoalSet::updatePathsDynamic

If true: do dynamic shortest paths update If false: do batch updates when needed


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