1 #ifndef MCR_PLANNER_GOAL_SET_H 2 #define MCR_PLANNER_GOAL_SET_H 4 #include "MotionPlanner.h" 6 #include <KrisLibrary/utils/Subset.h> 45 std::vector<int> roadmapNodes;
46 std::vector<Subset> pathCovers;
50 std::vector<std::pair<int,int> > connections;
57 void Expand(Real maxExplanationCost,std::vector<int>& newNodes);
58 void Expand2(Real maxExplanationCost,std::vector<int>& newNodes);
60 void Plan(
int initialLimit,
const std::vector<int>& expansionSchedule,std::vector<int>& bestPath,
Subset& cover);
78 Real Cost(
const Subset& s)
const;
79 int AddNode(
const Config& q,
int parent=-1);
80 int AddNode(
const Config& q,
const Subset& subset,
int parent=-1);
81 bool AddEdge(
int i,
int j,
int depth=0);
82 int AddEdge(
int i,
const Config& q,Real maxExplanationCost);
83 void AddEdgeRaw(
int i,
int j);
84 int ExtendToward(
int i,
const Config& qdest,Real maxExplanationCost);
85 void KNN(
const Config& q,
int k,std::vector<int>& neighbors,std::vector<Real>& distances);
86 void KNN(
const Config& q,Real maxExplanationCost,
int k,std::vector<int>& neighbors,std::vector<Real>& distances);
87 void UpdatePathsGreedy();
88 void UpdatePathsComplete();
89 void UpdatePathsGreedy2(
int nstart=-1);
90 void UpdatePathsComplete2(
int nstart=-1);
93 bool CanImproveConnectivity(
const Mode& ma,
const Mode& mb,Real maxExplanationCost);
95 void UpdateMinCost(
Mode& m);
98 bool ExceedsCostLimit(
const Config& q,Real limit,
Subset& violations);
106 Real
GetLength(
const std::vector<int>& path)
const;
114 std::vector<int> goalNodes;
117 std::vector<Real> obstacleWeights;
121 Real connectThreshold,expandDistance,goalConnectThreshold;
122 Real goalBiasProbability;
139 int numExpands,numRefinementAttempts,numRefinementSuccesses,numExplorationAttempts,
140 numEdgeChecks,numConfigChecks,
141 numUpdatePaths,numUpdatePathsIterations;
142 double timeNearestNeighbors,timeRefine,timeExplore,timeUpdatePaths,timeOverhead;
int updatePathsMax
For complete planning, keep at most this number of covers.
Definition: MCRPlannerGoalSet.h:133
bool OptimalPath(int s, int t, std::vector< int > &path, Subset &pathCover)
An optimal search.
Definition: MCRPlannerGoalSet.cpp:1724
bool updatePathsDynamic
Definition: MCRPlannerGoalSet.h:131
Definition: MCRPlannerGoalSet.h:49
bool updatePathsComplete
Definition: MCRPlannerGoalSet.h:128
void Expand(Real maxExplanationCost, std::vector< int > &newNodes)
Performs one iteration of planning given a limit on the explanation size.
Definition: MCRPlannerGoalSet.cpp:990
Vector Config
an alias for Vector
Definition: RobotKinematics3D.h:14
Motion planning configuration space base class. The configuration space implements an interpolation s...
Definition: CSpace.h:39
bool GreedyPath(int s, int t, std::vector< int > &path, Subset &pathCover)
A greedy heuristic that performs smallest cover given predecessor.
Definition: MCRPlannerGoalSet.cpp:1702
A sequence of locally planned paths between milestones.
Definition: planning/Path.h:18
Definition: MCRPlannerGoalSet.h:33
Real GetLength(const std::vector< int > &path) const
Computes the length of the path.
void BuildCCGraph(Graph::UndirectedGraph< Subset, int > &G)
Definition: MCRPlannerGoalSet.cpp:1449
Definition: MCRPlannerGoalSet.h:37
Definition: MCRPlannerGoalSet.h:43
void GetMilestonePath(const std::vector< int > &path, MilestonePath &mpath) const
Returns the MilestonePath.
Definition: MCRPlannerGoalSet.cpp:1788
A base roadmap planner class.
Definition: MotionPlanner.h:24
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.
Definition: MCRPlannerGoalSet.cpp:1502
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.
Definition: MCRPlannerGoalSet.cpp:1318
void GetCover(const std::vector< int > &path, Subset &cover) const
Computes the cover of the path.
A finite subset of numbered items with convenient operators for union, intersection, difference, etc.
Definition: Subset.h:13
A planner that minimizes the the number of violated constraints using a RRT-like strategy.
Definition: MCRPlannerGoalSet.h:30
A structure defining a nonlinear program.
Definition: NonlinearProgram.h:22
A subset of a CSpace, which establishes a constraint for a configuration must meet. Mathematically, this is a set S which imposes the constraint [q in S].
Definition: CSet.h:20
void BuildRoadmap(Real maxExplanationCost, RoadmapPlanner &prm)
Outputs the graph with the given explanation limit.
Definition: MCRPlannerGoalSet.cpp:1414