50 class MyGoalRegion : public ob::GoalRegion
54 MyGoalRegion(const ob::SpaceInformationPtr &si) : ob::GoalRegion(si)
78 bool regionSamplingWithGS(const ob::SpaceInformationPtr &si, const ob::ProblemDefinitionPtr &pd, const ob::GoalRegion *region, const ob::GoalLazySamples *gls, ob::State *result)
80 og::GeneticSearch g(si);
98 // we continue sampling while we are able to find solutions, we have found not more than 2 previous solutions and we have not yet solved the problem
99 return cont && gls->maxSampleCount() < 3 && !pd->hasSolution();
108 ob::RealVectorBounds bounds(3);
115 og::SimpleSetup ss(space);
118 ob::ScopedState<ob::SE3StateSpace> start(space);
130 ob::GoalSamplingFn samplingFunction = [&ss, ®ion](const ob::GoalLazySamples *gls, ob::State *result)
139 // we set a goal that is sampleable, but it in fact corresponds to a region that is not sampleable by default
143 ob::PlannerStatus solved = ss.solve(3.0);
155 // the region variable will now go out of scope. To make sure it is not used in the sampling function any more
This namespace contains code that is specific to planning under geometric constraints.
Definition of a goal region that can be sampled, but the sampling process can be slow....
This namespace contains sampling based planning routines shared by both planning under geometric cons...
Create the set of classes typically needed to solve a geometric problem.
const T * as() const
Cast this instance to a desired type.
A class to store the exit status of Planner::solve()
virtual double distanceGoal(const State *st) const =0
Compute the distance to the goal (heuristic). This function is the one used in computing the distance...
Define the type of state allocated by this state space.
unsigned int maxSampleCount() const override
Return the maximum number of samples that can be asked for before repeating.
std::function< bool(const GoalLazySamples *, State *)> GoalSamplingFn
Goal sampling function. Returns false when no further calls should be made to it. Fills its second ar...
Genetic Algorithm for searching valid states.
The lower and upper bounds for an Rn space.