37 #include "ompl/control/PathControl.h" 38 #include "ompl/control/planners/ltl/LTLProblemDefinition.h" 39 #include "ompl/control/planners/ltl/LTLSpaceInformation.h" 40 #include "ompl/base/ProblemDefinition.h" 45 oc::LTLProblemDefinition::LTLProblemDefinition(
const LTLSpaceInformationPtr& ltlsi)
46 :
ob::ProblemDefinition(ltlsi), ltlsi_(ltlsi)
51 void oc::LTLProblemDefinition::addLowerStartState(
const ob::State* s)
54 ltlsi_->getFullState(s, fullStart.get());
55 addStartState(fullStart);
58 ob::PathPtr oc::LTLProblemDefinition::getLowerSolutionPath(
void)
const 60 PathControl* fullPath =
static_cast<PathControl*
>(getSolutionPath().get());
62 PathControl* lowPath =
static_cast<PathControl*
>(lowPathPtr.get());
64 if (fullPath->getStateCount() > 0)
66 for(
size_t i = 0; i < fullPath->getStateCount()-1; ++i)
67 lowPath->append(
ltlsi_->getLowLevelState(fullPath->getState(i)),
68 fullPath->getControl(i),
69 fullPath->getControlDuration(i));
72 lowPath->append(
ltlsi_->getLowLevelState(fullPath->getState(fullPath->getStateCount()-1)));
78 void oc::LTLProblemDefinition::createGoal(
void)
80 class LTLGoal :
public base::Goal
83 LTLGoal(
const LTLSpaceInformationPtr& ltlsi)
84 :
ob::Goal(ltlsi),
ltlsi_(ltlsi), prod_(ltlsi->getProductGraph()) {}
85 virtual ~LTLGoal(
void) {}
86 virtual bool isSatisfied(
const ob::State* s)
const 88 return prod_->isSolution(
ltlsi_->getProdGraphState(s));
91 const LTLSpaceInformationPtr
ltlsi_;
92 const ProductGraphPtr prod_;
const LTLSpaceInformation * ltlsi_
Handle to the control::SpaceInformation object.
Definition of a scoped state.
This namespace contains sampling based planning routines used by planning under differential constrai...
Definition of an abstract state.
This namespace contains sampling based planning routines shared by both planning under geometric cons...
A shared pointer wrapper for ompl::base::Goal.
SpaceInformationPtr si_
The space information for which planning is done.
A shared pointer wrapper for ompl::base::Path.