1 #ifndef ROBOTICS_MOTION_PLANNER_H 2 #define ROBOTICS_MOTION_PLANNER_H 4 #include <KrisLibrary/graph/Tree.h> 5 #include <KrisLibrary/graph/UndirectedGraph.h> 6 #include <KrisLibrary/graph/ConnectedComponents.h> 10 #include "EdgePlanner.h" 32 virtual void Cleanup();
33 virtual void GenerateConfig(
Config& x);
34 virtual int AddMilestone(
const Config& x);
35 virtual int TestAndAddMilestone(
const Config& x);
36 virtual void ConnectEdge(
int i,
int j,
const EdgePlannerPtr& e);
37 virtual EdgePlannerPtr TestAndConnectEdge(
int i,
int j);
38 virtual bool HasEdge(
int i,
int j) {
return roadmap.FindEdge(i,j)!=NULL; }
39 virtual EdgePlannerPtr GetEdge(
int i,
int j) {
return *roadmap.FindEdge(i,j); }
40 virtual bool AreConnected(
int i,
int j) {
return ccs.SameComponent(i,j); }
41 virtual bool AreConnected(
int i,
int j)
const {
return ccs.SameComponent(i,j); }
42 virtual void ConnectToNeighbors(
int i,Real connectionThreshold,
bool ccReject=
true);
43 virtual void ConnectToNearestNeighbors(
int i,
int k,
bool ccReject=
true);
44 virtual void Generate(
int numSamples,Real connectionThreshold);
54 std::shared_ptr<PointLocationBase> pointLocator;
73 int connectedComponent;
81 virtual void GenerateConfig(
Config& x);
82 virtual Node* AddMilestone(
const Config& x);
83 virtual Node* TestAndAddMilestone(
const Config& x);
84 virtual Node* AddInfeasibleMilestone(
const Config& x) {
return NULL; }
85 virtual Node* Extend();
86 virtual void Cleanup();
87 virtual void ConnectToNeighbors(Node*);
88 virtual EdgePlannerPtr TryConnect(Node*,Node*);
89 virtual void DeleteSubtree(Node* n);
92 virtual Node* ClosestMilestone(
const Config& x);
93 virtual int ClosestMilestoneIndex(
const Config& x);
95 virtual Node* ClosestMilestoneInComponent(
int component,
const Config& x);
96 virtual Node* ClosestMilestoneInSubtree(Node* node,
const Config& x);
97 Node* Extend(Node* n,
const Config& x);
98 Node* TryExtend(Node* n,
const Config& x);
99 void AttachChild(Node* p, Node* c,
const EdgePlannerPtr& e);
100 Node* SplitEdge(Node* p,Node* n,Real u);
110 std::vector<Node*> connectedComponents;
111 Real connectionThreshold;
114 std::vector<Vector> milestoneConfigs;
115 std::vector<Node*> milestones;
116 std::shared_ptr<PointLocationBase> pointLocator;
133 virtual void GenerateConfig(
Config& x);
135 virtual void Cleanup();
138 virtual Node* SelectMilestone(
const std::vector<Node*>& milestones);
157 virtual Node* Extend();
Definition: ConnectedComponents.h:9
A base class to be used for tree-based roadmap planners.
Definition: MotionPlanner.h:66
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
A sequence of locally planned paths between milestones.
Definition: planning/Path.h:18
A uniform abstract interface to point location data structures. The point locator operators in-place ...
Definition: PointLocation.h:14
virtual void CreatePath(int i, int j, MilestonePath &path)
Creates the shortest path from i to j. These MUST be in the same connected component.
Definition: MotionPlanner.cpp:216
A tree-based randomized planner that extends the roadmap by sampling the neighborhood of existing sam...
Definition: MotionPlanner.h:129
A tree graph structure, represented directly at the node level.
Definition: Tree.h:25
A base roadmap planner class.
Definition: MotionPlanner.h:24
Definition: MotionPlanner.h:69
Real delta
Neighborhood distance.
Definition: MotionPlanner.h:141
A single-query RRT (Rapidly-Exploring Random Tree) planner.
Definition: MotionPlanner.h:171
std::vector< Real > weights
Node selection weights.
Definition: MotionPlanner.h:143
virtual Real OptimizePath(int i, const std::vector< int > &goals, ObjectiveFunctionalBase *cost, MilestonePath &path)
Definition: MotionPlanner.cpp:267
A basic RRT (Rapidly-Exploring Random Tree) planner.
Definition: MotionPlanner.h:153
A base class for objective functionals of the form J[x,u] = sum_0^N-1 L(xi,ui) dt + Phi(xN) ...
Definition: Objective.h:18