GCOP  1.0
Public Member Functions | Public Attributes | Static Public Attributes
gcop::Ddp< T, nx, nu, np > Class Template Reference

#include <ddp.h>

Inheritance diagram for gcop::Ddp< T, nx, nu, np >:
Inheritance graph
[legend]
Collaboration diagram for gcop::Ddp< T, nx, nu, np >:
Collaboration graph
[legend]

List of all members.

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.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
class gcop::Ddp< T, nx, nu, np >


Constructor & Destructor Documentation

template<typename T, int nx, int nu, int np>
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.

Parameters:
syssystem
costcost
ts(N+1) sequence of discrete times
xs(N+1) sequence of discrete states
us(N) sequence of control inputs
updatewhether 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.

template<typename T , int nx, int nu, int np>
gcop::Ddp< T, nx, nu, np >::~Ddp ( ) [virtual]

Member Function Documentation

template<typename T , int nx, int nu, int np>
void gcop::Ddp< T, nx, nu, np >::Backward ( )
template<typename T , int nx, int nu, int np>
void gcop::Ddp< T, nx, nu, np >::Forward ( )
template<typename T , int nx, int nu, int np>
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 >.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
bool gcop::Ddp< T, nx, nu, np >::pd ( const Matrixnd &  P) [inline]
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
bool gcop::Ddp< T, nx, nu, np >::pdX ( const MatrixXd &  P) [inline]

Member Data Documentation

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::a

step-size

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::b1

Armijo/Bertsekas step-size control factor b1.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::b2

Armijo/Bertsekas step-size control factor b2.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
const char gcop::Ddp< T, nx, nu, np >::DDP = 1 [static]

DDP version of algorithm.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::dmu0

regularization factor modification step-size

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
std::vector<Vectorcd> gcop::Ddp< T, nx, nu, np >::dus

computed control change

Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
Vector2d gcop::Ddp< T, nx, nu, np >::dV
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
std::vector<Vectorcd> gcop::Ddp< T, nx, nu, np >::kus
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
std::vector<Matrixcnd> gcop::Ddp< T, nx, nu, np >::Kuxs
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
const char gcop::Ddp< T, nx, nu, np >::LQS = 2 [static]

Linear-Quadratic Subproblem version of algorithm due to Dreyfus / Dunn&Bertsekas / Pantoja.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
Vectorcd gcop::Ddp< T, nx, nu, np >::Lu
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
Matrixcd gcop::Ddp< T, nx, nu, np >::Luu
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
Vectornd gcop::Ddp< T, nx, nu, np >::Lx
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
Matrixnd gcop::Ddp< T, nx, nu, np >::Lxx
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::mu

current regularization factor mu

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::mu0

minimum regularization factor mu

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::mumax

maximum regularization factor mu

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
int gcop::Ddp< T, nx, nu, np >::N

number of discrete trajectory segments

Referenced by gcop::Ddp< T, nx, nu, np >::Ddp().

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
Matrixnd gcop::Ddp< T, nx, nu, np >::P
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
const char gcop::Ddp< T, nx, nu, np >::PURE = 0 [static]

PURE version of algorithm (i.e. stage-wise Newton)

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::s1

Armijo/Bertsekas step-size control factor s1.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::s2

Armijo/Bertsekas step-size control factor s2.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
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.

template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
Vectornd gcop::Ddp< T, nx, nu, np >::v
template<typename T, int nx = Dynamic, int nu = Dynamic, int np = Dynamic>
double gcop::Ddp< T, nx, nu, np >::V

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