SimpleSetup.cpp
46 configured_(false), planTime_(0.0), simplifyTime_(0.0), lastStatus_(base::PlannerStatus::UNKNOWN)
53 configured_(false), planTime_(0.0), simplifyTime_(0.0), lastStatus_(base::PlannerStatus::UNKNOWN)
90 void ompl::geometric::SimpleSetup::setStartAndGoalStates(const base::ScopedState<> &start, const base::ScopedState<> &goal,
101 void ompl::geometric::SimpleSetup::setGoalState(const base::ScopedState<> &goal, const double threshold)
120 // we provide a duplicate implementation here to allow the planner to choose how the time is turned into a planner termination condition
135 ompl::base::PlannerStatus ompl::geometric::SimpleSetup::solve(const base::PlannerTerminationCondition &ptc)
149 void ompl::geometric::SimpleSetup::simplifySolution(const base::PlannerTerminationCondition &ptc)
161 OMPL_INFORM("SimpleSetup: Path simplification took %f seconds and changed from %d to %d states",
184 OMPL_INFORM("SimpleSetup: Path simplification took %f seconds and changed from %d to %d states",
219 return haveSolutionPath() && (!pdef_->hasApproximateSolution() || pdef_->getSolutionDifference() < std::numeric_limits<double>::epsilon());
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique...
Definition: PlannerData.h:163
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.
Definition: SimpleSetup.cpp:90
const std::string getSolutionPlannerName(void) const
Get the best solution's planer name. Throw an exception if no solution is available.
Definition: SimpleSetup.cpp:192
double simplifyTime_
The amount of time the last path simplification step took.
Definition: SimpleSetup.h:298
PathGeometric & getSolutionPath() const
Get the solution path. Throw an exception if no solution is available.
Definition: SimpleSetup.cpp:206
void getPlannerData(base::PlannerData &pd) const
Get information about the exploration data structure the motion planner used.
Definition: SimpleSetup.cpp:222
Representation of a solution to a planning problem.
Definition: ProblemDefinition.h:70
A shared pointer wrapper for ompl::base::StateSpace.
bool haveSolutionPath() const
Return true if a solution path is available (previous call to solve() was successful). The solution may be approximate.
Definition: SimpleSetup.h:145
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
Definition: PlannerTerminationCondition.h:66
void setGoal(const base::GoalPtr &goal)
Set the goal for planning. This call is not needed if setStartAndGoalStates() has been called...
Definition: SimpleSetup.cpp:109
std::size_t getStateCount() const
Get the number of states (way-points) that make up this path.
Definition: PathGeometric.h:237
duration seconds(double sec)
Return the time duration representing a given number of seconds.
Definition: Time.h:78
A shared pointer wrapper for ompl::base::Planner.
const base::GoalPtr & getGoal() const
Get the current goal definition.
Definition: SimpleSetup.h:106
SimpleSetup(const base::SpaceInformationPtr &si)
Constructor needs the state space used for planning.
Definition: SimpleSetup.cpp:45
A class to store the exit status of Planner::solve()
Definition: PlannerStatus.h:48
This class contains routines that attempt to simplify geometric paths.
Definition: PathSimplifier.h:67
A shared pointer wrapper for ompl::base::SpaceInformation.
The base class for space information. This contains all the information about the space planning is d...
Definition: SpaceInformation.h:83
bool haveExactSolutionPath() const
Return true if a solution path is available (previous call to solve() was successful) and the solutio...
Definition: SimpleSetup.cpp:217
virtual void setup()
This method will create the necessary classes for planning. The solve() method will call this functio...
Definition: SimpleSetup.cpp:59
static base::PlannerPtr getDefaultPlanner(const base::GoalPtr &goal)
Given a goal specification, decide on a planner for that goal.
Definition: SelfConfig.cpp:248
base::PlannerStatus lastStatus_
The status of the last planning request.
Definition: SimpleSetup.h:301
Definition of a problem to be solved. This includes the start state(s) for the system and a goal spec...
Definition: ProblemDefinition.h:149
virtual base::PlannerStatus solve(double time=1.0)
Run the planner for up to a specified amount of time (default is 1 second)
Definition: SimpleSetup.cpp:121
std::string plannerName_
Name of planner type that generated this solution, as received from Planner::getName() ...
Definition: ProblemDefinition.h:135
bool configured_
Flag indicating whether the classes needed for planning are set up.
Definition: SimpleSetup.h:292
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.
Definition: SimpleSetup.cpp:101
void simplifySolution(double duration=0.0)
Attempt to simplify the current solution path. Spent at most duration seconds in the simplification p...
Definition: SimpleSetup.cpp:169
A shared pointer wrapper for ompl::base::Goal.
virtual void print(std::ostream &out=std::cout) const
Print information about the current setup.
Definition: SimpleSetup.cpp:229
OMPL_DEPRECATED base::PlannerPtr getDefaultPlanner(const base::GoalPtr &goal)
Given a goal specification, decide on a planner for that goal.
Definition: SimpleSetup.cpp:40
virtual void clear()
Clear all planning data. This only includes data generated by motion plan computation. Planner settings, start & goal states are not affected.
Definition: SimpleSetup.cpp:82
A shared pointer wrapper for ompl::base::Path.
This bit is set if casting to sampleable goal regions (ompl::base::GoalSampleableRegion) is possible...
Definition: GoalTypes.h:55