iCub-main
Public Member Functions | Protected Attributes | List of all members
iCub::ctrl::Riccati Class Reference

Classic Riccati recursive formula for optimal control in a LQ problem. More...

#include <optimalControl.h>

Public Member Functions

 Riccati (const yarp::sig::Matrix &_A, const yarp::sig::Matrix &_B, const yarp::sig::Matrix &_V, const yarp::sig::Matrix &_P, const yarp::sig::Matrix &_VN, bool verb=false)
 Constructor, with initialization of algebraic Riccati equation. More...
 
yarp::sig::Matrix L (int step)
 Get stored L_i matrix; call this function only after solveRiccati() More...
 
yarp::sig::Matrix T (int step)
 Get stored T_i matrix; call this function only after solveRiccati() More...
 
void setProblemData (const yarp::sig::Matrix &_A, const yarp::sig::Matrix &_B, const yarp::sig::Matrix &_V, const yarp::sig::Matrix &_P, const yarp::sig::Matrix &_VN)
 Initialization of algebraic Riccati equation. More...
 
void solveRiccati (int steps)
 Solve recursively discrete algebraic Riccati equation (DARE) and stores matrices Ti and Li, where i=0:N-1 is the time index. More...
 
yarp::sig::Vector doLQcontrol (int step, const yarp::sig::Vector &x)
 Compute the LQ feedback control, in the form: ret= - L(i) * x. More...
 
void doLQcontrol (int step, const yarp::sig::Vector &x, yarp::sig::Vector &ret)
 Compute the LQ feedback control, in the form: u= - L(i) * x. More...
 
void setVerbose (bool verb=true)
 Enable or disable verbose feedback (that is, printing additional information) More...
 

Protected Attributes

yarp::sig::Matrix A
 
yarp::sig::Matrix At
 
yarp::sig::Matrix B
 
yarp::sig::Matrix Bt
 
yarp::sig::Matrix V
 
yarp::sig::Matrix VN
 
yarp::sig::Matrix P
 
yarp::sig::Matrix TN
 
yarp::sig::Matrix lastT
 
yarp::sig::Matrix * Ti
 
yarp::sig::Matrix * Li
 
yarp::sig::Vector x
 
size_t n
 
size_t m
 
int N
 
bool verbose
 

Detailed Description

Classic Riccati recursive formula for optimal control in a LQ problem.

Definition at line 79 of file optimalControl.h.

Constructor & Destructor Documentation

◆ Riccati()

Riccati::Riccati ( const yarp::sig::Matrix &  _A,
const yarp::sig::Matrix &  _B,
const yarp::sig::Matrix &  _V,
const yarp::sig::Matrix &  _P,
const yarp::sig::Matrix &  _VN,
bool  verb = false 
)

Constructor, with initialization of algebraic Riccati equation.

Parameters
_AState transition matrix
_BControl matrix
_VState cost matrix
_PControl cost matrix
_VNFinal state cost matrix

Definition at line 26 of file optimalControl.cpp.

Member Function Documentation

◆ doLQcontrol() [1/2]

yarp::sig::Vector iCub::ctrl::Riccati::doLQcontrol ( int  step,
const yarp::sig::Vector &  x 
)

Compute the LQ feedback control, in the form: ret= - L(i) * x.

Parameters
stepThe time index i
xThe state vector

◆ doLQcontrol() [2/2]

void iCub::ctrl::Riccati::doLQcontrol ( int  step,
const yarp::sig::Vector &  x,
yarp::sig::Vector &  ret 
)

Compute the LQ feedback control, in the form: u= - L(i) * x.

Parameters
stepThe time index i
xThe state vector
retThe control vector

◆ L()

Matrix Riccati::L ( int  step)

Get stored L_i matrix; call this function only after solveRiccati()

Parameters
stepThe time index of the i-th matrix

Definition at line 56 of file optimalControl.cpp.

◆ setProblemData()

void Riccati::setProblemData ( const yarp::sig::Matrix &  _A,
const yarp::sig::Matrix &  _B,
const yarp::sig::Matrix &  _V,
const yarp::sig::Matrix &  _P,
const yarp::sig::Matrix &  _VN 
)

Initialization of algebraic Riccati equation.

Parameters
_AState transition matrix
_BControl matrix
_VState cost matrix
_PControl cost matrix
_VNFinal state cost matrix

Definition at line 94 of file optimalControl.cpp.

◆ setVerbose()

void Riccati::setVerbose ( bool  verb = true)

Enable or disable verbose feedback (that is, printing additional information)

Parameters
verbFlag for verbose mode

Definition at line 49 of file optimalControl.cpp.

◆ solveRiccati()

void Riccati::solveRiccati ( int  steps)

Solve recursively discrete algebraic Riccati equation (DARE) and stores matrices Ti and Li, where i=0:N-1 is the time index.

Parameters
stepsThe number N of steps of the finite horizon controller

Definition at line 113 of file optimalControl.cpp.

◆ T()

Matrix Riccati::T ( int  step)

Get stored T_i matrix; call this function only after solveRiccati()

Parameters
stepThe time index of the i-th matrix

Definition at line 75 of file optimalControl.cpp.

Member Data Documentation

◆ A

yarp::sig::Matrix iCub::ctrl::Riccati::A
protected

Definition at line 82 of file optimalControl.h.

◆ At

yarp::sig::Matrix iCub::ctrl::Riccati::At
protected

Definition at line 82 of file optimalControl.h.

◆ B

yarp::sig::Matrix iCub::ctrl::Riccati::B
protected

Definition at line 83 of file optimalControl.h.

◆ Bt

yarp::sig::Matrix iCub::ctrl::Riccati::Bt
protected

Definition at line 83 of file optimalControl.h.

◆ lastT

yarp::sig::Matrix iCub::ctrl::Riccati::lastT
protected

Definition at line 87 of file optimalControl.h.

◆ Li

yarp::sig::Matrix* iCub::ctrl::Riccati::Li
protected

Definition at line 89 of file optimalControl.h.

◆ m

size_t iCub::ctrl::Riccati::m
protected

Definition at line 94 of file optimalControl.h.

◆ n

size_t iCub::ctrl::Riccati::n
protected

Definition at line 93 of file optimalControl.h.

◆ N

int iCub::ctrl::Riccati::N
protected

Definition at line 95 of file optimalControl.h.

◆ P

yarp::sig::Matrix iCub::ctrl::Riccati::P
protected

Definition at line 85 of file optimalControl.h.

◆ Ti

yarp::sig::Matrix* iCub::ctrl::Riccati::Ti
protected

Definition at line 88 of file optimalControl.h.

◆ TN

yarp::sig::Matrix iCub::ctrl::Riccati::TN
protected

Definition at line 87 of file optimalControl.h.

◆ V

yarp::sig::Matrix iCub::ctrl::Riccati::V
protected

Definition at line 84 of file optimalControl.h.

◆ verbose

bool iCub::ctrl::Riccati::verbose
protected

Definition at line 97 of file optimalControl.h.

◆ VN

yarp::sig::Matrix iCub::ctrl::Riccati::VN
protected

Definition at line 84 of file optimalControl.h.

◆ x

yarp::sig::Vector iCub::ctrl::Riccati::x
protected

Definition at line 91 of file optimalControl.h.


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