49 namespace ompl
57 typedef std::function<Cost(const State *, const Goal *)> CostToGoHeuristic;
81 virtual ~OptimizationObjective() = default;
84 const std::string &getDescription() const;
143 virtual bool isSymmetric() const;
154 bool hasCostToGoHeuristic() const;
177 virtual void print(std::ostream &out) const;
214 void addObjective(const OptimizationObjectivePtr &objective, double weight);
221 const OptimizationObjectivePtr &getObjective(unsigned int idx) const;
252 OptimizationObjectivePtr objective;
265 const OptimizationObjectivePtr &b);
275 const OptimizationObjectivePtr &b);
The description of this optimization objective.
virtual Cost initialCost(const State *s) const
Returns a cost value corresponding to starting at a state s. No optimal planners currently support th...
virtual bool isFinite(Cost cost) const
Returns whether the cost is finite or not.
A shared pointer wrapper for ompl::base::ProblemDefinition.
virtual Cost stateCost(const State *s) const =0
Evaluate a cost map defined on the state space at a state s.
This class allows for the definition of multiobjective optimal planning problems. Objectives are adde...
std::vector< Component > components_
List of objective/weight pairs.
OptimizationObjectivePtr operator*(double weight, const OptimizationObjectivePtr &a)
Given a weighing factor and an optimization objective, returns a MultiOptimizationObjective containin...
virtual bool isSatisfied(Cost c) const
Check if the the given cost c satisfies the specified cost objective, defined as better than the spec...
virtual Cost identityCost() const
Get the identity cost value. The identity cost value is the cost c_i such that, for all costs c...
Cost goalRegionCostToGo(const State *state, const Goal *goal)
For use when the cost-to-go of a state under the optimization objective is equivalent to the goal reg...
Cost getCostThreshold() const
Returns the cost threshold currently being checked for objective satisfaction.
virtual Cost infiniteCost() const
Get a cost which is greater than all other costs in this OptimizationObjective; required for use in D...
void setCostThreshold(Cost c)
Set the cost threshold for objective satisfaction. When a path is found with a cost better than the c...
virtual Cost betterCost(Cost c1, Cost c2) const
Return the minimum cost given c1 and c2. Uses isCostBetterThan.
virtual Cost motionCost(const State *s1, const State *s2) const =0
Get the cost that corresponds to the motion segment between s1 and s2.
virtual bool isCostEquivalentTo(Cost c1, Cost c2) const
Compare whether cost c1 and cost c2 are equivalent. By default defined as !isCostBetterThan(c1, c2) && !isCostBetterThan(c2, c1), as if c1 is not better than c2, and c2 is not better than c1, then they are equal.
The function used for returning admissible estimates on the optimal cost of the path between a given ...
virtual Cost motionCostHeuristic(const State *s1, const State *s2) const
Defines an admissible estimate on the optimal cost on the motion between states s1 and s2...
std::function< Cost(const State *, const Goal *)> CostToGoHeuristic
The definition of a function which returns an admissible estimate of the optimal path cost from a giv...
Cost costToGo(const State *state, const Goal *goal) const
Uses a cost-to-go heuristic to calculate an admissible estimate of the optimal cost from a given stat...
void setCostToGoHeuristic(const CostToGoHeuristic &costToGo)
Set the cost-to-go heuristic function for this objective. The cost-to-go heuristic is a function whic...
The cost threshold used for checking whether this objective has been satisfied during planning...
A shared pointer wrapper for ompl::base::SpaceInformation.
Defines a pairing of an objective and its weight.
OptimizationObjectivePtr operator+(const OptimizationObjectivePtr &a, const OptimizationObjectivePtr &b)
Given two optimization objectives, returns a MultiOptimizationObjective that combines the two objecti...
virtual Cost averageStateCost(unsigned int numStates) const
Compute the average state cost of this objective by taking a sample of numStates states.
Abstract definition of optimization objectives.
A shared pointer wrapper for ompl::base::OptimizationObjective.
virtual Cost terminalCost(const State *s) const
Returns a cost value corresponding to a path ending at a state s. No optimal planners currently suppo...
virtual bool isCostBetterThan(Cost c1, Cost c2) const
Check whether the the cost c1 is considered better than the cost c2. By default, this returns true if...
bool hasCostToGoHeuristic() const
Check if this objective has a cost-to-go heuristic function.
Whether this multiobjective is locked from further additions.
const SpaceInformationPtr & getSpaceInformation() const
Returns this objective's SpaceInformation. Needed for operators in MultiOptimizationObjective.
virtual bool isSymmetric() const
Check if this objective has a symmetric cost metric, i.e. motionCost(s1, s2) = motionCost(s2, s1). Default implementation returns whether the underlying state space has symmetric interpolation.
virtual Cost combineCosts(Cost c1, Cost c2) const
Get the cost that corresponds to combining the costs c1 and c2. Default implementation defines this c...
The space information for this objective.
const std::string & getDescription() const
Get the description of this optimization objective.
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
virtual void print(std::ostream &out) const
Print information about this optimization objective.
virtual InformedSamplerPtr allocInformedStateSampler(const ProblemDefinitionPtr &probDefn, unsigned int maxNumberCalls) const
Allocate a heuristic-sampling state generator for this cost function, defaults to a basic rejection s...