Loading...
Searching...
No Matches
ompl::base::PlannerInputStates Class Reference

Helper class to extract valid start & goal states. Usually used internally by planners. More...

#include <ompl/base/Planner.h>

Public Member Functions

 PlannerInputStates (const PlannerPtr &planner)
 Default constructor. No work is performed.
 
 PlannerInputStates (const Planner *planner)
 Default constructor. No work is performed.
 
 PlannerInputStates ()
 Default constructor. No work is performed. A call to use() needs to be made, before making any calls to nextStart() or nextGoal().
 
 ~PlannerInputStates ()
 Destructor. Clear allocated memory.
 
void clear ()
 Clear all stored information.
 
void restart ()
 Forget how many states were returned by nextStart() and nextGoal() and return all states again.
 
bool update ()
 Set the space information and problem definition this class operates on, based on the available planner instance. Returns true if changes were found (different problem definition) and clear() was called.
 
bool use (const ProblemDefinitionPtr &pdef)
 Set the problem definition this class operates on. If a planner is not set in the constructor argument, a call to this function is needed before any calls to nextStart() or nextGoal() are made. Returns true if changes were found (different problem definition) and clear() was called.
 
bool use (const ProblemDefinition *pdef)
 Set the problem definition this class operates on. If a planner is not set in the constructor argument, a call to this function is needed before any calls to nextStart() or nextGoal() are made. Returns true if changes were found (different problem definition) and clear() was called.
 
void checkValidity () const
 Check if the problem definition was set, start state are available and goal was set.
 
const StatenextStart ()
 Return the next valid start state or nullptr if no more valid start states are available.
 
const StatenextGoal (const PlannerTerminationCondition &ptc)
 Return the next valid goal state or nullptr if no more valid goal states are available. Because sampling of goal states may also produce invalid goals, this function takes an argument that specifies whether a termination condition has been reached. If the termination condition evaluates to true the function terminates even if no valid goal has been found.
 
const StatenextGoal ()
 Same as above but only one attempt is made to find a valid goal.
 
bool haveMoreStartStates () const
 Check if there are more potential start states.
 
bool haveMoreGoalStates () const
 Check if there are more potential goal states.
 
unsigned int getSeenStartStatesCount () const
 Get the number of start states from the problem definition that were already seen, including invalid ones.
 
unsigned int getSampledGoalsCount () const
 Get the number of sampled goal states, including invalid ones.
 

Detailed Description

Helper class to extract valid start & goal states. Usually used internally by planners.

This class is meant to behave correctly if the user updates the problem definition between subsequent calls to ompl::base::Planner::solve() without calling ompl::base::Planner::clear() in between. Only allowed changes to the problem definition are accounted for: adding of starring states or adding of goal states for instances inherited from ompl::base::GoalSampleableRegion.

Definition at line 77 of file Planner.h.

Constructor & Destructor Documentation

◆ PlannerInputStates() [1/3]

ompl::base::PlannerInputStates::PlannerInputStates ( const PlannerPtr planner)
inline

Default constructor. No work is performed.

Definition at line 81 of file Planner.h.

◆ PlannerInputStates() [2/3]

ompl::base::PlannerInputStates::PlannerInputStates ( const Planner planner)
inline

Default constructor. No work is performed.

Definition at line 88 of file Planner.h.

◆ PlannerInputStates() [3/3]

ompl::base::PlannerInputStates::PlannerInputStates ( )
inline

Default constructor. No work is performed. A call to use() needs to be made, before making any calls to nextStart() or nextGoal().

Definition at line 97 of file Planner.h.

◆ ~PlannerInputStates()

ompl::base::PlannerInputStates::~PlannerInputStates ( )
inline

Destructor. Clear allocated memory.

Definition at line 104 of file Planner.h.

Member Function Documentation

◆ checkValidity()

void ompl::base::PlannerInputStates::checkValidity ( ) const

Check if the problem definition was set, start state are available and goal was set.

Definition at line 193 of file Planner.cpp.

◆ clear()

void ompl::base::PlannerInputStates::clear ( )

Clear all stored information.

Definition at line 167 of file Planner.cpp.

◆ getSampledGoalsCount()

unsigned int ompl::base::PlannerInputStates::getSampledGoalsCount ( ) const
inline

Get the number of sampled goal states, including invalid ones.

Definition at line 174 of file Planner.h.

◆ getSeenStartStatesCount()

unsigned int ompl::base::PlannerInputStates::getSeenStartStatesCount ( ) const
inline

Get the number of start states from the problem definition that were already seen, including invalid ones.

Definition at line 168 of file Planner.h.

◆ haveMoreGoalStates()

bool ompl::base::PlannerInputStates::haveMoreGoalStates ( ) const

Check if there are more potential goal states.

Definition at line 355 of file Planner.cpp.

◆ haveMoreStartStates()

bool ompl::base::PlannerInputStates::haveMoreStartStates ( ) const

Check if there are more potential start states.

Definition at line 348 of file Planner.cpp.

◆ nextGoal() [1/2]

const ompl::base::State * ompl::base::PlannerInputStates::nextGoal ( )

Same as above but only one attempt is made to find a valid goal.

Definition at line 267 of file Planner.cpp.

◆ nextGoal() [2/2]

const ompl::base::State * ompl::base::PlannerInputStates::nextGoal ( const PlannerTerminationCondition ptc)

Return the next valid goal state or nullptr if no more valid goal states are available. Because sampling of goal states may also produce invalid goals, this function takes an argument that specifies whether a termination condition has been reached. If the termination condition evaluates to true the function terminates even if no valid goal has been found.

Definition at line 274 of file Planner.cpp.

◆ nextStart()

const ompl::base::State * ompl::base::PlannerInputStates::nextStart ( )

Return the next valid start state or nullptr if no more valid start states are available.

Definition at line 237 of file Planner.cpp.

◆ restart()

void ompl::base::PlannerInputStates::restart ( )

Forget how many states were returned by nextStart() and nextGoal() and return all states again.

Definition at line 180 of file Planner.cpp.

◆ update()

bool ompl::base::PlannerInputStates::update ( )

Set the space information and problem definition this class operates on, based on the available planner instance. Returns true if changes were found (different problem definition) and clear() was called.

Definition at line 186 of file Planner.cpp.

◆ use() [1/2]

bool ompl::base::PlannerInputStates::use ( const ProblemDefinition pdef)

Set the problem definition this class operates on. If a planner is not set in the constructor argument, a call to this function is needed before any calls to nextStart() or nextGoal() are made. Returns true if changes were found (different problem definition) and clear() was called.

Definition at line 225 of file Planner.cpp.

◆ use() [2/2]

bool ompl::base::PlannerInputStates::use ( const ProblemDefinitionPtr pdef)

Set the problem definition this class operates on. If a planner is not set in the constructor argument, a call to this function is needed before any calls to nextStart() or nextGoal() are made. Returns true if changes were found (different problem definition) and clear() was called.

Definition at line 216 of file Planner.cpp.


The documentation for this class was generated from the following files: