1 #include <ompl/geometric/PathGeometric.h>
14 template <
class PlannerType>
26 double _maxDistanceBtwValidityChecks)
34 std::move(_validityConstraint),
35 std::move(_boundsConstraint),
36 std::move(_boundsProjector),
37 _maxDistanceBtwValidityChecks);
40 auto pdef = ompl_make_shared<::ompl::base::ProblemDefinition>(si);
42 = ompl_static_pointer_cast<GeometricStateSpace>(si->getStateSpace());
43 auto start = sspace->allocState(_start);
44 auto goal = sspace->allocState(_goal);
47 pdef->setStartAndGoalStates(start, goal);
49 sspace->freeState(start);
50 sspace->freeState(goal);
52 auto planner = ompl_make_shared<PlannerType>(si);
56 std::move(_stateSpace),
57 std::move(_interpolator),
62 template <
class PlannerType>
75 double _maxDistanceBtwValidityChecks)
77 if (_goalTestable ==
nullptr)
79 throw std::invalid_argument(
"Testable goal is nullptr.");
82 if (_goalSampler ==
nullptr)
84 throw std::invalid_argument(
"Sampleable goal is nullptr.");
87 if (_goalTestable->getStateSpace() != _stateSpace)
89 throw std::invalid_argument(
"Testable goal does not match StateSpace");
92 if (_goalSampler->getStateSpace() != _stateSpace)
94 throw std::invalid_argument(
"Sampleable goal does not match StateSpace");
102 std::move(_validityConstraint),
103 std::move(_boundsConstraint),
104 std::move(_boundsProjector),
105 _maxDistanceBtwValidityChecks);
108 auto pdef = ompl_make_shared<::ompl::base::ProblemDefinition>(si);
110 = ompl_static_pointer_cast<GeometricStateSpace>(si->getStateSpace());
111 auto start = sspace->allocState(_start);
112 pdef->addStartState(start);
113 sspace->freeState(start);
115 auto goalRegion = ompl_make_shared<GoalRegion>(
116 si, std::move(_goalTestable), _goalSampler->createSampleGenerator());
117 pdef->setGoal(goalRegion);
119 auto planner = ompl_make_shared<PlannerType>(si);
123 std::move(_stateSpace),
124 std::move(_interpolator),