Defines optimization objectives where path cost can be represented as a path integral over a cost function defined over the state space. This cost function is specified by implementing the stateCost() method. More...
#include <ompl/base/objectives/StateCostIntegralObjective.h>

Public Member Functions | |
StateCostIntegralObjective (const SpaceInformationPtr &si, bool enableMotionCostInterpolation=false) | |
If enableMotionCostInterpolation is set to true, then calls to motionCost() will divide the motion segment into smaller parts (the number of parts being defined by StateSpace::validSegmentCount()) for more accurate cost integral computation (but this takes more computation time). If enableMotionCostInterpolation is false (the default), only the two endpoint states are used for motion cost computation. | |
virtual Cost | stateCost (const State *s) const |
Returns a cost with a value of 1. | |
virtual Cost | motionCost (const State *s1, const State *s2) const |
Compute the cost of a path segment from s1 to s2 (including endpoints) | |
bool | isMotionCostInterpolationEnabled () const |
Returns whether this objective subdivides motions into smaller segments for more accurate motion cost computation. Motion cost interpolation is disabled by default. | |
Protected Member Functions | |
Cost | trapezoid (Cost c1, Cost c2, double dist) const |
Helper method which uses the trapezoidal rule to approximate the integral of the cost between two states of distance dist and costs c1 and c2. | |
Protected Attributes | |
bool | interpolateMotionCost_ |
If true, then motionCost() will more accurately compute the cost of a motion by taking small steps along the motion and accumulating the cost. This sacrifices speed for accuracy. If false, the motion cost will be approximated by taking the average of the costs at the two end points, and normalizing by the distance between the two end points. |
Detailed Description
Defines optimization objectives where path cost can be represented as a path integral over a cost function defined over the state space. This cost function is specified by implementing the stateCost() method.
Definition at line 51 of file StateCostIntegralObjective.h.
Member Function Documentation
ompl::base::Cost base::StateCostIntegralObjective::motionCost | ( | const State * | s1, |
const State * | s2 | ||
) | const [virtual] |
Compute the cost of a path segment from s1 to s2 (including endpoints)
- Parameters:
-
s1 start state of the motion to be evaluated s2 final state of the motion to be evaluated cost the cost of the motion segment
By default, this function computes
If enableMotionCostInterpolation was specified as true in constructing this object, the cost will be computed by separating the motion into StateSpace::validSegmentCount() segments, using the above formula to compute the cost of each of those segments, and adding them up.
Implements base::OptimizationObjective.
Definition at line 53 of file StateCostIntegralObjective.cpp.
The documentation for this class was generated from the following files:
- ompl/base/objectives/StateCostIntegralObjective.h
- ompl/base/objectives/src/StateCostIntegralObjective.cpp