GoalLazySamples.cpp
43 ompl::base::GoalLazySamples::GoalLazySamples(const SpaceInformationPtr &si, GoalSamplingFn samplerFunc, bool autoStart,
104 OMPL_DEBUG("Waiting for space information to be set up before the sampling thread can begin computation...");
130 samplerFunc_ ? (si_->isSetup() ? "" : " Space information not set up.") : " No sampling function "
137 OMPL_DEBUG("Stopped goal sampling thread after %u sampling attempts", samplingAttempts_ - prevsa);
bool couldSample() const override
Return true if GoalStates::couldSample() is true or if the sampling thread is active,...
Definition: GoalLazySamples.cpp:145
This bit is set if casting to goal states (ompl::base::GoalLazySamples) is possible.
Definition: GoalTypes.h:157
bool isSampling() const
Return true if the sampling thread is active.
Definition: GoalLazySamples.cpp:139
A shared pointer wrapper for ompl::base::SpaceInformation.
GoalLazySamples(const SpaceInformationPtr &si, GoalSamplingFn samplerFunc, bool autoStart=true, double minDist=std::numeric_limits< double >::epsilon())
Create a goal region that can be sampled in a lazy fashion. A function (samplerFunc) that produces sa...
Definition: GoalLazySamples.cpp:42
bool hasStates() const override
Check if there are any states in this goal region.
Definition: GoalLazySamples.cpp:185
void sampleGoal(State *st) const override
Sample a state in the goal region.
Definition: GoalStates.cpp:80
std::size_t getStateCount() const override
Return the number of valid goal states.
Definition: GoalLazySamples.cpp:191
const State * getState(unsigned int index) const override
Return a pointer to the indexth state in the state list.
Definition: GoalLazySamples.cpp:179
double distanceGoal(const State *st) const override
Compute the distance to the goal (heuristic). This function is the one used in computing the distance...
Definition: GoalLazySamples.cpp:156
double distanceGoal(const State *st) const override
Compute the distance to the goal (heuristic). This function is the one used in computing the distance...
Definition: GoalStates.cpp:58
virtual const State * getState(unsigned int index) const
Return a pointer to the indexth state in the state list.
Definition: GoalStates.cpp:108
void setNewStateCallback(const NewStateCallbackFn &callback)
Set the callback function to be called when a new state is added to the list of possible samples....
Definition: GoalLazySamples.cpp:168
void sampleGoal(State *st) const override
Sample a state in the goal region.
Definition: GoalLazySamples.cpp:162
void goalSamplingThread()
The function that samples goals by calling samplerFunc_ in a separate thread.
Definition: GoalLazySamples.cpp:93
unsigned int maxSampleCount() const override
Return the maximum number of samples that can be asked for before repeating.
Definition: GoalStates.cpp:93
bool addStateIfDifferent(const State *st, double minDistance)
Add a state st if it further away that minDistance from previously added states. Return true if the s...
Definition: GoalLazySamples.cpp:203
std::function< void(const base::State *)> NewStateCallbackFn
When new samples are generated and added to the list of possible samples, a callback can be called....
Definition: GoalLazySamples.h:138
unsigned int maxSampleCount() const override
Return the maximum number of samples that can be asked for before repeating.
Definition: GoalLazySamples.cpp:197
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...
Definition: GoalLazySamples.h:116
virtual std::size_t getStateCount() const
Return the number of valid goal states.
Definition: GoalStates.cpp:116
virtual bool hasStates() const
Check if there are any states in this goal region.
Definition: GoalStates.cpp:121
duration seconds(double sec)
Return the time duration representing a given number of seconds.
Definition: Time.h:125