Abstract definition of goals.
More...
#include <Goal.h>
Public Member Functions |
| Goal (const SpaceInformationPtr &si) |
| Constructor. The goal must always know the space information it is part of.
|
virtual | ~Goal (void) |
| Destructor.
|
template<class T > |
T * | as (void) |
| Cast this instance to a desired type.
|
template<class T > |
const T * | as (void) const |
| Cast this instance to a desired type.
|
GoalType | getType (void) 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 (void) 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.
|
bool | isSatisfied (const State *st, double pathLength, double *distance) const |
| Return true if the state satisfies the goal constraints and the path length is less than the desired maximum length. This call also computes the distance between the state given as argument and the goal.
|
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.
|
double | getMaximumPathLength (void) const |
| Get the maximum length allowed for a solution path.
|
void | setMaximumPathLength (double maximumPathLength) |
| Set the maximum length allowed for a solution path. This value is checked only in the version of isSatisfied() that takes the path length as argument or by isPathLengthSatisfied(). The default maximal path length is infinity.
|
bool | isPathLengthSatisfied (double pathLength) const |
| Check if pathLength is smaller than the value returned by getMaximumPathLength()
|
virtual void | print (std::ostream &out=std::cout) const |
| Print information about the goal.
|
Detailed Description
Abstract definition of goals.
Definition at line 63 of file Goal.h.
Member Function Documentation
template<class T >
T* ompl::base::Goal::as |
( |
void |
| ) |
|
|
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.
template<class T >
const T* ompl::base::Goal::as |
( |
void |
| ) |
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.
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.
Definition at line 46 of file Goal.cpp.
bool ompl::base::Goal::isSatisfied |
( |
const State * |
st, |
|
|
double |
pathLength, |
|
|
double * |
distance |
|
) |
| const |
Return true if the state satisfies the goal constraints and the path length is less than the desired maximum length. This call also computes the distance between the state given as argument and the goal.
- Parameters
-
st | the state to check for validity |
pathLength | the length of the path that leads to st |
distance | location at which distance to goal will be stored |
Definition at line 53 of file Goal.cpp.
The documentation for this class was generated from the following files: