GCOP
1.0
|
#include <pddp.h>
Public Member Functions | |
PDdp (System< T, n, c, np > &sys, Cost< T, n, c, np > &cost, vector< double > &ts, vector< T > &xs, vector< Vectorcd > &us, Vectormd &p, int dynParams=0, bool update=true) | |
void | Iterate () |
void | Update (bool der=true) |
void | Forward () |
void | Backward () |
bool | pdX (const MatrixXd &P) |
Public Attributes | |
int | m |
parameter space dimension | |
int | dynParams |
number of dynamic parameters (that the dynamics depend on) | |
VectorXd & | p |
reference to parameters being optimized | |
VectorXd | dp |
computed parameter increment | |
std::vector< Matrixnmd > | Cs |
std::vector< MatrixXd > | Kuxs |
VectorXd | Lxa |
MatrixXd | Lxxa |
Vectorcd | Lu |
Matrixcd | Luu |
MatrixXd | Lxua |
VectorXd | v |
MatrixXd | P |
double | nu |
current regularization factor nu | |
double | nu0 |
minimum regularization factor nu | |
double | dnu0 |
regularization factor modification step-size | |
bool | printDebug |
gcop::PDdp< T, n, c, np >::PDdp | ( | System< T, n, c, np > & | sys, |
Cost< T, n, c, np > & | cost, | ||
vector< double > & | ts, | ||
vector< T > & | xs, | ||
vector< Vectorcd > & | us, | ||
Vectormd & | p, | ||
int | dynParams = 0 , |
||
bool | update = true |
||
) |
Create a parameter-dependent optimal control problem using a system, a cost, and a trajectory given by a sequence of times, states, controls, and parameters. The times ts must be given, the initial state xs[0] must be set, and the controls us and parameters p will be used as an initial guess for the optimization.
After initialization, every call to Iterate() will optimize the controls us, states xs, and parameters p and modify them accordingly. Problems involving time-optimization will also modify the sequence of times ts.
sys | system |
cost | cost |
ts | (N+1-vector) sequence of discrete times |
xs | (N+1-vector) sequence of discrete states |
us | (N-vector) sequence of control inputs |
p | (m-vector) parameters |
dynParams | how many of these are dynamic parameters (i.e. that the dynamics depends on), the first dynParams in the parameter vector p will be regarded as the dynamic parameters |
update | whether to update trajectory xs using initial state xs[0], inputs us, and parameters p. This is necessary only if xs was not already generated. |
References gcop::PDdp< T, n, c, np >::Cs, gcop::PDdp< T, n, c, np >::Kuxs, gcop::PDdp< T, n, c, np >::Lxa, gcop::PDdp< T, n, c, np >::Lxua, gcop::PDdp< T, n, c, np >::Lxxa, gcop::PDdp< T, n, c, np >::m, gcop::Ddp< T, n, c, np >::N, gcop::Manifold< T, _n >::n, gcop::PDdp< T, n, c, np >::printDebug, gcop::System< T, _nx, _nu, _np >::U, gcop::PDdp< T, n, c, np >::Update(), and gcop::System< T, _nx, _nu, _np >::X.
void gcop::PDdp< T, n, c, np >::Backward | ( | ) |
Backward pass
Reimplemented from gcop::Ddp< T, n, c, np >.
void gcop::PDdp< T, n, c, np >::Forward | ( | ) |
Forward pass
Reimplemented from gcop::Ddp< T, n, c, np >.
void gcop::PDdp< T, n, c, np >::Iterate | ( | ) | [virtual] |
Perform one DDP iteration. Internally calls:
Backward -> Forward -> Update. The controls us and trajectory xs are updated.
Reimplemented from gcop::Ddp< T, n, c, np >.
bool gcop::PDdp< T, n, c, np >::pdX | ( | const MatrixXd & | P | ) | [inline] |
Reimplemented from gcop::Ddp< T, n, c, np >.
void gcop::PDdp< T, n, c, np >::Update | ( | bool | der = true | ) |
Update the trajectory and (optionally) its linearization
der | whether to update derivatives (A and B matrices) |
Reimplemented from gcop::Docp< T, nx, nu, np >.
Referenced by gcop::PDdp< T, n, c, np >::PDdp().
std::vector<Matrixnmd> gcop::PDdp< T, n, c, np >::Cs |
Referenced by gcop::PDdp< T, n, c, np >::PDdp().
double gcop::PDdp< T, n, c, np >::dnu0 |
regularization factor modification step-size
VectorXd gcop::PDdp< T, n, c, np >::dp |
computed parameter increment
int gcop::PDdp< T, n, c, np >::dynParams |
number of dynamic parameters (that the dynamics depend on)
std::vector<MatrixXd> gcop::PDdp< T, n, c, np >::Kuxs |
Reimplemented from gcop::Ddp< T, n, c, np >.
Referenced by gcop::PDdp< T, n, c, np >::PDdp().
Vectorcd gcop::PDdp< T, n, c, np >::Lu |
Reimplemented from gcop::Ddp< T, n, c, np >.
Matrixcd gcop::PDdp< T, n, c, np >::Luu |
Reimplemented from gcop::Ddp< T, n, c, np >.
VectorXd gcop::PDdp< T, n, c, np >::Lxa |
Referenced by gcop::PDdp< T, n, c, np >::PDdp().
MatrixXd gcop::PDdp< T, n, c, np >::Lxua |
Referenced by gcop::PDdp< T, n, c, np >::PDdp().
MatrixXd gcop::PDdp< T, n, c, np >::Lxxa |
Referenced by gcop::PDdp< T, n, c, np >::PDdp().
int gcop::PDdp< T, n, c, np >::m |
parameter space dimension
Referenced by gcop::PDdp< T, n, c, np >::PDdp().
double gcop::PDdp< T, n, c, np >::nu |
current regularization factor nu
double gcop::PDdp< T, n, c, np >::nu0 |
minimum regularization factor nu
VectorXd& gcop::PDdp< T, n, c, np >::p |
reference to parameters being optimized
Reimplemented from gcop::Docp< T, nx, nu, np >.
MatrixXd gcop::PDdp< T, n, c, np >::P |
Reimplemented from gcop::Ddp< T, n, c, np >.
bool gcop::PDdp< T, n, c, np >::printDebug |
Referenced by gcop::PDdp< T, n, c, np >::PDdp().
VectorXd gcop::PDdp< T, n, c, np >::v |
Reimplemented from gcop::Ddp< T, n, c, np >.