GCOP  1.0
Public Types | Public Member Functions | Public Attributes
gcop::System< T, _nx, _nu, _np > Class Template Reference

#include <system.h>

Inheritance diagram for gcop::System< T, _nx, _nu, _np >:
Inheritance graph
[legend]
Collaboration diagram for gcop::System< T, _nx, _nu, _np >:
Collaboration graph
[legend]

List of all members.

Public Types

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

 System (Manifold< T, _nx > &X, int nu=0, int np=0)
virtual double Step (T &xb, double t, const T &xa, const Vectorcd &u, double h, const Vectormd *p=0, Matrixnd *A=0, Matrixncd *B=0, Matrixnmd *C=0)
virtual double Step (T &xb, double t, const T &xa, const Vectorcd &u, double h, const Vectornd &w, const Vectormd *p, Matrixnd *A=0, Matrixncd *B=0, Matrixnmd *C=0, Matrixnd *D=0)
virtual double Step (T &xb, const Vectorcd &u, double h, const Vectormd *p=0, Matrixnd *A=0, Matrixncd *B=0, Matrixnmd *C=0)
virtual double Step (const Vectorcd &u, double h, const Vectormd *p=0, Matrixnd *A=0, Matrixncd *B=0, Matrixnmd *C=0)
virtual double Step (T &xb, const Vectorcd &u, double h, const Vectornd &w, const Vectormd *p=0, Matrixnd *A=0, Matrixncd *B=0, Matrixnmd *C=0, Matrixnd *D=0)
virtual bool Reset (const T &x, double t=0)
virtual void Rec (T &x, double h)
virtual void print (const T &x) const
virtual bool Noise (Matrixnd &Q, double t, const T &x, const Vectorcd &u, double dt, const Vectormd *p=0)
virtual bool NoiseMatrix (Matrixnd &Q, double t, const T &x, const Vectorcd &u, double h, const Vectormd *p=0)
virtual void StateAndControlsToFlat (VectorXd &y, const T &x, const Vectorcd &u)
virtual void FlatToStateAndControls (T &x, Vectorcd &u, const std::vector< VectorXd > &y)

Public Attributes

Manifold< T, _nx > & X
 state manifold
Rn< _nu > U
 control Euclidean manifold
Rn< _np > P
 parameter Euclidean manifold
int np
 Number of Parameters.
bool internalState
 for some systems (in particular using Bullet) time-stepping is performed using the internal state rather than passing xa and t before each update. Thus in the Step() function xa and t are ignored and instead the internal (x, t) are used. This is false by default.
bool affineNoise
 whether the noise w enters the dynamics in an affine way, i.e. as x = f(t, x, u, p) + H(t, x, u, p)*w
x
 Internal State of the system.
double t
 Internal time of the system.

Detailed Description

template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
class gcop::System< T, _nx, _nu, _np >

Control system interface for dynamic systems on manifolds. Defines the discrete dynamics and any structural/inertial system parameters such as body dimensions, mass matrices, etc...

Subclasses should provide implementation for the time-stepping Step function and optionally for process noise evolution

Authors: Marin Kobilarov marin(at)jhu.edu Gowtham Garimella


Member Typedef Documentation

template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _nu, _nu> gcop::System< T, _nx, _nu, _np >::Matrixcd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _nu, _nx> gcop::System< T, _nx, _nu, _np >::Matrixcnd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _np, _np> gcop::System< T, _nx, _nu, _np >::Matrixmd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _np, _nx> gcop::System< T, _nx, _nu, _np >::Matrixmnd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _nx, _nu> gcop::System< T, _nx, _nu, _np >::Matrixncd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _nx, _nx> gcop::System< T, _nx, _nu, _np >::Matrixnd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _nx, _np> gcop::System< T, _nx, _nu, _np >::Matrixnmd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _nu, 1> gcop::System< T, _nx, _nu, _np >::Vectorcd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _np, 1> gcop::System< T, _nx, _nu, _np >::Vectormd
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
typedef Matrix<double, _nx, 1> gcop::System< T, _nx, _nu, _np >::Vectornd

Constructor & Destructor Documentation

template<typename T, int _nx, int _nu, int _np>
gcop::System< T, _nx, _nu, _np >::System ( Manifold< T, _nx > &  X,
int  nu = 0,
int  np = 0 
)

A system evolving on a state manifold manifold X with nu inputs and np parameters

Parameters:
Xstate manifold
nunumber of control inputs
npnumber of parameters
nwnumber of noise parameters

Member Function Documentation

template<typename T, int _nx, int _nu, int _np>
void gcop::System< T, _nx, _nu, _np >::FlatToStateAndControls ( T &  x,
Vectorcd u,
const std::vector< VectorXd > &  y 
) [virtual]

Convert flat outputs and derivatives of flat outputs to the state and controls of the system.

Parameters:
ygiven flat outputs and derivatives of flat outputs
xgenerated state
ugenerated controls
template<typename T, int _nx, int _nu, int _np>
bool gcop::System< T, _nx, _nu, _np >::Noise ( Matrixnd Q,
double  t,
const T &  x,
const Vectorcd u,
double  dt,
const Vectormd p = 0 
) [virtual]

For filtering purposes, it is often necessary to provide a discrete-time process noise covariance Q, typically used in linear error propagation according to P = A*P*A' + Q

Parameters:
Qdiscrete-time process noise covariance
tstart time
xstart state
ucontrol
dttime-step
pparameter (optional)
Returns:
true if all arguments are feasible
template<typename T, int _nx, int _nu, int _np>
bool gcop::System< T, _nx, _nu, _np >::NoiseMatrix ( Matrixnd Q,
double  t,
const T &  x,
const Vectorcd u,
double  h,
const Vectormd p = 0 
) [virtual]

Noise in the system is modeled as x[i+1] = f(xi,ui,ti,p) + noisematrix(xi,ui,ti,p)*wi This function provides the necessary noise coefficient matrix

Parameters:
Qprovides the noise matrix
tcurrent time
xcurrent state
ucurrent control
htime-step
pparameter (optional)
Returns:
true if all arguments are feasible
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
virtual void gcop::System< T, _nx, _nu, _np >::print ( const T &  x) const [inline, virtual]

General print function to print the state

Reimplemented in gcop::Mbs.

template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
virtual void gcop::System< T, _nx, _nu, _np >::Rec ( T &  x,
double  h 
) [inline, virtual]

Reconstruct the full state. Some states contain redundant parameters for efficiency and it is useful to reconstruct them to maintain a consisten state.

Parameters:
xstate
htime-step

Reimplemented in gcop::Mbs.

template<typename T, int _nx, int _nu, int _np>
bool gcop::System< T, _nx, _nu, _np >::Reset ( const T &  x,
double  t = 0 
) [virtual]

Resets the internal state of the system to one specified

Parameters:
xState to reset to
ttime to reset to (optional)

Reimplemented in gcop::System_extstep< T, _nx, _nu, _np >.

template<typename T, int _nx, int _nu, int _np>
void gcop::System< T, _nx, _nu, _np >::StateAndControlsToFlat ( VectorXd &  y,
const T &  x,
const Vectorcd u 
) [virtual]

Convert a system state and controls to flat outputs for the system.

Parameters:
ythe generated flat outputs
xgiven state
ugiven controls
template<typename T, int _nx, int _nu, int _np>
double gcop::System< T, _nx, _nu, _np >::Step ( T &  xb,
double  t,
const T &  xa,
const Vectorcd u,
double  h,
const Vectormd p = 0,
Matrixnd A = 0,
Matrixncd B = 0,
Matrixnmd C = 0 
) [virtual]

Discrete dynamics update. The function computes the next system state xb given current state xa and applied forces u

Parameters:
xbresulting state
tcurrent time
xacurrent state
ucurrent control
hstep size
pstatic parameters (optional)
Ajacobian w.r.t. x (optional)
Bjacobian w.r.t. u (optional)
Cjacobian w.r.t. p (optional)
template<typename T, int _nx, int _nu, int _np>
double gcop::System< T, _nx, _nu, _np >::Step ( T &  xb,
double  t,
const T &  xa,
const Vectorcd u,
double  h,
const Vectornd w,
const Vectormd p,
Matrixnd A = 0,
Matrixncd B = 0,
Matrixnmd C = 0,
Matrixnd D = 0 
) [virtual]

This is the master (the most general) Step function performing a discrete dynamics update. The function computes the next system state xb given current state xa, time t, applied forces u, parameters p, and noise w. This function calls the deterministic Step function as well as the NoiseMatrix function and combines the output to update the state: xb = f(t, xa, u, p) + H(t, xa, u, p)*w

Parameters:
xbresulting state
tcurrent time
xacurrent state
ucurrent control
hstep size
pstatic parameters (optional, set to 0 to ignore)
wnoise
Ajacobian w.r.t. x (optional)
Bjacobian w.r.t. u (optional)
Cjacobian w.r.t. p (optional)
Djacobian w.r.t. w (optional)
template<typename T, int _nx, int _nu, int _np>
double gcop::System< T, _nx, _nu, _np >::Step ( T &  xb,
const Vectorcd u,
double  h,
const Vectormd p = 0,
Matrixnd A = 0,
Matrixncd B = 0,
Matrixnmd C = 0 
) [virtual]

Discrete Dynamics Update. This function computes the next state xb using the internal input state x_int and applied forces u

Parameters:
xbresulting state
tcurrent time
ucurrent control
hstep size
pstatic parameters (optional)
Ajacobian w.r.t. x (optional)
Bjacobian w.r.t. u (optional)
Cjacobian w.r.t. p (optional)

Reimplemented in gcop::System_extstep< T, _nx, _nu, _np >.

template<typename T, int _nx, int _nu, int _np>
double gcop::System< T, _nx, _nu, _np >::Step ( const Vectorcd u,
double  h,
const Vectormd p = 0,
Matrixnd A = 0,
Matrixncd B = 0,
Matrixnmd C = 0 
) [virtual]

Discrete Dynamics update of internal state and no output

Parameters:
tcurrent time
ucurrent control
hstep size
pstatic parameters (optional)
Ajacobian w.r.t. x (optional)
Bjacobian w.r.t. u (optional)
Cjacobian w.r.t. p (optional)

Reimplemented in gcop::System_extstep< T, _nx, _nu, _np >.

template<typename T, int _nx, int _nu, int _np>
double gcop::System< T, _nx, _nu, _np >::Step ( T &  xb,
const Vectorcd u,
double  h,
const Vectornd w,
const Vectormd p = 0,
Matrixnd A = 0,
Matrixncd B = 0,
Matrixnmd C = 0,
Matrixnd D = 0 
) [virtual]

A version of most general step function with noise and internal state

Parameters:
xbresulting state
ucurrent control
hstep size
wnoise of same size as state
pstatic parameters (optional)
Ajacobian w.r.t. x (optional)
Bjacobian w.r.t. u (optional)
Cjacobian w.r.t. p (optional)
Djacobian w.r.t w (optional)

Member Data Documentation

template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
bool gcop::System< T, _nx, _nu, _np >::affineNoise

whether the noise w enters the dynamics in an affine way, i.e. as x = f(t, x, u, p) + H(t, x, u, p)*w

template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
bool gcop::System< T, _nx, _nu, _np >::internalState

for some systems (in particular using Bullet) time-stepping is performed using the internal state rather than passing xa and t before each update. Thus in the Step() function xa and t are ignored and instead the internal (x, t) are used. This is false by default.

template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
int gcop::System< T, _nx, _nu, _np >::np

Number of Parameters.

template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
Rn<_np> gcop::System< T, _nx, _nu, _np >::P
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
double gcop::System< T, _nx, _nu, _np >::t
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
Rn<_nu> gcop::System< T, _nx, _nu, _np >::U
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
Manifold<T, _nx>& gcop::System< T, _nx, _nu, _np >::X
template<typename T = VectorXd, int _nx = Dynamic, int _nu = Dynamic, int _np = Dynamic>
T gcop::System< T, _nx, _nu, _np >::x

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