GCOP  1.0
Public Types | Public Member Functions | Public Attributes | Protected Attributes
gcop::LqCost< T, _nx, _nu, _np, _ng > Class Template Reference

#include <lqcost.h>

Inheritance diagram for gcop::LqCost< T, _nx, _nu, _np, _ng >:
Inheritance graph
[legend]
Collaboration diagram for gcop::LqCost< T, _nx, _nu, _np, _ng >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Matrix< double, _ng, 1 > Vectorgd
typedef Matrix< double, _ng, _nx > Matrixgxd
typedef Matrix< double, _ng, _nu > Matrixgud
typedef Matrix< double, _ng, _np > Matrixgpd
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

 LqCost (System< T, _nx, _nu, _np > &sys, double tf, const T &xf, bool diag=true)
void UpdateGains ()
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)
bool Res (Vectorgd &g, double t, const T &x, const Vectorcd &u, double h, const Vectormd *p=0, Matrixgxd *dgdx=0, Matrixgud *dgdu=0, Matrixgpd *dgdp=0)
void SetReference (const vector< T > *xds, const vector< Vectorcd > *uds)
virtual bool SetContext (const T &c)

Public Attributes

const T * xf
 reference to a desired final state
bool diag
 are the Q, Qf, and R matrices diagonal (true by default)
Matrixnd Q
 state matrix Q
Matrixnd Qf
 final state matrix Qf
Matrixcd R
 control matrix R
Matrixnd Qsqrt
 state matrix Q sqrt
Matrixnd Qfsqrt
 final state matrix Qf sqrt
Matrixcd Rsqrt
 control matrix R sqrt
const vector< T > * xds
 optional reference trajectory
const vector< Vectorcd > * uds
 optional reference control

Protected Attributes

Vectornd dx
 state error (as a tangent vector)
Vectorcd du
 control error

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
class gcop::LqCost< T, _nx, _nu, _np, _ng >


Member Typedef Documentation

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _nu, _nu> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixcd

Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.

Reimplemented in gcop::Body2dCost< c >.

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _nu, _nx> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixcnd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _ng, _np> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixgpd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _ng, _nu> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixgud
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _ng, _nx> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixgxd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _np, _np> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixmd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _np, _nx> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixmnd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _nx, _nu> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixncd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _nx, _nx> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixnd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _nx, _np> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixnmd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _nu, 1> gcop::LqCost< T, _nx, _nu, _np, _ng >::Vectorcd

Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.

Reimplemented in gcop::Body2dCost< c >.

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _ng, 1> gcop::LqCost< T, _nx, _nu, _np, _ng >::Vectorgd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _np, 1> gcop::LqCost< T, _nx, _nu, _np, _ng >::Vectormd
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
typedef Matrix<double, _nx, 1> gcop::LqCost< T, _nx, _nu, _np, _ng >::Vectornd

Constructor & Destructor Documentation

template<typename T, int _nx, int _nu, int _np, int _ng>
gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost ( System< T, _nx, _nu, _np > &  sys,
double  tf,
const T &  xf,
bool  diag = true 
)

Member Function Documentation

template<typename T, int _nx, int _nu, int _np, int _ng>
double gcop::LqCost< T, _nx, _nu, _np, _ng >::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

Parameters:
systhe system for which cost function is defined. Provides the system manifold X
Costfunction L
ttime
xstate
ucontrol
htime-step
Lxderivative wrt x
Lxxderivative wrt x,x
Luderivative wrt u
Luuderivative wrt u,u
Lxuderivative wrt x,u

Reimplemented from gcop::Cost< T, _nx, _nu, _np, T >.

template<typename T, int _nx, int _nu, int _np, int _ng>
bool gcop::LqCost< T, _nx, _nu, _np, _ng >::Res ( Vectorgd g,
double  t,
const T &  x,
const Vectorcd u,
double  h,
const Vectormd p = 0,
Matrixgxd dgdx = 0,
Matrixgud dgdu = 0,
Matrixgpd dgdp = 0 
) [virtual]

Residual cost

Parameters:
gresidual
ttime
xstate
ucontrol
htime-step
pparameter (optional)
dgdxderivative wrt x
dgduderivative wrt u
dgdpderivative wrt p

Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.

template<typename T, int _nx, int _nu, int _np, int _ng>
bool gcop::LqCost< T, _nx, _nu, _np, _ng >::SetContext ( const T &  c) [virtual]

Set context for the cost

Parameters:
ccontext
Returns:
true if successful

Reimplemented from gcop::Cost< T, _nx, _nu, _np, T >.

template<typename T, int _nx, int _nu, int _np, int _ng>
void gcop::LqCost< T, _nx, _nu, _np, _ng >::SetReference ( const vector< T > *  xds,
const vector< Vectorcd > *  uds 
)

Set optional desired reference trajectory and controls

Parameters:
xdsdesired state trajectory (optional)
udsdesired control sequence (optional)
template<typename T , int _nx, int _nu, int _np, int _ng>
void gcop::LqCost< T, _nx, _nu, _np, _ng >::UpdateGains ( )

Updates the square root gains, i.e. sets Qsqrt = Q.sqrt(), etc...

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().


Member Data Documentation

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
bool gcop::LqCost< T, _nx, _nu, _np, _ng >::diag

are the Q, Qf, and R matrices diagonal (true by default)

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
Vectorcd gcop::LqCost< T, _nx, _nu, _np, _ng >::du [protected]
template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
Vectornd gcop::LqCost< T, _nx, _nu, _np, _ng >::dx [protected]

state error (as a tangent vector)

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
Matrixnd gcop::LqCost< T, _nx, _nu, _np, _ng >::Q

state matrix Q

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
Matrixnd gcop::LqCost< T, _nx, _nu, _np, _ng >::Qf

final state matrix Qf

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
Matrixnd gcop::LqCost< T, _nx, _nu, _np, _ng >::Qfsqrt

final state matrix Qf sqrt

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
Matrixnd gcop::LqCost< T, _nx, _nu, _np, _ng >::Qsqrt

state matrix Q sqrt

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
Matrixcd gcop::LqCost< T, _nx, _nu, _np, _ng >::R

control matrix R

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
Matrixcd gcop::LqCost< T, _nx, _nu, _np, _ng >::Rsqrt

control matrix R sqrt

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
const vector<Vectorcd>* gcop::LqCost< T, _nx, _nu, _np, _ng >::uds

optional reference control

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
const vector<T>* gcop::LqCost< T, _nx, _nu, _np, _ng >::xds

optional reference trajectory

Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().

template<typename T, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic, int _ng = Dynamic>
const T* gcop::LqCost< T, _nx, _nu, _np, _ng >::xf

reference to a desired final state


The documentation for this class was generated from the following file: