37 #include "ompl/base/goals/GoalState.h"
38 #include "ompl/base/SpaceInformation.h"
40 ompl::base::GoalState::~GoalState()
48 return si_->distance(st, state_);
53 out <<
"Goal state, threshold = " << threshold_ <<
", memory address = " <<
this <<
", state = " << std::endl;
54 si_->printState(state_, out);
59 si_->copyState(st, state_);
69 if (state_ !=
nullptr)
70 si_->freeState(state_);
71 state_ = si_->cloneState(st);
Definition of an abstract state.
SpaceInformationPtr si_
The space information for this goal.
StateType * get()
Returns a pointer to the contained state.
State * state_
The goal state.
void print(std::ostream &out=std::cout) const override
Print information about the goal data structure to a stream.
void sampleGoal(State *st) const override
Sample a state in the goal region.
virtual double distanceGoal(const State *st) const override
Compute the distance to the goal (heuristic)
const State * getState() const
Get the goal state.
unsigned int maxSampleCount() const override
Return the maximum number of samples that can be asked for before repeating.
Definition of a scoped state.
void setState(const State *st)
Set the goal state.