GCOP
1.0
|
#include <ddp.h>
Public Member Functions | |
Ddp (System< T, nx, nu, np > &sys, Cost< T, nx, nu, np > &cost, vector< double > &ts, vector< T > &xs, vector< Vectorcd > &us, Vectorpd *p=0, bool update=true) | |
virtual | ~Ddp () |
void | Iterate () |
void | Forward () |
void | Backward () |
bool | pd (const Matrixnd &P) |
bool | pdX (const MatrixXd &P) |
Public Attributes | |
int | N |
number of discrete trajectory segments | |
double | mu |
current regularization factor mu | |
double | mu0 |
minimum regularization factor mu | |
double | dmu0 |
regularization factor modification step-size | |
double | mumax |
maximum regularization factor mu | |
double | a |
step-size | |
std::vector< Vectorcd > | dus |
computed control change | |
std::vector< Vectorcd > | kus |
std::vector< Matrixcnd > | Kuxs |
Vectornd | Lx |
Matrixnd | Lxx |
Vectorcd | Lu |
Matrixcd | Luu |
Matrixnd | P |
Vectornd | v |
double | V |
Vector2d | dV |
double | s1 |
Armijo/Bertsekas step-size control factor s1. | |
double | s2 |
Armijo/Bertsekas step-size control factor s2. | |
double | b1 |
Armijo/Bertsekas step-size control factor b1. | |
double | b2 |
Armijo/Bertsekas step-size control factor b2. | |
char | type |
type of algorithm (choices are PURE, DDP, LQS), LQS is default. In the current implementation second-order expansion of the dynamics is ignored, so DDP and LQS are identical. Both LQS and DDP are implemented using the true nonlinear dynamics integration in the Forward step, while PURE uses the linearized version in order to match exactly the true Newton step. | |
Static Public Attributes | |
static const char | PURE = 0 |
PURE version of algorithm (i.e. stage-wise Newton) | |
static const char | DDP = 1 |
DDP version of algorithm. | |
static const char | LQS = 2 |
Linear-Quadratic Subproblem version of algorithm due to Dreyfus / Dunn&Bertsekas / Pantoja. |
gcop::Ddp< T, nx, nu, np >::Ddp | ( | System< T, nx, nu, np > & | sys, |
Cost< T, nx, nu, np > & | cost, | ||
vector< double > & | ts, | ||
vector< T > & | xs, | ||
vector< Vectorcd > & | us, | ||
Vectorpd * | p = 0 , |
||
bool | update = true |
||
) |
Create an optimal control problem using a system, a cost, and a trajectory given by a sequence of times, states, and controls. The times ts must be given, the initial state xs[0] must be set, and the controls us will be used as an initial guess for the optimization.
After initialization, every call to Iterate() will optimize the controls us and states xs and modify them accordingly. Problems involving time-optimization will also modify the sequence of times ts.
sys | system |
cost | cost |
ts | (N+1) sequence of discrete times |
xs | (N+1) sequence of discrete states |
us | (N) sequence of control inputs |
update | whether to update trajectory xs using initial state xs[0] and inputs us. This is necessary only if xs was not already generated from us. |
References gcop::Ddp< T, nx, nu, np >::dus, gcop::Ddp< T, nx, nu, np >::kus, gcop::Ddp< T, nx, nu, np >::Kuxs, gcop::Ddp< T, nx, nu, np >::Lu, gcop::Ddp< T, nx, nu, np >::Luu, gcop::Ddp< T, nx, nu, np >::Lx, gcop::Ddp< T, nx, nu, np >::Lxx, gcop::Ddp< T, nx, nu, np >::N, gcop::Manifold< T, _n >::n, gcop::Ddp< T, nx, nu, np >::P, gcop::System< T, _nx, _nu, _np >::U, gcop::Docp< T, nx, nu, np >::Update(), gcop::Docp< T, nx, nu, np >::us, gcop::Ddp< T, nx, nu, np >::v, and gcop::System< T, _nx, _nu, _np >::X.
Backward pass
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
Forward pass
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
References gcop::Manifold< Matrix< double, _n, 1 >, _n >::bnd, and gcop::Rn< _n >::Bound().
void gcop::Ddp< T, nx, nu, np >::Iterate | ( | ) | [virtual] |
Perform one DDP iteration. Internally calls:
Backward -> Forward -> Update. The controls us and trajectory xs are updated.
Reimplemented from gcop::Docp< T, nx, nu, np >.
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
bool gcop::Ddp< T, nx, nu, np >::pd | ( | const Matrixnd & | P | ) | [inline] |
bool gcop::Ddp< T, nx, nu, np >::pdX | ( | const MatrixXd & | P | ) | [inline] |
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
double gcop::Ddp< T, nx, nu, np >::a |
step-size
double gcop::Ddp< T, nx, nu, np >::b1 |
Armijo/Bertsekas step-size control factor b1.
double gcop::Ddp< T, nx, nu, np >::b2 |
Armijo/Bertsekas step-size control factor b2.
const char gcop::Ddp< T, nx, nu, np >::DDP = 1 [static] |
DDP version of algorithm.
double gcop::Ddp< T, nx, nu, np >::dmu0 |
regularization factor modification step-size
std::vector<Vectorcd> gcop::Ddp< T, nx, nu, np >::dus |
computed control change
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
Vector2d gcop::Ddp< T, nx, nu, np >::dV |
std::vector<Vectorcd> gcop::Ddp< T, nx, nu, np >::kus |
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
std::vector<Matrixcnd> gcop::Ddp< T, nx, nu, np >::Kuxs |
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
const char gcop::Ddp< T, nx, nu, np >::LQS = 2 [static] |
Linear-Quadratic Subproblem version of algorithm due to Dreyfus / Dunn&Bertsekas / Pantoja.
Vectorcd gcop::Ddp< T, nx, nu, np >::Lu |
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
Matrixcd gcop::Ddp< T, nx, nu, np >::Luu |
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
Vectornd gcop::Ddp< T, nx, nu, np >::Lx |
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
Matrixnd gcop::Ddp< T, nx, nu, np >::Lxx |
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
double gcop::Ddp< T, nx, nu, np >::mu |
current regularization factor mu
double gcop::Ddp< T, nx, nu, np >::mu0 |
minimum regularization factor mu
double gcop::Ddp< T, nx, nu, np >::mumax |
maximum regularization factor mu
int gcop::Ddp< T, nx, nu, np >::N |
number of discrete trajectory segments
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
Matrixnd gcop::Ddp< T, nx, nu, np >::P |
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
const char gcop::Ddp< T, nx, nu, np >::PURE = 0 [static] |
PURE version of algorithm (i.e. stage-wise Newton)
double gcop::Ddp< T, nx, nu, np >::s1 |
Armijo/Bertsekas step-size control factor s1.
double gcop::Ddp< T, nx, nu, np >::s2 |
Armijo/Bertsekas step-size control factor s2.
char gcop::Ddp< T, nx, nu, np >::type |
type of algorithm (choices are PURE, DDP, LQS), LQS is default. In the current implementation second-order expansion of the dynamics is ignored, so DDP and LQS are identical. Both LQS and DDP are implemented using the true nonlinear dynamics integration in the Forward step, while PURE uses the linearized version in order to match exactly the true Newton step.
Vectornd gcop::Ddp< T, nx, nu, np >::v |
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().
double gcop::Ddp< T, nx, nu, np >::V |