GCOP
1.0
|
#include <docp.h>
Public Member Functions | |
Docp (System< T, nx, nu, np > &sys, Cost< T, nx, nu, np > &cost, vector< double > &ts, vector< T > &xs, vector< Vectorcd > &us, Vectormd *p=0, bool update=true) | |
virtual | ~Docp () |
virtual void | Iterate () |
void | Update (bool der=true) |
Public Attributes | |
System< T, nx, nu, np > & | sys |
dynamical system | |
Cost< T, nx, nu, np > & | cost |
given cost function | |
std::vector< double > & | ts |
times (N+1) vector | |
std::vector< T > & | xs |
states (N+1) vector | |
std::vector< Vectorcd > & | us |
controls (N) vector | |
Vectormd * | p |
parameter vector | |
std::vector< Matrixnd > | As |
state jacobians along the path (computed internally) | |
std::vector< Matrixncd > | Bs |
control jacobians along the path (computed internally) | |
bool | debug |
whether to display debugging info | |
double | eps |
epsilon used for finite differences | |
double | J |
Optimal cost at any point of time. | |
int | nofevaluations |
Number of Function evaluations at any point of time. |
gcop::Docp< T, nx, nu, np >::Docp | ( | System< T, nx, nu, np > & | sys, |
Cost< T, nx, nu, np > & | cost, | ||
vector< double > & | ts, | ||
vector< T > & | xs, | ||
vector< Vectorcd > & | us, | ||
Vectormd * | p = 0 , |
||
bool | update = true |
||
) |
Create a discrete 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::Docp< T, nx, nu, np >::As, gcop::Docp< T, nx, nu, np >::Bs, gcop::Manifold< T, _n >::n, gcop::System< T, _nx, _nu, _np >::U, gcop::Docp< T, nx, nu, np >::Update(), gcop::Docp< T, nx, nu, np >::us, and gcop::System< T, _nx, _nu, _np >::X.
gcop::Docp< T, nx, nu, np >::~Docp | ( | ) | [virtual] |
void gcop::Docp< T, nx, nu, np >::Iterate | ( | ) | [virtual] |
Perform one DOCP iteration.
Reimplemented in gcop::GnDocp< T, _nx, _nu, _np, _ng, _ntp >, gcop::GnDocp< T, _nx, _nu, _np, _ng, _ntp >, gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, gcop::PDdp< Matrix3d, 3, 3 >, gcop::SDdp< T, nx, nu, np >, gcop::Ddp< T, nx, nu, np >, gcop::TparamDocp< T, nx, nu, np, nz, _ntp >, gcop::Ddp< Matrix3d, n, c, Dynamic >, gcop::Ddp< Body2dState, n, c, Dynamic >, and gcop::Ddp< T, n, c, np >.
void gcop::Docp< T, nx, nu, np >::Update | ( | bool | der = true | ) |
Update the trajectory and (optionally) its linearization
der | whether to update derivatives (A and B matrices) |
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(), gcop::Docp< T, nx, nu, np >::Docp(), and gcop::SDdp< T, nx, nu, np >::SDdp().
std::vector<Matrixnd> gcop::Docp< T, nx, nu, np >::As |
state jacobians along the path (computed internally)
Referenced by gcop::Docp< T, nx, nu, np >::Docp().
std::vector<Matrixncd> gcop::Docp< T, nx, nu, np >::Bs |
control jacobians along the path (computed internally)
Referenced by gcop::Docp< T, nx, nu, np >::Docp().
Cost<T, nx, nu, np>& gcop::Docp< T, nx, nu, np >::cost |
given cost function
bool gcop::Docp< T, nx, nu, np >::debug |
whether to display debugging info
double gcop::Docp< T, nx, nu, np >::eps |
epsilon used for finite differences
double gcop::Docp< T, nx, nu, np >::J |
Optimal cost at any point of time.
int gcop::Docp< T, nx, nu, np >::nofevaluations |
Number of Function evaluations at any point of time.
Referenced by gcop::SDdp< T, nx, nu, np >::SDdp().
Vectormd* gcop::Docp< T, nx, nu, np >::p |
parameter vector
Reimplemented in gcop::PDdp< T, n, c, np >, gcop::PDdp< Body2dState, 6, 3 >, and gcop::PDdp< Matrix3d, 3, 3 >.
System<T, nx, nu, np>& gcop::Docp< T, nx, nu, np >::sys |
dynamical system
std::vector<double>& gcop::Docp< T, nx, nu, np >::ts |
times (N+1) vector
std::vector<Vectorcd>& gcop::Docp< T, nx, nu, np >::us |
controls (N) vector
Referenced by gcop::Ddp< T, nx, nu, np >::Ddp(), gcop::Docp< T, nx, nu, np >::Docp(), and gcop::SDdp< T, nx, nu, np >::SDdp().
std::vector<T>& gcop::Docp< T, nx, nu, np >::xs |
states (N+1) vector
Referenced by gcop::SDdp< T, nx, nu, np >::SDdp().