OptimizationObjective.cpp
103 ompl::base::Cost ompl::base::OptimizationObjective::averageStateCost(unsigned int numStates) const
125 ompl::base::Cost ompl::base::OptimizationObjective::costToGo(const State *state, const Goal *goal) const
133 ompl::base::Cost ompl::base::OptimizationObjective::motionCostHeuristic(const State *s1, const State *s2) const
138 const ompl::base::SpaceInformationPtr& ompl::base::OptimizationObjective::getSpaceInformation() const
153 ompl::base::MultiOptimizationObjective::MultiOptimizationObjective(const SpaceInformationPtr &si) :
165 void ompl::base::MultiOptimizationObjective::addObjective(const OptimizationObjectivePtr& objective,
181 const ompl::base::OptimizationObjectivePtr& ompl::base::MultiOptimizationObjective::getObjective(unsigned int idx) const
279 for (std::vector<MultiOptimizationObjective::Component>::const_iterator comp = components.begin();
311 for (std::vector<MultiOptimizationObjective::Component>::const_iterator comp = components.begin();
virtual Cost stateCost(const State *s) const
Definition: OptimizationObjective.cpp:216
std::string description_
The description of this optimization objective.
Definition: OptimizationObjective.h:135
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:88
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...
Definition: OptimizationObjective.h:155
A boost shared pointer wrapper for ompl::base::StateSampler.
boost::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:50
virtual bool isSatisfied(Cost c) const
Verify that our objective is satisfied already and we can stop planning.
Definition: OptimizationObjective.cpp:53
virtual double distanceGoal(const State *st) const =0
Compute the distance to the goal (heuristic). This function is the one used in computing the distance...
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:78
Cost goalRegionCostToGo(const State *state, const Goal *goal)
For use when goal region's distanceGoal() is equivalent to the cost-to-go of a state under the optimi...
Definition: OptimizationObjective.cpp:143
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:165
Cost getCostThreshold() const
Returns the cost threshold currently being checked for objective satisfaction.
Definition: OptimizationObjective.cpp:58
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:83
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:63
CostToGoHeuristic costToGoFn_
The function used for returning admissible estimates on the optimal cost of the path between a given ...
Definition: OptimizationObjective.h:141
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:133
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:125
OptimizationObjective(const SpaceInformationPtr &si)
Constructor. The objective must always know the space information it is part of. The cost threshold f...
Definition: OptimizationObjective.cpp:42
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:120
Cost threshold_
The cost threshold used for checking whether this objective has been satisfied during planning...
Definition: OptimizationObjective.h:138
bool isLocked() const
Returns whether this multiobjective has been locked from adding further objectives.
Definition: OptimizationObjective.cpp:211
A boost shared pointer wrapper for ompl::base::SpaceInformation.
Defines a pairing of an objective and its weight.
Definition: OptimizationObjective.h:197
OptimizationObjectivePtr operator+(const OptimizationObjectivePtr &a, const OptimizationObjectivePtr &b)
Given two optimization objectives, returns a MultiOptimizationObjective that combines the two objecti...
Definition: OptimizationObjective.cpp:243
void setObjectiveWeight(unsigned int idx, double weight)
Sets the weighing factor of a specific objective.
Definition: OptimizationObjective.cpp:197
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:103
double getThreshold() const
Get the distance to the goal that is allowed for a state to be considered in the goal region...
Definition: GoalRegion.h:88
A boost 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...
Definition: OptimizationObjective.cpp:93
virtual Cost motionCost(const State *s1, const State *s2) const
Definition: OptimizationObjective.cpp:229
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 on...
Definition: OptimizationObjective.cpp:68
void lock()
This method "freezes" this multiobjective so that no more objectives can be added to it...
Definition: OptimizationObjective.cpp:206
const SpaceInformationPtr & getSpaceInformation() const
Returns this objective's SpaceInformation. Needed for operators in MultiOptimizationObjective.
Definition: OptimizationObjective.cpp:138
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.
Definition: OptimizationObjective.cpp:98
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:181
double getObjectiveWeight(unsigned int idx) const
Returns the weighing factor of a specific objective.
Definition: OptimizationObjective.cpp:189
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:73
SpaceInformationPtr si_
The space information for this objective.
Definition: OptimizationObjective.h:132
const std::string & getDescription() const
Get the description of this optimization objective.
Definition: OptimizationObjective.cpp:48
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition: Cost.h:47
OptimizationObjectivePtr operator*(double w, const OptimizationObjectivePtr &a)
Given a weighing factor and an optimization objective, returns a MultiOptimizationObjective containin...
Definition: OptimizationObjective.cpp:289
std::size_t getObjectiveCount() const
Returns the number of objectives that make up this multiobjective.
Definition: OptimizationObjective.cpp:176
static const double BETTER_PATH_COST_MARGIN
When running algorithms such as RRT*, rewire updates are made when the cost of a path appears better ...
Definition: MagicConstants.h:93