iCub-main
iCub::ctrl::Riccati Class Reference

#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.

## ◆ 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
 _A State transition matrix _B Control matrix _V State cost matrix _P Control cost matrix _VN Final state cost matrix

Definition at line 26 of file optimalControl.cpp.

## ◆ 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
 step The time index i x The 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
 step The time index i x The state vector ret The control vector

## ◆ L()

 Matrix Riccati::L ( int step )

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

Parameters
 step The 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
 _A State transition matrix _B Control matrix _V State cost matrix _P Control cost matrix _VN Final 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
 verb Flag 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
 steps The 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
 step The time index of the i-th matrix

Definition at line 75 of file optimalControl.cpp.

## ◆ 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: