LTLPlanner.cpp
15 ompl::control::LTLPlanner::LTLPlanner(const LTLSpaceInformationPtr& ltlsi, const ProductGraphPtr& a, double exploreTime) :
43 ompl::base::PlannerStatus ompl::control::LTLPlanner::solve(const ompl::base::PlannerTerminationCondition& ptc)
75 const std::vector<ProductGraph::State*> lead = abstraction_->computeLead(prodStart_, boost::bind(<LPlanner::abstractEdgeWeight, this, _1, _2));
113 std::vector<ompl::control::ProductGraph::State*> ompl::control::LTLPlanner::getHighLevelPath(const std::vector<base::State*>& path, ProductGraph::State* start) const
126 ompl::control::LTLPlanner::Motion::Motion(void) : state(NULL), control(NULL), parent(NULL), steps(0)
158 info.weight = ((info.motions.size()+1)*info.volume) / (info.autWeight*(info.numSel+1)*(info.numSel+1));
198 bool ompl::control::LTLPlanner::explore(const std::vector<ProductGraph::State*>& lead, Motion*& soln, double duration)
218 unsigned int cd = controlSampler_->sampleStepCount(ltlsi_->getMinControlDuration(), ltlsi_->getMaxControlDuration());
233 // Since the state was determined to be valid by SpaceInformation, we don't need to check automaton states
241 availDist_.update(abstractInfo_[m->abstractState].pdfElem, abstractInfo_[m->abstractState].weight);
247 PDF<ProductGraph::State*>::Element* elem = availDist_.add(m->abstractState, abstractInfo_[m->abstractState].weight);
262 double ompl::control::LTLPlanner::abstractEdgeWeight(ProductGraph::State* a, ProductGraph::State* b) const
bool approximateSolutions
Flag indicating whether the planner is able to compute approximate solutions.
Definition: Planner.h:214
virtual double abstractEdgeWeight(ProductGraph::State *a, ProductGraph::State *b) const
Returns the weight of an edge between two given high-level states, which we compute as the product of...
Definition: LTLPlanner.cpp:262
double getPropagationStepSize() const
Propagation is performed at integer multiples of a specified step size. This function returns the val...
Definition: SpaceInformation.h:207
void addMotion(Motion *m)
Adds a tree motion to an info object. This method is called whenever a new tree motion is created in ...
Definition: LTLPlanner.cpp:148
unsigned int getMinControlDuration() const
Get the minimum number of steps a control is propagated for.
Definition: SpaceInformation.h:161
const LTLSpaceInformation * ltlsi_
Handle to the control::SpaceInformation object.
Definition: LTLPlanner.h:179
boost::unordered_map< ProductGraph::State *, ProductGraphStateInfo > abstractInfo_
Map of abstraction states to their details.
Definition: LTLPlanner.h:200
unsigned int steps
The number of steps for which the control is applied.
Definition: LTLPlanner.h:122
unsigned int propagateWhileValid(const base::State *state, const Control *control, int steps, base::State *result) const
Propagate the model of the system forward, starting at a given state, with a given control...
Definition: SpaceInformation.cpp:147
void append(const base::State *state)
Append state to the end of the path; it is assumed state is the first state, so no control is applied...
Definition: PathControl.cpp:266
void nullControl(Control *control) const
Make the control have no effect if it were to be applied to a state for any amount of time...
Definition: SpaceInformation.h:137
void getTree(std::vector< base::State *> &tree) const
Helper debug method to access this planner's underlying tree of states.
Definition: LTLPlanner.cpp:106
virtual void initAbstractInfo(ProductGraph::State *as)
Initializes the info object for a new high-level state.
Definition: LTLPlanner.cpp:162
virtual double updateWeight(ProductGraph::State *as)
Updates and returns the weight of an abstraction state.
Definition: LTLPlanner.cpp:153
virtual void clear(void)
Clears all datastructures belonging to this LTLPlanner.
Definition: LTLPlanner.cpp:35
PDF< ProductGraph::State * > availDist_
Used to sample nonempty regions in which to promote expansion.
Definition: LTLPlanner.h:185
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
Definition: PlannerTerminationCondition.h:64
ControlSamplerPtr allocControlSampler() const
Allocate a control sampler.
Definition: SpaceInformation.h:148
virtual void clear()
Clear all internal datastructures. Planner settings are not affected. Subsequent calls to solve() wil...
Definition: Planner.cpp:112
bool haveMoreStartStates() const
Check if there are more potential start states.
Definition: Planner.cpp:345
A boost shared pointer wrapper for ompl::control::LTLSpaceInformation.
PlannerTerminationCondition timedPlannerTerminationCondition(double duration)
Return a termination condition that will become true duration seconds in the future (wall-time) ...
Definition: PlannerTerminationCondition.cpp:223
virtual bool explore(const std::vector< ProductGraph::State *> &lead, Motion *&soln, double duration)
Expand the tree of motions along a given lead for a given duration of time. Returns true if a solutio...
Definition: LTLPlanner.cpp:198
double getWeight(const Element *elem) const
Returns the current weight of the given Element.
Definition: PDF.h:171
unsigned int getMaxControlDuration() const
Get the maximum number of steps a control is propagated for.
Definition: SpaceInformation.h:167
virtual void setup()
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
Definition: Planner.cpp:86
A State of a ProductGraph represents a vertex in the graph-based Cartesian product represented by the...
Definition: ProductGraph.h:74
A class to store the exit status of Planner::solve()
Definition: PlannerStatus.h:48
LTLPlanner(const LTLSpaceInformationPtr &si, const ProductGraphPtr &a, double exploreTime=0.5)
Create an LTLPlanner with a given space and product graph. Accepts an optional third parameter to con...
Definition: LTLPlanner.cpp:15
virtual void checkValidity()
Check to see if the planner is in a working state (setup has been called, a goal was set...
Definition: Planner.cpp:100
ProductGraphStateInfo(void)
Creates an info object with no measurements and no tree motions.
Definition: LTLPlanner.cpp:142
ProductGraphPtr abstraction_
The high level abstaction used to grow the tree structure.
Definition: LTLPlanner.h:182
const State * nextStart()
Return the next valid start state or NULL if no more valid start states are available.
Definition: Planner.cpp:230
void update(Element *elem, const double w)
Updates the data in the given Element with a new weight value.
Definition: PDF.h:155
_T & sample(double r) const
Returns a piece of data from the PDF according to the input sampling value, which must be between 0 a...
Definition: PDF.h:132
bool update()
Set the space information and problem definition this class operates on, based on the available plann...
Definition: Planner.cpp:176
A boost shared pointer wrapper for ompl::control::ProductGraph.
A boost shared pointer wrapper for ompl::base::Goal.
void freeControl(Control *control) const
Free the memory of a control.
Definition: SpaceInformation.h:100
virtual void buildAvail(const std::vector< ProductGraph::State *> &lead)
Compute a set of high-level states along a lead to be considered for expansion.
Definition: LTLPlanner.cpp:178
virtual ~LTLPlanner(void)
Clears all memory belonging to this LTLPlanner .
Definition: LTLPlanner.cpp:25
Space information containing necessary information for planning with controls. setup() needs to be ca...
Definition: SpaceInformation.h:69
virtual ~Motion(void)
Motion destructor does not clear memory. Deletions should be performed by the LTLPlanner.
Definition: LTLPlanner.cpp:138
A structure to hold measurement information for a high-level state, as well as the set of tree motion...
Definition: LTLPlanner.h:131
ProductGraph::State * abstractState
The high-level state to which this motion belongs.
Definition: LTLPlanner.h:125
A boost shared pointer wrapper for ompl::base::Path.
std::vector< ProductGraph::State * > getHighLevelPath(const std::vector< base::State *> &path, ProductGraph::State *start=NULL) const
Helper debug method to return the sequence of high-level product graph states corresponding to a sequ...
Definition: LTLPlanner.cpp:113
virtual base::PlannerStatus solve(const base::PlannerTerminationCondition &ptc)
Continues solving until a solution is found or a given planner termination condition is met...
Definition: LTLPlanner.cpp:43