base::StateCostIntegralObjective Class Reference

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>

Inheritance diagram for base::StateCostIntegralObjective:

List of all members.

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:
s1start state of the motion to be evaluated
s2final state of the motion to be evaluated
costthe cost of the motion segment

By default, this function computes

\begin{eqnarray*} \mbox{cost} &=& \frac{cost(s_1) + cost(s_2)}{2}\vert s_1 - s_2 \vert \end{eqnarray*}

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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines