Loading...
Searching...
No Matches
PathLengthDirectInfSampler.cpp
67 // The foci of the PHSs as a std::vector of states. Goals must be nonconst, as we need to allocate them
74 throw Exception("PathLengthDirectInfSampler: The direct path-length informed sampler currently only "
89 throw Exception("PathLengthDirectInfSampler: There must be at least 1 start and and 1 goal state when "
107 OMPL_WARN("PathLengthDirectInfSampler: Treating the StateSpace of type \"STATE_SPACE_UNKNOWN\" as "
165 // Case where we have a compound state space with only one subspace, and said subspace being R^N
202 informedSubSpace_ = InformedSampler::space_->as<CompoundStateSpace>()->getSubspace(informedIdx_);
205 uninformedSubSpace_ = InformedSampler::space_->as<CompoundStateSpace>()->getSubspace(uninformedIdx_);
276 bool PathLengthDirectInfSampler::sampleUniform(State *statePtr, const Cost &minCost, const Cost &maxCost)
323 // The informed measure is then the sum of the measure of the individual PHSs for the given cost:
367 bool PathLengthDirectInfSampler::sampleUniform(State *statePtr, const Cost &maxCost, unsigned int *iters)
393 // When the summed measure of the PHSes are suitably large, it makes more sense to just sample from the
395 // Check if the average measure is greater than half the domain's measure. Half is an arbitrary number.
396 if (informedSubSpace_->getMeasure() < summedMeasure_ / static_cast<double>(listPhsPtrs_.size()))
445 // Due to the possibility of overlap between multiple PHSs, we keep a sample with a probability of 1/K,
480 std::vector<double> PathLengthDirectInfSampler::getInformedSubstate(const State *statePtr) const
493 informedSubSpace_->copyToReals(rawData, statePtr->as<CompoundState>()->components[informedIdx_]);
499 void PathLengthDirectInfSampler::createFullState(State *statePtr, const std::vector<double> &informedVector)
501 // If there is an extra "uninformed" subspace, we need to add that to the state before converting the raw
543 // Check if the specific PHS can ever be better than the given maxCost, i.e., if the distance between
606 // The probability of using each PHS is weighted by it's measure. Therefore, if we iterate up the list
674 unsigned int PathLengthDirectInfSampler::numberOfPhsInclusions(const std::vector<double> &informedVector) const
void uniformProlateHyperspheroid(const std::shared_ptr< const ProlateHyperspheroid > &phsPtr, double value[])
Uniform random sampling of a prolate hyperspheroid, a special symmetric type of n-dimensional ellipse...
Definition RandomNumbers.cpp:321
A space to allow the composition of state spaces.
Definition StateSpace.h:574
const StateSpacePtr & getSubspace(unsigned int index) const
Get a specific subspace from the compound state space.
Definition StateSpace.cpp:909
unsigned int getSubspaceCount() const
Get the number of state spaces that make up the compound state space.
Definition StateSpace.cpp:904
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition Cost.h:48
Abstract definition of a goal region that can be sampled.
Definition GoalSampleableRegion.h:48
virtual unsigned int maxSampleCount() const =0
Return the maximum number of samples that can be asked for before repeating.
An abstract class for the concept of using information about the state space and the current solution...
Definition InformedStateSampler.h:61
OptimizationObjectivePtr opt_
A copy of the optimization objective.
Definition InformedStateSampler.h:115
ProblemDefinitionPtr probDefn_
A copy of the problem definition.
Definition InformedStateSampler.h:113
unsigned int numIters_
The number of iterations I'm allowed to attempt.
Definition InformedStateSampler.h:119
bool sampleUniform(State *statePtr, const Cost &maxCost) override
Sample uniformly in the subset of the state space whose heuristic solution estimates are less than th...
Definition PathLengthDirectInfSampler.cpp:266
bool hasInformedMeasure() const override
Whether the sampler can provide a measure of the informed subset.
Definition PathLengthDirectInfSampler.cpp:312
double getInformedMeasure(const Cost ¤tCost) const override
The measure of the subset of the state space defined by the current solution cost that is being searc...
Definition PathLengthDirectInfSampler.cpp:317
Cost heuristicSolnCost(const State *statePtr) const override
A helper function to calculate the heuristic estimate of the solution cost for the informed subset of...
Definition PathLengthDirectInfSampler.cpp:345
PathLengthDirectInfSampler(const ProblemDefinitionPtr &probDefn, unsigned int maxNumberCalls)
Construct a sampler that only generates states with a heuristic solution estimate that is less than t...
Definition PathLengthDirectInfSampler.cpp:58
A shared pointer wrapper for ompl::base::ProblemDefinition.
A shared pointer wrapper for ompl::base::StateSampler.
A shared pointer wrapper for ompl::base::StateSpace.
@ GOAL_SAMPLEABLE_REGION
This bit is set if casting to sampleable goal regions (ompl::base::GoalSampleableRegion) is possible.
Definition GoalTypes.h:56
Main namespace. Contains everything in this library.
Definition MultiLevelPlanarManipulatorDemo.cpp:66