KrisLibrary
1.0.0
|
A cost that penalizes via a 1D table lookup of a single index. More...
#include <Tabular.h>
Public Member Functions | |
Tabular1DObjective (const std::vector< Real > &differentialCosts, const std::vector< Real > &terminalCosts, Real a, Real b, int dim) | |
virtual const char * | TypeString () |
Subclasses: return an identifier for this goal type. | |
virtual std::string | Description () |
Subclasses: return a string for printing (optional) | |
virtual bool | PathInvariant () const |
Subclasses: planners may exploit path-invariant costs for faster performance. | |
virtual Real | IncrementalCost (const Interpolator *path) |
virtual Real | TerminalCost (const Vector &qend) |
Public Member Functions inherited from ObjectiveFunctionalBase | |
virtual Real | IncrementalCost (const ControlInput &u, const Interpolator *path) |
virtual Real | IncrementalCost (const KinodynamicMilestonePath &path) |
virtual Real | TerminalCost (const Config &qend) |
Subclasses: return the cost of a terminal state. | |
virtual Real | PathCost (const MilestonePath &path) |
virtual Real | PathCost (const KinodynamicMilestonePath &path) |
virtual bool | SaveParams (AnyCollection &collection) |
Subclasses: read and write parameters to collection. | |
virtual bool | LoadParams (AnyCollection &collection) |
Public Attributes | |
Table1D< Real > | differentialCosts |
Table1D< Real > | terminalCosts |
int | dim |
A cost that penalizes via a 1D table lookup of a single index.
The cost tables are assumed to be on a grid over the interval [a,b]. Values past the interval are clamped to the interval. These are interpreted so the value cost[i] is reached exactly at a+i/n*(b-a), where n = length(cost).
For the incremental cost, the state x(dim) is looked up in differentialCosts. This is integrated over the length of the interpolator.
For the incremental cost, the state x(dim) is looked up in terminalCosts.
Either table can be empty, in which case no cost is assessed.
|
virtual |
Subclasses: return the incremental cost of undertaking the given path. This should be equal to the integral of the differential cost, or at least a good approximation
Reimplemented from ObjectiveFunctionalBase.