GCOP
1.0
|
#include <cost.h>
Public Types | |
typedef Matrix< double, _nx, 1 > | Vectornd |
typedef Matrix< double, _nu, 1 > | Vectorcd |
typedef Matrix< double, _np, 1 > | Vectormd |
typedef Matrix< double, _nx, _nx > | Matrixnd |
typedef Matrix< double, _nx, _nu > | Matrixncd |
typedef Matrix< double, _nu, _nx > | Matrixcnd |
typedef Matrix< double, _nu, _nu > | Matrixcd |
typedef Matrix< double, _np, _np > | Matrixmd |
typedef Matrix< double, _nx, _np > | Matrixnmd |
typedef Matrix< double, _np, _nx > | Matrixmnd |
Public Member Functions | |
Cost (System< T, _nx, _nu, _np > &sys, double tf) | |
virtual double | L (double t, const T &x, const Vectorcd &u, double h, const Vectormd *p=0, Vectornd *Lx=0, Matrixnd *Lxx=0, Vectorcd *Lu=0, Matrixcd *Luu=0, Matrixncd *Lxu=0, Vectormd *Lp=0, Matrixmd *Lpp=0, Matrixmnd *Lpx=0) |
virtual bool | SetContext (const Tc &c) |
Public Attributes | |
System< T, _nx, _nu, _np > & | sys |
system | |
double | tf |
final time of trajectory |
Cost interface for optimal control on manifolds. Defines a cost function and means to compute difference between two states on a manifold.
Subclasses should provide implementation of either a regular const function L or a parameter-dependent cost function Lp (e.g. for sys id / adaptive control / optimal design problems)
Author: Marin Kobilarov marin(at)jhu.edu
typedef Matrix<double, _nu, _nu> gcop::Cost< T, _nx, _nu, _np, Tc >::Matrixcd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, gcop::LqCost< Matrix4d, 6, _nu >, and gcop::Body2dCost< c >.
typedef Matrix<double, _nu, _nx> gcop::Cost< T, _nx, _nu, _np, Tc >::Matrixcnd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
typedef Matrix<double, _np, _np> gcop::Cost< T, _nx, _nu, _np, Tc >::Matrixmd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
typedef Matrix<double, _np, _nx> gcop::Cost< T, _nx, _nu, _np, Tc >::Matrixmnd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
typedef Matrix<double, _nx, _nu> gcop::Cost< T, _nx, _nu, _np, Tc >::Matrixncd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
typedef Matrix<double, _nx, _nx> gcop::Cost< T, _nx, _nu, _np, Tc >::Matrixnd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
typedef Matrix<double, _nx, _np> gcop::Cost< T, _nx, _nu, _np, Tc >::Matrixnmd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
typedef Matrix<double, _nu, 1> gcop::Cost< T, _nx, _nu, _np, Tc >::Vectorcd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, gcop::LqCost< Matrix4d, 6, _nu >, and gcop::Body2dCost< c >.
typedef Matrix<double, _np, 1> gcop::Cost< T, _nx, _nu, _np, Tc >::Vectormd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
typedef Matrix<double, _nx, 1> gcop::Cost< T, _nx, _nu, _np, Tc >::Vectornd |
Reimplemented in gcop::LsCost< T, _nx, _nu, _np, _ng, Tc >, gcop::LsCost< Body3dState, _nx, _nu, _np, _ng, Body3dState >, gcop::LsCost< M3V2d, _nx, _nu, _np, _ng, M3V2d >, gcop::LsCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng, Matrix< double, _nx, 1 > >, gcop::LsCost< Body2dState, _nx, _nu, _np, _ng, Body2dState >, gcop::LsCost< Matrix4d, _nx, _nu, Dynamic, Dynamic, Matrix4d >, gcop::LsCost< MbsState< nb >, _nx, _nu, Dynamic, Dynamic, MbsState< nb > >, gcop::LsCost< M3V2d, _nx, _nu, Dynamic, Dynamic, M3V2d >, gcop::LsCost< T, _nx, _nu, _np, _ng >, gcop::LsCost< T, _nx, _nu, _np, _ng, T >, gcop::MultiCost< T, _nx, _nu, _np >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, gcop::ConstraintCost< T, _nx, _nu, _np, 1 >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::PqpDemCost< T, _nx, _nu, _np >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
gcop::Cost< T, _nx, _nu, _np, Tc >::Cost | ( | System< T, _nx, _nu, _np > & | sys, |
double | tf | ||
) |
create a cost interface
X | the state manifold which is used to perform addition/subtraction of states |
tf | time horizon: when the cost function L is called it will internally check whether its argument t is equation to tf and return the terminal cost |
double gcop::Cost< T, _nx, _nu, _np, Tc >::L | ( | double | t, |
const T & | x, | ||
const Vectorcd & | u, | ||
double | h, | ||
const Vectormd * | p = 0 , |
||
Vectornd * | Lx = 0 , |
||
Matrixnd * | Lxx = 0 , |
||
Vectorcd * | Lu = 0 , |
||
Matrixcd * | Luu = 0 , |
||
Matrixncd * | Lxu = 0 , |
||
Vectormd * | Lp = 0 , |
||
Matrixmd * | Lpp = 0 , |
||
Matrixmnd * | Lpx = 0 |
||
) | [virtual] |
Create a Sensor Based Cost interface
sys | the system for which cost function is defined. Provides the system manifold X |
Cost | function L |
t | time |
x | state |
u | control |
h | time-step |
Lx | derivative wrt x |
Lxx | derivative wrt x,x |
Lu | derivative wrt u |
Luu | derivative wrt u,u |
Lxu | derivative wrt x,u |
Reimplemented in gcop::MultiCost< T, _nx, _nu, _np >, gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, gcop::LqCost< Matrix4d, 6, _nu >, gcop::ConstraintCost< T, _nx, _nu, _np, _ng >, and gcop::ConstraintCost< T, _nx, _nu, _np, 1 >.
virtual bool gcop::Cost< T, _nx, _nu, _np, Tc >::SetContext | ( | const Tc & | c | ) | [inline, virtual] |
Set context for the cost
c | context |
Reimplemented in gcop::LqCost< T, _nx, _nu, _np, _ng >, gcop::LqCost< M3V2d, 5, 2 >, gcop::LqCost< MbsState< nb >, MBS_DIM(nb), c >, gcop::LqCost< Body2dState, 6, c, Dynamic, 9 >, gcop::LqCost< Body3dState, 12, c, Dynamic, 6 >, gcop::LqCost< M3V2d, 5, 2, Dynamic, 7 >, gcop::LqCost< Matrix< double, _nx, 1 >, _nx, _nu, _np, _ng >, and gcop::LqCost< Matrix4d, 6, _nu >.
System<T, _nx, _nu, _np>& gcop::Cost< T, _nx, _nu, _np, Tc >::sys |
system
double gcop::Cost< T, _nx, _nu, _np, Tc >::tf |
final time of trajectory