GCOP
1.0
|
#include <lqcost.h>
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 |
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 >.
typedef Matrix<double, _nu, _nx> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixcnd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _ng, _np> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixgpd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _ng, _nu> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixgud |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _ng, _nx> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixgxd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _np, _np> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixmd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _np, _nx> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixmnd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _nx, _nu> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixncd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _nx, _nx> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixnd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _nx, _np> gcop::LqCost< T, _nx, _nu, _np, _ng >::Matrixnmd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
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 >.
typedef Matrix<double, _ng, 1> gcop::LqCost< T, _nx, _nu, _np, _ng >::Vectorgd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _np, 1> gcop::LqCost< T, _nx, _nu, _np, _ng >::Vectormd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
typedef Matrix<double, _nx, 1> gcop::LqCost< T, _nx, _nu, _np, _ng >::Vectornd |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost | ( | System< T, _nx, _nu, _np > & | sys, |
double | tf, | ||
const T & | xf, | ||
bool | diag = true |
||
) |
Linear-quadratic cost on a general manifold. Use this constructor for dynamic-size control problem, i.e. LqCost<T>(X, U, tf, xf, ...)
X | state space |
U | control space |
tf | final time |
xf | desired final state |
diag | whether the Q, R, and Qf matrices are diagonal? |
References gcop::LqCost< T, _nx, _nu, _np, _ng >::du, gcop::LqCost< T, _nx, _nu, _np, _ng >::dx, gcop::LqCost< T, _nx, _nu, _np, _ng >::Q, gcop::LqCost< T, _nx, _nu, _np, _ng >::Qf, gcop::LqCost< T, _nx, _nu, _np, _ng >::Qfsqrt, gcop::LqCost< T, _nx, _nu, _np, _ng >::Qsqrt, gcop::LqCost< T, _nx, _nu, _np, _ng >::R, gcop::LqCost< T, _nx, _nu, _np, _ng >::Rsqrt, gcop::System< T, _nx, _nu, _np >::U, gcop::LqCost< T, _nx, _nu, _np, _ng >::uds, gcop::LqCost< T, _nx, _nu, _np, _ng >::UpdateGains(), gcop::System< T, _nx, _nu, _np >::X, and gcop::LqCost< T, _nx, _nu, _np, _ng >::xds.
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
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 from gcop::Cost< T, _nx, _nu, _np, T >.
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
g | residual |
t | time |
x | state |
u | control |
h | time-step |
p | parameter (optional) |
dgdx | derivative wrt x |
dgdu | derivative wrt u |
dgdp | derivative wrt p |
Reimplemented from gcop::LsCost< T, _nx, _nu, _np, _ng, T >.
bool gcop::LqCost< T, _nx, _nu, _np, _ng >::SetContext | ( | const T & | c | ) | [virtual] |
Set context for the cost
c | context |
Reimplemented from gcop::Cost< T, _nx, _nu, _np, T >.
void gcop::LqCost< T, _nx, _nu, _np, _ng >::SetReference | ( | const vector< T > * | xds, |
const vector< Vectorcd > * | uds | ||
) |
Set optional desired reference trajectory and controls
xds | desired state trajectory (optional) |
uds | desired control sequence (optional) |
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().
bool gcop::LqCost< T, _nx, _nu, _np, _ng >::diag |
are the Q, Qf, and R matrices diagonal (true by default)
Vectorcd gcop::LqCost< T, _nx, _nu, _np, _ng >::du [protected] |
control error
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
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().
Matrixnd gcop::LqCost< T, _nx, _nu, _np, _ng >::Q |
state matrix Q
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
Matrixnd gcop::LqCost< T, _nx, _nu, _np, _ng >::Qf |
final state matrix Qf
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
Matrixnd gcop::LqCost< T, _nx, _nu, _np, _ng >::Qfsqrt |
final state matrix Qf sqrt
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
Matrixnd gcop::LqCost< T, _nx, _nu, _np, _ng >::Qsqrt |
state matrix Q sqrt
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
Matrixcd gcop::LqCost< T, _nx, _nu, _np, _ng >::R |
control matrix R
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
Matrixcd gcop::LqCost< T, _nx, _nu, _np, _ng >::Rsqrt |
control matrix R sqrt
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
const vector<Vectorcd>* gcop::LqCost< T, _nx, _nu, _np, _ng >::uds |
optional reference control
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
const vector<T>* gcop::LqCost< T, _nx, _nu, _np, _ng >::xds |
optional reference trajectory
Referenced by gcop::LqCost< T, _nx, _nu, _np, _ng >::LqCost().
const T* gcop::LqCost< T, _nx, _nu, _np, _ng >::xf |
reference to a desired final state