3#include <ompl/base/OptimizationObjective.h>
4#include <ompl/base/objectives/PathLengthOptimizationObjective.h>
5#include <ompl/base/samplers/InformedStateSampler.h>
6#include <ompl/base/samplers/informed/PathLengthDirectInfSampler.h>
10namespace ob = ompl::base;
15 unsigned int maxNumberCalls);
22 const ob::Cost &maxCost)
override;
31 typedef std::shared_ptr<const ompl::ProlateHyperspheroid>
32 ProlateHyperspheroidCPtr;
39 bool sampleBoundsRejectPhs(
ob::State *statePtr,
unsigned int *iters);
41 bool samplePhsRejectBounds(
ob::State *statePtr,
unsigned int *iters);
44 std::vector<double> getInformedSubstate(
const ob::State *statePtr)
const;
47 const std::vector<double> &informedVector);
49 void updatePhsDefinitions(
const ob::Cost &maxCost);
51 ompl::ProlateHyperspheroidPtr randomPhsPtr();
53 bool keepSample(
const std::vector<double> &informedVector);
55 bool isInAnyPhs(
const std::vector<double> &informedVector)
const;
57 bool isInPhs(
const ProlateHyperspheroidCPtr &phsCPtr,
58 const std::vector<double> &informedVector)
const;
60 unsigned int numberOfPhsInclusions(
61 const std::vector<double> &informedVector)
const;
64 std::list<ompl::ProlateHyperspheroidPtr> listPhsPtrs_;
66 double summedMeasure_;
68 unsigned int informedIdx_;
70 ob::StateSpacePtr informedSubSpace_;
72 unsigned int uninformedIdx_;
74 ob::StateSpacePtr uninformedSubSpace_;
76 ob::StateSamplerPtr baseSampler_;
78 ob::StateSamplerPtr uninformedSubSampler_;
84 :
public ob::PathLengthOptimizationObjective {
87 : ob::PathLengthOptimizationObjective(space_info) {}
89 const ob::ProblemDefinitionPtr &probDefn,
90 unsigned int maxNumberCalls)
const override {
92 "Using a custom informed state sampler to support CC/HC steer "
94 return ob::InformedSamplerPtr(
107 : ob::OptimizationObjective(space_info) {}
132 ob::SpaceInformationPtr &space_info,
134 : ob::OptimizationObjective(space_info),
max_curvature_(max_curvature) {}
ob::SE2StateSpace::StateType State
Definition: Primitives.h:12
An optimization objective for minimizing curvature of a path.
Definition: OptimizationObjective.h:129
ob::Cost stateCost(const ob::State *s) const override
Returns identity cost.
Definition: OptimizationObjective.cpp:632
double max_curvature_
Definition: OptimizationObjective.h:144
ob::Cost motionCost(const ob::State *s1, const ob::State *s2) const override
Motion cost for this objective is defined as the sum of normalied curvature along the path.
Definition: OptimizationObjective.cpp:636
CurvatureOptimizationObjective(ob::SpaceInformationPtr &space_info, double max_curvature=std::numeric_limits< double >::max())
Definition: OptimizationObjective.h:131
Definition: OptimizationObjective.h:12
CustomPathLengthDirectInfSampler(const ob::ProblemDefinitionPtr &probDefn, unsigned int maxNumberCalls)
Definition: OptimizationObjective.cpp:12
~CustomPathLengthDirectInfSampler() override
bool sampleUniform(ob::State *statePtr, const ob::Cost &maxCost) override
Definition: OptimizationObjective.cpp:213
bool hasInformedMeasure() const override
Definition: OptimizationObjective.cpp:263
double getInformedMeasure(const ob::Cost ¤tCost) const override
Definition: OptimizationObjective.cpp:267
ob::Cost heuristicSolnCost(const ob::State *statePtr) const override
Definition: OptimizationObjective.cpp:296
Definition: OptimizationObjective.h:84
ob::InformedSamplerPtr allocInformedStateSampler(const ob::ProblemDefinitionPtr &probDefn, unsigned int maxNumberCalls) const override
Definition: OptimizationObjective.h:88
CustomPathLengthOptimizationObjective(ob::SpaceInformationPtr &space_info)
Definition: OptimizationObjective.h:86
An optimization objective for minimizing OMPL's smoothness.
Definition: OptimizationObjective.h:104
ob::Cost stateCost(const ob::State *s) const override
Returns identity cost.
Definition: OptimizationObjective.cpp:619
ob::Cost motionCost(const ob::State *s1, const ob::State *s2) const override
Motion cost for this objective is defined as the smoothness between the path between s1 and s2 .
Definition: OptimizationObjective.cpp:623
SmoothnessOptimizationObjective(ob::SpaceInformationPtr &space_info)
Definition: OptimizationObjective.h:106
double max(const std::vector< double > &values)
Definition: PathStatistics.hpp:79