Loading...
Searching...
No Matches
ompl::control::SimpleSetup Class Reference

Create the set of classes typically needed to solve a control problem. More...

#include <ompl/control/SimpleSetup.h>

Inheritance diagram for ompl::control::SimpleSetup:

Public Member Functions

 SimpleSetup (const SpaceInformationPtr &si)
 Constructor needs the control space used for planning. More...
 
 SimpleSetup (const ControlSpacePtr &space)
 Constructor needs the control space used for planning. More...
 
const SpaceInformationPtrgetSpaceInformation () const
 Get the current instance of the space information. More...
 
const base::ProblemDefinitionPtr & getProblemDefinition () const
 Get the current instance of the problem definition. More...
 
base::ProblemDefinitionPtr & getProblemDefinition ()
 Get the current instance of the problem definition. More...
 
const base::StateSpacePtr & getStateSpace () const
 Get the current instance of the state space. More...
 
const ControlSpacePtrgetControlSpace () const
 Get the current instance of the control space. More...
 
const base::StateValidityCheckerPtr & getStateValidityChecker () const
 Get the current instance of the state validity checker. More...
 
const StatePropagatorPtrgetStatePropagator () const
 Get the instance of the state propagator being used. More...
 
const base::GoalPtr & getGoal () const
 Get the current goal definition. More...
 
const base::PlannerPtr & getPlanner () const
 Get the current planner. More...
 
const base::PlannerAllocatorgetPlannerAllocator () const
 Get the planner allocator. More...
 
bool haveExactSolutionPath () const
 Return true if a solution path is available (previous call to solve() was successful) and the solution is exact (not approximate) More...
 
bool haveSolutionPath () const
 Return true if a solution path is available (previous call to solve() was successful). The solution may be approximate. More...
 
PathControlgetSolutionPath () const
 Get the solution path. Throw an exception if no solution is available. More...
 
void getPlannerData (base::PlannerData &pd) const
 Get information about the exploration data structure the motion planner used. More...
 
void setStateValidityChecker (const base::StateValidityCheckerPtr &svc)
 Set the state validity checker to use. More...
 
void setStateValidityChecker (const base::StateValidityCheckerFn &svc)
 Set the state validity checker to use. More...
 
void setStatePropagator (const StatePropagatorFn &sp)
 Set the function that performs state propagation. More...
 
void setStatePropagator (const StatePropagatorPtr &sp)
 Set the instance of StatePropagator to perform state propagation. More...
 
void setOptimizationObjective (const base::OptimizationObjectivePtr &optimizationObjective)
 Set the optimization objective to use. More...
 
void setStartAndGoalStates (const base::ScopedState<> &start, const base::ScopedState<> &goal, const double threshold=std::numeric_limits< double >::epsilon())
 Set the start and goal states to use. More...
 
void setGoalState (const base::ScopedState<> &goal, const double threshold=std::numeric_limits< double >::epsilon())
 A simple form of setGoal(). The goal will be an instance of ompl::base::GoalState. More...
 
void addStartState (const base::ScopedState<> &state)
 Add a starting state for planning. This call is not needed if setStartAndGoalStates() has been called. More...
 
void clearStartStates ()
 Clear the currently set starting states. More...
 
void setStartState (const base::ScopedState<> &state)
 Clear the currently set starting states and add state as the starting state. More...
 
void setGoal (const base::GoalPtr &goal)
 Set the goal for planning. This call is not needed if setStartAndGoalStates() has been called. More...
 
void setPlanner (const base::PlannerPtr &planner)
 Set the planner to use. If the planner is not set, an attempt is made to use the planner allocator. If no planner allocator is available either, a default planner is set. More...
 
void setPlannerAllocator (const base::PlannerAllocator &pa)
 Set the planner allocator to use. This is only used if no planner has been set. This is optional – a default planner will be used if no planner is otherwise specified. More...
 
virtual base::PlannerStatus solve (double time=1.0)
 Run the planner for a specified amount of time (default is 1 second) More...
 
virtual base::PlannerStatus solve (const base::PlannerTerminationCondition &ptc)
 Run the planner until ptc becomes true (at most) More...
 
base::PlannerStatus getLastPlannerStatus () const
 Return the status of the last planning attempt. More...
 
double getLastPlanComputationTime () const
 Get the amount of time (in seconds) spent during the last planning step. More...
 
virtual void clear ()
 Clear all planning data. This only includes data generated by motion plan computation. Planner settings, start & goal states are not affected. More...
 
virtual void print (std::ostream &out=std::cout) const
 Print information about the current setup. More...
 
virtual void setup ()
 This method will create the necessary classes for planning. The solve() method will call this function automatically. More...
 

Protected Attributes

SpaceInformationPtr si_
 The created space information. More...
 
base::ProblemDefinitionPtr pdef_
 The created problem definition. More...
 
base::PlannerPtr planner_
 The maintained planner instance. More...
 
base::PlannerAllocator pa_
 The optional planner allocator. More...
 
bool configured_
 Flag indicating whether the classes needed for planning are set up. More...
 
double planTime_
 The amount of time the last planning step took. More...
 
base::PlannerStatus last_status_
 The status of the last planning request. More...
 

Detailed Description

Create the set of classes typically needed to solve a control problem.

Definition at line 62 of file SimpleSetup.h.

Constructor & Destructor Documentation

◆ SimpleSetup() [1/2]

ompl::control::SimpleSetup::SimpleSetup ( const SpaceInformationPtr si)
explicit

Constructor needs the control space used for planning.

Definition at line 40 of file SimpleSetup.cpp.

◆ SimpleSetup() [2/2]

ompl::control::SimpleSetup::SimpleSetup ( const ControlSpacePtr space)
explicit

Constructor needs the control space used for planning.

Definition at line 47 of file SimpleSetup.cpp.

Member Function Documentation

◆ addStartState()

void ompl::control::SimpleSetup::addStartState ( const base::ScopedState<> &  state)
inline

Add a starting state for planning. This call is not needed if setStartAndGoalStates() has been called.

Definition at line 196 of file SimpleSetup.h.

◆ clear()

void ompl::control::SimpleSetup::clear ( )
virtual

Clear all planning data. This only includes data generated by motion plan computation. Planner settings, start & goal states are not affected.

Definition at line 78 of file SimpleSetup.cpp.

◆ clearStartStates()

void ompl::control::SimpleSetup::clearStartStates ( )
inline

Clear the currently set starting states.

Definition at line 202 of file SimpleSetup.h.

◆ getControlSpace()

const ControlSpacePtr & ompl::control::SimpleSetup::getControlSpace ( ) const
inline

Get the current instance of the control space.

Definition at line 98 of file SimpleSetup.h.

◆ getGoal()

const base::GoalPtr & ompl::control::SimpleSetup::getGoal ( ) const
inline

Get the current goal definition.

Definition at line 116 of file SimpleSetup.h.

◆ getLastPlanComputationTime()

double ompl::control::SimpleSetup::getLastPlanComputationTime ( ) const
inline

Get the amount of time (in seconds) spent during the last planning step.

Definition at line 256 of file SimpleSetup.h.

◆ getLastPlannerStatus()

base::PlannerStatus ompl::control::SimpleSetup::getLastPlannerStatus ( ) const
inline

Return the status of the last planning attempt.

Definition at line 250 of file SimpleSetup.h.

◆ getPlanner()

const base::PlannerPtr & ompl::control::SimpleSetup::getPlanner ( ) const
inline

Get the current planner.

Definition at line 122 of file SimpleSetup.h.

◆ getPlannerAllocator()

const base::PlannerAllocator & ompl::control::SimpleSetup::getPlannerAllocator ( ) const
inline

Get the planner allocator.

Definition at line 128 of file SimpleSetup.h.

◆ getPlannerData()

void ompl::control::SimpleSetup::getPlannerData ( base::PlannerData pd) const

Get information about the exploration data structure the motion planner used.

Definition at line 133 of file SimpleSetup.cpp.

◆ getProblemDefinition() [1/2]

base::ProblemDefinitionPtr & ompl::control::SimpleSetup::getProblemDefinition ( )
inline

Get the current instance of the problem definition.

Definition at line 86 of file SimpleSetup.h.

◆ getProblemDefinition() [2/2]

const base::ProblemDefinitionPtr & ompl::control::SimpleSetup::getProblemDefinition ( ) const
inline

Get the current instance of the problem definition.

Definition at line 80 of file SimpleSetup.h.

◆ getSolutionPath()

ompl::control::PathControl & ompl::control::SimpleSetup::getSolutionPath ( ) const

Get the solution path. Throw an exception if no solution is available.

Definition at line 116 of file SimpleSetup.cpp.

◆ getSpaceInformation()

const SpaceInformationPtr & ompl::control::SimpleSetup::getSpaceInformation ( ) const
inline

Get the current instance of the space information.

Definition at line 74 of file SimpleSetup.h.

◆ getStatePropagator()

const StatePropagatorPtr & ompl::control::SimpleSetup::getStatePropagator ( ) const
inline

Get the instance of the state propagator being used.

Definition at line 110 of file SimpleSetup.h.

◆ getStateSpace()

const base::StateSpacePtr & ompl::control::SimpleSetup::getStateSpace ( ) const
inline

Get the current instance of the state space.

Definition at line 92 of file SimpleSetup.h.

◆ getStateValidityChecker()

const base::StateValidityCheckerPtr & ompl::control::SimpleSetup::getStateValidityChecker ( ) const
inline

Get the current instance of the state validity checker.

Definition at line 104 of file SimpleSetup.h.

◆ haveExactSolutionPath()

bool ompl::control::SimpleSetup::haveExactSolutionPath ( ) const

Return true if a solution path is available (previous call to solve() was successful) and the solution is exact (not approximate)

Definition at line 127 of file SimpleSetup.cpp.

◆ haveSolutionPath()

bool ompl::control::SimpleSetup::haveSolutionPath ( ) const
inline

Return true if a solution path is available (previous call to solve() was successful). The solution may be approximate.

Definition at line 139 of file SimpleSetup.h.

◆ print()

void ompl::control::SimpleSetup::print ( std::ostream &  out = std::cout) const
virtual

Print information about the current setup.

Definition at line 140 of file SimpleSetup.cpp.

◆ setGoal()

void ompl::control::SimpleSetup::setGoal ( const base::GoalPtr &  goal)
inline

Set the goal for planning. This call is not needed if setStartAndGoalStates() has been called.

Definition at line 216 of file SimpleSetup.h.

◆ setGoalState()

void ompl::control::SimpleSetup::setGoalState ( const base::ScopedState<> &  goal,
const double  threshold = std::numeric_limits<double>::epsilon() 
)
inline

A simple form of setGoal(). The goal will be an instance of ompl::base::GoalState.

Definition at line 188 of file SimpleSetup.h.

◆ setOptimizationObjective()

void ompl::control::SimpleSetup::setOptimizationObjective ( const base::OptimizationObjectivePtr &  optimizationObjective)
inline

Set the optimization objective to use.

Definition at line 175 of file SimpleSetup.h.

◆ setPlanner()

void ompl::control::SimpleSetup::setPlanner ( const base::PlannerPtr &  planner)
inline

Set the planner to use. If the planner is not set, an attempt is made to use the planner allocator. If no planner allocator is available either, a default planner is set.

Definition at line 225 of file SimpleSetup.h.

◆ setPlannerAllocator()

void ompl::control::SimpleSetup::setPlannerAllocator ( const base::PlannerAllocator pa)
inline

Set the planner allocator to use. This is only used if no planner has been set. This is optional – a default planner will be used if no planner is otherwise specified.

Definition at line 236 of file SimpleSetup.h.

◆ setStartAndGoalStates()

void ompl::control::SimpleSetup::setStartAndGoalStates ( const base::ScopedState<> &  start,
const base::ScopedState<> &  goal,
const double  threshold = std::numeric_limits<double>::epsilon() 
)
inline

Set the start and goal states to use.

Definition at line 181 of file SimpleSetup.h.

◆ setStartState()

void ompl::control::SimpleSetup::setStartState ( const base::ScopedState<> &  state)
inline

Clear the currently set starting states and add state as the starting state.

Definition at line 208 of file SimpleSetup.h.

◆ setStatePropagator() [1/2]

void ompl::control::SimpleSetup::setStatePropagator ( const StatePropagatorFn sp)
inline

Set the function that performs state propagation.

Definition at line 163 of file SimpleSetup.h.

◆ setStatePropagator() [2/2]

void ompl::control::SimpleSetup::setStatePropagator ( const StatePropagatorPtr sp)
inline

Set the instance of StatePropagator to perform state propagation.

Definition at line 169 of file SimpleSetup.h.

◆ setStateValidityChecker() [1/2]

void ompl::control::SimpleSetup::setStateValidityChecker ( const base::StateValidityCheckerFn svc)
inline

Set the state validity checker to use.

Definition at line 157 of file SimpleSetup.h.

◆ setStateValidityChecker() [2/2]

void ompl::control::SimpleSetup::setStateValidityChecker ( const base::StateValidityCheckerPtr &  svc)
inline

Set the state validity checker to use.

Definition at line 151 of file SimpleSetup.h.

◆ setup()

void ompl::control::SimpleSetup::setup ( )
virtual

This method will create the necessary classes for planning. The solve() method will call this function automatically.

Reimplemented in ompl::control::MorseSimpleSetup, and ompl::control::OpenDESimpleSetup.

Definition at line 54 of file SimpleSetup.cpp.

◆ solve() [1/2]

ompl::base::PlannerStatus ompl::control::SimpleSetup::solve ( const base::PlannerTerminationCondition ptc)
virtual

Run the planner until ptc becomes true (at most)

Definition at line 102 of file SimpleSetup.cpp.

◆ solve() [2/2]

ompl::base::PlannerStatus ompl::control::SimpleSetup::solve ( double  time = 1.0)
virtual

Run the planner for a specified amount of time (default is 1 second)

Definition at line 88 of file SimpleSetup.cpp.

Member Data Documentation

◆ configured_

bool ompl::control::SimpleSetup::configured_
protected

Flag indicating whether the classes needed for planning are set up.

Definition at line 288 of file SimpleSetup.h.

◆ last_status_

base::PlannerStatus ompl::control::SimpleSetup::last_status_
protected

The status of the last planning request.

Definition at line 294 of file SimpleSetup.h.

◆ pa_

base::PlannerAllocator ompl::control::SimpleSetup::pa_
protected

The optional planner allocator.

Definition at line 285 of file SimpleSetup.h.

◆ pdef_

base::ProblemDefinitionPtr ompl::control::SimpleSetup::pdef_
protected

The created problem definition.

Definition at line 279 of file SimpleSetup.h.

◆ planner_

base::PlannerPtr ompl::control::SimpleSetup::planner_
protected

The maintained planner instance.

Definition at line 282 of file SimpleSetup.h.

◆ planTime_

double ompl::control::SimpleSetup::planTime_
protected

The amount of time the last planning step took.

Definition at line 291 of file SimpleSetup.h.

◆ si_

SpaceInformationPtr ompl::control::SimpleSetup::si_
protected

The created space information.

Definition at line 276 of file SimpleSetup.h.


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