Abstract definition of goals.
More...
#include <ompl/base/Goal.h>
|
| Goal (const Goal &)=delete |
|
Goal & | operator= (const Goal &)=delete |
|
| Goal (SpaceInformationPtr si) |
| Constructor. The goal must always know the space information it is part of.
|
|
virtual | ~Goal ()=default |
| Destructor.
|
|
template<class T > |
T * | as () |
| Cast this instance to a desired type.
|
|
template<class T > |
const T * | as () const |
| Cast this instance to a desired type.
|
|
GoalType | getType () const |
| Return the goal type.
|
|
bool | hasType (GoalType type) const |
| Check if this goal can be cast to a particular goal type.
|
|
const SpaceInformationPtr & | getSpaceInformation () const |
| Get the space information this goal is for.
|
|
virtual bool | isSatisfied (const State *st) const =0 |
| Return true if the state satisfies the goal constraints.
|
|
virtual bool | isSatisfied (const State *st, double *distance) const |
| Return true if the state satisfies the goal constraints and compute the distance between the state given as argument and the goal (even if the goal is not satisfied). This distance can be an approximation. It can even be set to a constant, if such a computation is not possible.
|
|
virtual bool | isStartGoalPairValid (const State *, const State *) const |
| Since there can be multiple starting states (and multiple goal states) it is possible certain pairs are not to be allowed. By default we however assume all such pairs are allowed. Note: if this function returns true, isSatisfied() need not be called.
|
|
virtual void | print (std::ostream &out=std::cout) const |
| Print information about the goal.
|
|
Abstract definition of goals.
Definition at line 62 of file Goal.h.
◆ Goal()
Constructor. The goal must always know the space information it is part of.
Definition at line 41 of file Goal.cpp.
◆ as() [1/2]
template<class T >
T * ompl::base::Goal::as |
( |
| ) |
|
|
inline |
Cast this instance to a desired type.
Make sure the type we are casting to is indeed a goal
Definition at line 77 of file Goal.h.
◆ as() [2/2]
template<class T >
const T * ompl::base::Goal::as |
( |
| ) |
const |
|
inline |
Cast this instance to a desired type.
Make sure the type we are casting to is indeed a goal
Definition at line 87 of file Goal.h.
◆ getSpaceInformation()
Get the space information this goal is for.
Definition at line 108 of file Goal.h.
◆ getType()
GoalType ompl::base::Goal::getType |
( |
| ) |
const |
|
inline |
Return the goal type.
Definition at line 96 of file Goal.h.
◆ hasType()
bool ompl::base::Goal::hasType |
( |
GoalType |
type | ) |
const |
|
inline |
Check if this goal can be cast to a particular goal type.
Definition at line 102 of file Goal.h.
◆ isSatisfied() [1/2]
virtual bool ompl::base::Goal::isSatisfied |
( |
const State * |
st | ) |
const |
|
pure virtual |
◆ isSatisfied() [2/2]
bool ompl::base::Goal::isSatisfied |
( |
const State * |
st, |
|
|
double * |
distance |
|
) |
| const |
|
virtual |
Return true if the state satisfies the goal constraints and compute the distance between the state given as argument and the goal (even if the goal is not satisfied). This distance can be an approximation. It can even be set to a constant, if such a computation is not possible.
- Parameters
-
st | the state to check for validity |
distance | location at which distance to goal will be stored |
- Note
- The default implementation sets the distance to a constant.
-
If this function returns true, isStartGoalPairValid() need not be called.
Reimplemented in ompl::base::GoalRegion, and ompl::base::MorseGoal.
Definition at line 45 of file Goal.cpp.
◆ isStartGoalPairValid()
virtual bool ompl::base::Goal::isStartGoalPairValid |
( |
const State * |
, |
|
|
const State * |
|
|
) |
| const |
|
inlinevirtual |
Since there can be multiple starting states (and multiple goal states) it is possible certain pairs are not to be allowed. By default we however assume all such pairs are allowed. Note: if this function returns true, isSatisfied() need not be called.
Definition at line 136 of file Goal.h.
◆ print()
void ompl::base::Goal::print |
( |
std::ostream & |
out = std::cout | ) |
const |
|
virtual |
◆ si_
The space information for this goal.
Definition at line 149 of file Goal.h.
◆ type_
The documentation for this class was generated from the following files: