Loading...
Searching...
No Matches
RandomGeometricGraph.cpp
54 RandomGeometricGraph::RandomGeometricGraph(const std::shared_ptr<ompl::base::SpaceInformation> &spaceInfo,
202 // First update the goals. We have to call inputStates->nextGoal(terminationCondition) at least once
203 // (regardless of the return value of inputStates->moreGoalStates()) in case the termination condition
209 // Get a new goal. If there are none, or the underlying state is invalid this will be a nullptr.
241 // If we added a new start and have previously pruned goals, we might want to add the goals back.
275 // If we added a new goal and have previously pruned starts, we might want to add the starts back.
492 RandomGeometricGraph::getNewSample(const ompl::base::PlannerTerminationCondition &terminationCondition)
586 // because all new states will be in the informed set, and its known how many of them will be added.
843 // Count the number of samples that can possibly improve the solution and subtract the start and goal
866 return objective_->isCostBetterThan(solutionCost_, objective_->combineCosts(costToCome, costToGo));
870 ompl::base::Cost RandomGeometricGraph::lowerBoundCostToCome(const std::shared_ptr<State> &state) const
883 unsigned int RandomGeometricGraph::lowerBoundEffortToCome(const std::shared_ptr<State> &state) const
886 // (it is possible to compute a better bound, but empirically, it is not worth the computational
894 // The minimum number of collision checks from any of the starts to the state we are checking for.
905 unsigned int RandomGeometricGraph::inadmissibleEffortToCome(const std::shared_ptr<State> &state) const
916 ompl::base::Cost RandomGeometricGraph::lowerBoundCostToGo(const std::shared_ptr<State> &state) const
962 std::size_t RandomGeometricGraph::computeNumberOfNeighbors(std::size_t numInformedSamples) const
969 // Compute and return the radius. Note to self: double / int -> double. You looked it up. It's fine.
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition Cost.h:48
virtual bool sampleUniform(State *statePtr, const Cost &maxCost)=0
Sample uniformly in the subset of the state space whose heuristic solution estimates are less than th...
virtual bool isFinite(Cost cost) const
Returns whether the cost is finite or not.
Definition OptimizationObjective.cpp:81
virtual Cost motionCostHeuristic(const State *s1, const State *s2) const
Defines an admissible estimate on the optimal cost on the motion between states s1 and s2....
Definition OptimizationObjective.cpp:166
virtual Cost identityCost() const
Get the identity cost value. The identity cost value is the cost c_i such that, for all costs c,...
Definition OptimizationObjective.cpp:106
virtual Cost combineCosts(Cost c1, Cost c2) const
Get the cost that corresponds to combining the costs c1 and c2. Default implementation defines this c...
Definition OptimizationObjective.cpp:96
virtual bool isCostBetterThan(Cost c1, Cost c2) const
Check whether the the cost c1 is considered better than the cost c2. By default, this returns true if...
Definition OptimizationObjective.cpp:70
virtual Cost betterCost(Cost c1, Cost c2) const
Return the minimum cost given c1 and c2. Uses isCostBetterThan.
Definition OptimizationObjective.cpp:86
virtual Cost infiniteCost() const
Get a cost which is greater than all other costs in this OptimizationObjective; required for use in D...
Definition OptimizationObjective.cpp:111
Helper class to extract valid start & goal states. Usually used internally by planners.
Definition Planner.h:78
bool haveMoreStartStates() const
Check if there are more potential start states.
Definition Planner.cpp:339
const State * nextStart()
Return the next valid start state or nullptr if no more valid start states are available.
Definition Planner.cpp:228
bool haveMoreGoalStates() const
Check if there are more potential goal states.
Definition Planner.cpp:346
const State * nextGoal(const PlannerTerminationCondition &ptc)
Return the next valid goal state or nullptr if no more valid goal states are available....
Definition Planner.cpp:265
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
Definition PlannerTerminationCondition.h:64
bool isValid(const State *state) const
Check if a given state is valid or not.
Definition SpaceInformation.h:94
virtual unsigned int validSegmentCount(const State *state1, const State *state2) const
Count how many segments of the "longest valid length" fit on the motion from state1 to state2.
Definition StateSpace.cpp:851
void setEffortThreshold(const unsigned int threshold)
Sets the effort threshold.
Definition RandomGeometricGraph.cpp:360
std::vector< std::shared_ptr< State > > getStates() const
Returns all sampled states (that have not been pruned).
Definition RandomGeometricGraph.cpp:417
std::size_t getTag() const
Returns the tag of the current RGG.
Definition RandomGeometricGraph.cpp:442
bool getUseKNearest() const
Returns whether the graph uses a k-nearest connection model. If false, it uses an r-disc model.
Definition RandomGeometricGraph.cpp:655
void registerWhitelistedState(const std::shared_ptr< State > &state) const
Registers a whitelisted state.
Definition RandomGeometricGraph.cpp:486
unsigned int getEffortThreshold() const
Gets the effort threshold.
Definition RandomGeometricGraph.cpp:365
RandomGeometricGraph(const std::shared_ptr< ompl::base::SpaceInformation > &spaceInfo, const ompl::base::Cost &solutionCost)
Constructs a random geometric graph with the given space information and reference to the current sol...
Definition RandomGeometricGraph.cpp:54
const std::vector< std::shared_ptr< State > > & getGoalStates() const
Returns the goal states.
Definition RandomGeometricGraph.cpp:375
std::vector< std::weak_ptr< State > > getNeighbors(const std::shared_ptr< State > &state) const
Returns the neighbors of a state.
Definition RandomGeometricGraph.cpp:671
void prune()
Prunes the graph of states that can not improve the current solution.
Definition RandomGeometricGraph.cpp:776
void setUseKNearest(bool useKNearest)
Set whether to use a k-nearest connection model. If false, it uses an r-disc model.
Definition RandomGeometricGraph.cpp:650
void clearQuery()
Clears all query-specific structures, such as start and goal states.
Definition RandomGeometricGraph.cpp:164
bool hasStartState() const
Returns whether a start state is available.
Definition RandomGeometricGraph.cpp:395
unsigned int getMaxNumberOfGoals() const
Returns the maximum number of goals EIT* will sample from sampleable goal regions.
Definition RandomGeometricGraph.cpp:665
bool hasGoalState() const
Returns whether a goal state is available.
Definition RandomGeometricGraph.cpp:400
bool isStart(const std::shared_ptr< State > &state) const
Returns whether the given state is a start state.
Definition RandomGeometricGraph.cpp:405
double getRadiusFactor() const
Returns the radius factor (eta in the paper).
Definition RandomGeometricGraph.cpp:355
unsigned int getNumberOfNearestNeighborCalls() const
Returns the number of nearest neighbor calls.
Definition RandomGeometricGraph.cpp:390
bool isGoal(const std::shared_ptr< State > &state) const
Returns whether the given state is a goal state.
Definition RandomGeometricGraph.cpp:411
const std::vector< std::shared_ptr< State > > & getStartStates() const
Returns the start states.
Definition RandomGeometricGraph.cpp:370
unsigned int getNumberOfSampledStates() const
Returns the number of sampled states.
Definition RandomGeometricGraph.cpp:380
void setMaxNumberOfGoals(unsigned int maxNumberOfGoals)
Sets the maximum number of goals EIT* will sample from sampleable goal regions.
Definition RandomGeometricGraph.cpp:660
std::shared_ptr< State > registerStartState(const ompl::base::State *start)
Sets the start state.
Definition RandomGeometricGraph.cpp:447
bool addStates(std::size_t numStates, const ompl::base::PlannerTerminationCondition &terminationCondition)
Samples random states and adds them to the graph.
Definition RandomGeometricGraph.cpp:545
unsigned int getNumberOfValidSamples() const
Returns the number of valid samples.
Definition RandomGeometricGraph.cpp:385
void clear()
Clears all internal planner structures but retains settings. Subsequent calls to solve() will start f...
Definition RandomGeometricGraph.cpp:104
void registerInvalidEdge(const Edge &edge) const
Registers an invalid edge.
Definition RandomGeometricGraph.cpp:424
bool isMultiqueryEnabled() const
Returns Whether multiquery usage of the graph is enabled.
Definition RandomGeometricGraph.cpp:645
void updateStartAndGoalStates(const ompl::base::PlannerTerminationCondition &terminationCondition, ompl::base::PlannerInputStates *inputStates)
Adds new starts and goals to the graph if available and creates a new informed sampler if necessary.
Definition RandomGeometricGraph.cpp:194
void enableMultiquery(bool multiquery)
Enable multiquery usage of the graph.
Definition RandomGeometricGraph.cpp:640
ompl::base::Cost minPossibleCost() const
Returns the minimum possible cost for the current problem, using admissible cost estimates to calcula...
Definition RandomGeometricGraph.cpp:345
bool isPruningEnabled() const
Returns Whether pruning is enabled.
Definition RandomGeometricGraph.cpp:635
std::shared_ptr< State > registerGoalState(const ompl::base::State *goal)
Sets the goal state.
Definition RandomGeometricGraph.cpp:467
unsigned int inadmissibleEffortToCome(const std::shared_ptr< State > &state) const
Returns the inadmissible effort to come.
Definition RandomGeometricGraph.cpp:905
void setup(const std::shared_ptr< ompl::base::ProblemDefinition > &problem, ompl::base::PlannerInputStates *inputStates)
Setup the graph with the given problem definition and planner input states.
Definition RandomGeometricGraph.cpp:71
void setRadiusFactor(double factor)
Sets the radius factor (eta in the paper).
Definition RandomGeometricGraph.cpp:350
PlannerTerminationCondition plannerAlwaysTerminatingCondition()
Simple termination condition that always returns true. The termination condition will always be met.
Definition PlannerTerminationCondition.cpp:184
This namespace contains code that is specific to planning under geometric constraints.
Definition GeneticSearch.h:48
Main namespace. Contains everything in this library.
Definition MultiLevelPlanarManipulatorDemo.cpp:66
double unitNBallMeasure(unsigned int N)
The Lebesgue measure (i.e., "volume") of an n-dimensional ball with a unit radius.
Definition GeometricEquations.cpp:55