Public Member Functions |
| Goal (const SpaceInformationPtr &si) |
| Constructor. The goal must always know the space information it is part of.
|
virtual | ~Goal (void) |
| Destructor. Clears the solution as well.
|
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()
|
bool | isAchieved (void) const |
| Returns true if a solution path has been found (could be approximate)
|
bool | isApproximate (void) const |
| Return true if the top found solution is approximate (does not actually reach the desired goal, but hopefully is closer to it)
|
double | getDifference (void) const |
| Get the distance to the desired goal for the top solution. Return -1.0 if there are no solutions available.
|
PathPtr | getSolutionPath (void) const |
| Return the top solution path, if one is found. The top path is the shortest one that was found, preference being given to solutions that are not approximate.
|
void | addSolutionPath (const PathPtr &path, bool approximate=false, double difference=-1.0) const |
| Add a solution path in a thread-safe manner. Multiple solutions can be set for a goal. If a solution does not reach the desired goal it is considered approximate. Optionally, the distance between the desired goal and the one actually achieved is set by difference.
|
std::size_t | getSolutionCount (void) const |
| Get the number of solutions already found.
|
std::vector< PlannerSolution > | getSolutions (void) const |
| Get all the solution paths available for this goal.
|
void | clearSolutionPaths (void) const |
| Forget the solution paths (thread safe). Memory is freed.
|
virtual void | print (std::ostream &out=std::cout) const |
| Print information about the goal.
|
Protected Attributes |
GoalType | type_ |
| Goal type.
|
SpaceInformationPtr | si_ |
| The space information for this goal.
|
double | maximumPathLength_ |
| The maximum length allowed for the solution path.
|
msg::Interface | msg_ |
| Console interface.
|
Abstract definition of goals. Will contain solutions, if found.
Definition at line 107 of file Goal.h.