OptimizationObjective.cpp
46 ompl::base::OptimizationObjective::OptimizationObjective(SpaceInformationPtr si) : si_(std::move(si)), threshold_(0.0)
91 ompl::base::Cost ompl::base::OptimizationObjective::controlCost(const control::Control *, unsigned int) const
131 ompl::base::Cost ompl::base::OptimizationObjective::averageStateCost(unsigned int numStates) const
158 ompl::base::Cost ompl::base::OptimizationObjective::costToGo(const State *state, const Goal *goal) const
166 ompl::base::Cost ompl::base::OptimizationObjective::motionCostHeuristic(const State *, const State *) const
171 ompl::base::Cost ompl::base::OptimizationObjective::motionCostBestEstimate(const State *, const State *) const
176 const ompl::base::SpaceInformationPtr &ompl::base::OptimizationObjective::getSpaceInformation() const
184 OMPL_INFORM("%s: No direct informed sampling scheme is defined, defaulting to rejection sampling.",
204 ompl::base::MultiOptimizationObjective::MultiOptimizationObjective(const SpaceInformationPtr &si)
209 ompl::base::MultiOptimizationObjective::Component::Component(OptimizationObjectivePtr obj, double weight)
214 void ompl::base::MultiOptimizationObjective::addObjective(const OptimizationObjectivePtr &objective, double weight)
229 const ompl::base::OptimizationObjectivePtr &ompl::base::MultiOptimizationObjective::getObjective(unsigned int idx) const
243 void ompl::base::MultiOptimizationObjective::setObjectiveWeight(unsigned int idx, double weight)
272 ompl::base::Cost ompl::base::MultiOptimizationObjective::motionCost(const State *s1, const State *s2) const
321 ompl::base::OptimizationObjectivePtr ompl::base::operator*(double weight, const OptimizationObjectivePtr &a)
345 ompl::base::OptimizationObjectivePtr ompl::base::operator*(const OptimizationObjectivePtr &a, double weight)
This class allows for the definition of multiobjective optimal planning problems. Objectives are adde...
Definition: OptimizationObjective.h:291
virtual Cost subtractCosts(Cost c1, Cost c2) const
Get the cost that corresponds to subtracting the cost c2 from c1.
Definition: OptimizationObjective.cpp:101
virtual Cost identityCost() const
Get the identity cost value. The identity cost value is the cost c_i such that, for all costs c,...
Definition: OptimizationObjective.cpp:106
const SpaceInformationPtr & getSpaceInformation() const
Returns this objective's SpaceInformation. Needed for operators in MultiOptimizationObjective.
Definition: OptimizationObjective.cpp:176
A shared pointer wrapper for ompl::base::SpaceInformation.
virtual Cost motionCostBestEstimate(const State *s1, const State *s2) const
Defines a possibly inadmissible estimate on the optimal cost on the motion between states s1 and s2....
Definition: OptimizationObjective.cpp:171
virtual bool isSatisfied(Cost c) const
Check if the the given cost c satisfies the specified cost objective, defined as better than the spec...
Definition: OptimizationObjective.cpp:55
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...
Definition: OptimizationObjective.cpp:96
Cost stateCost(const State *s) const override
Definition: OptimizationObjective.cpp:261
const std::string & getDescription() const
Get the description of this optimization objective.
Definition: OptimizationObjective.cpp:50
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...
Definition: OptimizationObjective.h:125
void setCostToGoHeuristic(const CostToGoHeuristic &costToGo)
Set the cost-to-go heuristic function for this objective. The cost-to-go heuristic is a function whic...
Definition: OptimizationObjective.cpp:148
Cost motionCost(const State *s1, const State *s2) const override
Definition: OptimizationObjective.cpp:272
bool hasCostToGoHeuristic() const
Check if this objective has a cost-to-go heuristic function.
Definition: OptimizationObjective.cpp:153
virtual Cost infiniteCost() const
Get a cost which is greater than all other costs in this OptimizationObjective; required for use in D...
Definition: OptimizationObjective.cpp:111
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition: Cost.h:111
A shared pointer wrapper for ompl::base::OptimizationObjective.
bool isLocked() const
Returns whether this multiobjective has been locked from adding further objectives.
Definition: OptimizationObjective.cpp:256
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...
Definition: OptimizationObjective.cpp:181
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...
Definition: OptimizationObjective.cpp:121
const OptimizationObjectivePtr & getObjective(unsigned int idx) const
Returns a specific objective from this multiobjective, where the individual objectives are in order o...
Definition: OptimizationObjective.cpp:229
double getObjectiveWeight(unsigned int idx) const
Returns the weighing factor of a specific objective.
Definition: OptimizationObjective.cpp:236
void lock()
This method "freezes" this multiobjective so that no more objectives can be added to it.
Definition: OptimizationObjective.cpp:251
A shared pointer wrapper for ompl::base::ProblemDefinition.
virtual Cost initialCost(const State *s) const
Returns a cost value corresponding to starting at a state s. No optimal planners currently support th...
Definition: OptimizationObjective.cpp:116
virtual bool isSymmetric() const
Check if this objective has a symmetric cost metric, i.e. motionCost(s1, s2) = motionCost(s2,...
Definition: OptimizationObjective.cpp:126
virtual Cost controlCost(const control::Control *c, unsigned int steps) const
Get the cost that corresponds to the motion created by a control c applied for duration steps....
Definition: OptimizationObjective.cpp:91
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...
Definition: OptimizationObjective.cpp:158
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....
Definition: OptimizationObjective.cpp:166
void setCostThreshold(Cost c)
Set the cost threshold for objective satisfaction. When a path is found with a cost better than the c...
Definition: OptimizationObjective.cpp:65
virtual bool isCostEquivalentTo(Cost c1, Cost c2) const
Compare whether cost c1 and cost c2 are equivalent. By default defined as !isCostBetterThan(c1,...
Definition: OptimizationObjective.cpp:75
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...
Definition: OptimizationObjective.cpp:70
Cost getCostThreshold() const
Returns the cost threshold currently being checked for objective satisfaction.
Definition: OptimizationObjective.cpp:60
void addObjective(const OptimizationObjectivePtr &objective, double weight)
Adds a new objective for this multiobjective. A weight must also be specified for specifying importan...
Definition: OptimizationObjective.cpp:214
virtual void print(std::ostream &out) const
Print information about this optimization objective.
Definition: OptimizationObjective.cpp:189
virtual bool isFinite(Cost cost) const
Returns whether the cost is finite or not.
Definition: OptimizationObjective.cpp:81
OptimizationObjectivePtr operator+(const OptimizationObjectivePtr &a, const OptimizationObjectivePtr &b)
Given two optimization objectives, returns a MultiOptimizationObjective that combines the two objecti...
Definition: OptimizationObjective.cpp:283
virtual Cost betterCost(Cost c1, Cost c2) const
Return the minimum cost given c1 and c2. Uses isCostBetterThan.
Definition: OptimizationObjective.cpp:86
virtual Cost averageStateCost(unsigned int numStates) const
Compute the average state cost of this objective by taking a sample of numStates states.
Definition: OptimizationObjective.cpp:131
A shared pointer wrapper for ompl::base::StateSampler.
void setObjectiveWeight(unsigned int idx, double weight)
Sets the weighing factor of a specific objective.
Definition: OptimizationObjective.cpp:243
std::size_t getObjectiveCount() const
Returns the number of objectives that make up this multiobjective.
Definition: OptimizationObjective.cpp:224
OptimizationObjectivePtr operator*(double weight, const OptimizationObjectivePtr &a)
Given a weighing factor and an optimization objective, returns a MultiOptimizationObjective containin...
Definition: OptimizationObjective.cpp:321
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...
Definition: OptimizationObjective.cpp:195