37 #include "ompl/base/goals/GoalSpace.h"
40 ompl::base::GoalSpace::~GoalSpace()
46 goalSampler_->sampleUniform(st);
51 return std::numeric_limits<unsigned int>::max();
57 if (goalSpace_->satisfiesBounds(st))
64 State *proj = si_->allocState();
65 si_->copyState(proj, st);
68 goalSpace_->enforceBounds(proj);
71 double dist = si_->distance(st, proj);
82 out <<
"Goal space, threshold = " << threshold_ <<
", memory address = " <<
this <<
", volume = " << goalSpace_->getMeasure() << std::endl;
87 if (space->getType() != si_->getStateSpace()->getType())
89 OMPL_ERROR(
"GoalSpace: The specified goal space must be the same type as the problem space.");
93 goalSampler_ = goalSpace_->allocStateSampler();
Definition of an abstract state.
StateSpacePtr getSpace() const
Get the goal space.
void sampleGoal(State *st) const override
Sample a state in the goal region.
unsigned int maxSampleCount() const override
Return the maximum number of samples that can be asked for before repeating.
A shared pointer wrapper for ompl::base::StateSpace.
#define OMPL_ERROR(fmt,...)
Log a formatted error string.
void print(std::ostream &out=std::cout) const override
Print information about the goal data structure to a stream.
void setSpace(const StateSpacePtr space)
Set the goal space.
double distanceGoal(const State *st) const override
Compute the distance to the goal (heuristic)