humoto
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
humoto::MPC Class Referenceabstract

Detailed Description

Abstract base class for Model Predictive Control problems.

Definition at line 97 of file control_problem.h.

#include <control_problem.h>

Inheritance diagram for humoto::MPC:
Inheritance graph

Public Member Functions

virtual void guessSolution (Solution &solution_guess, const Solution &old_solution) const
 Guess solution. More...
 
void initSolutionStructure (humoto::Solution &solution) const
 Initialize structure of the given solution based on the internally stored solution structure. More...
 
virtual void log (humoto::Logger &, const LogEntryName &, const std::string &) const =0
 

Protected Member Functions

 MPC ()
 
 ~MPC ()
 Protected destructor: prevent destruction of the child classes through a base pointer. More...
 

Static Protected Member Functions

template<int t_num_vars, int t_num_controls, typename t_AMatrix , typename t_BMatrix , etools::MatrixSparsityType::Type t_bmatrix_sparsity_type>
static void condense (etools::GenericBlockMatrix< t_num_vars, t_num_vars > &S, etools::BlockMatrix< t_num_vars, t_num_controls, t_bmatrix_sparsity_type > &U, const std::vector< t_AMatrix > &A, const std::vector< t_BMatrix > &B)
 Create the condensed matrices (S,U) of a Model Predictive Control problem such that X = S*x0 + U*u. More...
 
template<typename t_AMatrix , typename t_BMatrix >
static void condense (Eigen::MatrixXd &S, Eigen::MatrixXd &U, const std::vector< t_AMatrix > &A, const std::vector< t_BMatrix > &B)
 Create the condensed matrices (S,U) of a Model Predictive Control problem such that X = S*x0 + U*u. More...
 
template<int t_num_vars, int t_num_outputs, typename t_DMatrix , typename t_EMatrix >
static void condenseOutput (etools::GenericBlockMatrix< t_num_outputs, t_num_vars > &Ox, std::vector< etools::LeftLowerTriangularBlockMatrix< t_num_outputs, etools::MatrixBlockSizeType::DYNAMIC > > &Ou, const std::vector< t_DMatrix > &D, const std::vector< t_EMatrix > &E, const etools::GenericBlockMatrix< t_num_vars, t_num_vars > &Ux, const std::vector< etools::LeftLowerTriangularBlockMatrix< t_num_vars, etools::MatrixBlockSizeType::DYNAMIC > > &Uu)
 Condense output of the system. More...
 
template<typename t_DMatrix , typename t_EMatrix >
static void condenseOutput (Eigen::MatrixXd &Ox, Eigen::MatrixXd &Ou, const t_DMatrix &D, const t_EMatrix &E, const Eigen::MatrixXd &Ux, const Eigen::MatrixXd &Uu)
 Condense output of the system. More...
 
template<int t_num_vars, int t_num_controls, int t_num_outputs, typename t_DMatrix , typename t_EMatrix >
static void condenseOutput (etools::GenericBlockMatrix< t_num_outputs, t_num_vars > &Ox, etools::LeftLowerTriangularBlockMatrix< t_num_outputs, t_num_controls > &Ou, const std::vector< t_DMatrix > &D, const std::vector< t_EMatrix > &E, const etools::GenericBlockMatrix< t_num_vars, t_num_vars > &Ux, const etools::LeftLowerTriangularBlockMatrix< t_num_vars, t_num_controls > &Uu)
 Condense output of the system. More...
 
static void condenseTimeInvariant (Eigen::MatrixXd &S, Eigen::MatrixXd &U, const std::size_t preview_horizon_len, const Eigen::MatrixXd &A, const Eigen::MatrixXd &B)
 Create the condensed matrices (S,U) of a Time Invariant (constant A,B) Model Predictive Control problem such that X = S*x0 + U*u. More...
 

Protected Attributes

SolutionStructure sol_structure_
 

Constructor & Destructor Documentation

◆ ~MPC()

humoto::MPC::~MPC ( )
inlineprotected

Protected destructor: prevent destruction of the child classes through a base pointer.

Definition at line 104 of file control_problem.h.

◆ MPC()

humoto::MPC::MPC ( )
inlineprotected

Definition at line 105 of file control_problem.h.

Member Function Documentation

◆ condense() [1/2]

template<int t_num_vars, int t_num_controls, typename t_AMatrix , typename t_BMatrix , etools::MatrixSparsityType::Type t_bmatrix_sparsity_type>
static void humoto::MPC::condense ( etools::GenericBlockMatrix< t_num_vars, t_num_vars > &  S,
etools::BlockMatrix< t_num_vars, t_num_controls, t_bmatrix_sparsity_type > &  U,
const std::vector< t_AMatrix > &  A,
const std::vector< t_BMatrix > &  B 
)
inlinestaticprotected

Create the condensed matrices (S,U) of a Model Predictive Control problem such that X = S*x0 + U*u.

Template Parameters
t_num_varsnumber of variables
t_num_controlsnumber of controls
t_AMatrixA matrix, should be an Eigen matrix or a scalar
t_BMatrixB matrix, should be an Eigen matrix
Parameters
[out]S
[out]U
[in]A
[in]B

Definition at line 321 of file control_problem.h.

◆ condense() [2/2]

template<typename t_AMatrix , typename t_BMatrix >
static void humoto::MPC::condense ( Eigen::MatrixXd &  S,
Eigen::MatrixXd &  U,
const std::vector< t_AMatrix > &  A,
const std::vector< t_BMatrix > &  B 
)
inlinestaticprotected

Create the condensed matrices (S,U) of a Model Predictive Control problem such that X = S*x0 + U*u.

Template Parameters
t_AMatrixA matrix, should be an Eigen matrix or a scalar
t_BMatrixB matrix, should be an Eigen matrix
Parameters
[out]S
[out]U
[in]A
[in]B

Definition at line 378 of file control_problem.h.

◆ condenseOutput() [1/3]

template<int t_num_vars, int t_num_outputs, typename t_DMatrix , typename t_EMatrix >
static void humoto::MPC::condenseOutput ( etools::GenericBlockMatrix< t_num_outputs, t_num_vars > &  Ox,
std::vector< etools::LeftLowerTriangularBlockMatrix< t_num_outputs, etools::MatrixBlockSizeType::DYNAMIC > > &  Ou,
const std::vector< t_DMatrix > &  D,
const std::vector< t_EMatrix > &  E,
const etools::GenericBlockMatrix< t_num_vars, t_num_vars > &  Ux,
const std::vector< etools::LeftLowerTriangularBlockMatrix< t_num_vars, etools::MatrixBlockSizeType::DYNAMIC > > &  Uu 
)
inlinestaticprotected

Condense output of the system.

output = Ox*x0 + Ou*(u0,...,uN)

Template Parameters
t_num_varsnumber of state variables
t_num_outputsnumber of output variables
t_DMatrixD matrix, should be an Eigen matrix or a scalar
t_EMatrixE matrix, should be an Eigen matrix or a scalar
Parameters
[out]Oxmatrix Ox
[out]Ouvector of Ou matrices
[in]Dvector of D matrices
[in]Evector of E matrices
[in]Uxmatrix Ux
[in]Uuvector of Uu matrices

Definition at line 129 of file control_problem.h.

◆ condenseOutput() [2/3]

template<typename t_DMatrix , typename t_EMatrix >
static void humoto::MPC::condenseOutput ( Eigen::MatrixXd &  Ox,
Eigen::MatrixXd &  Ou,
const t_DMatrix &  D,
const t_EMatrix &  E,
const Eigen::MatrixXd &  Ux,
const Eigen::MatrixXd &  Uu 
)
inlinestaticprotected

Condense output of the system.

output = Ox*x0 + Ou*(u0,...,uN)

Template Parameters
t_num_varsnumber of state variables
t_num_controlsnumber of control variables
t_num_outputsnumber of output variables
t_DMatrixD matrix, should be an Eigen matrix or a scalar
t_EMatrixE matrix, should be an Eigen matrix or a scalar
Parameters
[out]Oxmatrix Ox
[out]Oumatrix Ou
[in]DD matrix
[in]EE matrix
[in]Uxmatrix Ux
[in]Uumatrix Uu

Definition at line 209 of file control_problem.h.

◆ condenseOutput() [3/3]

template<int t_num_vars, int t_num_controls, int t_num_outputs, typename t_DMatrix , typename t_EMatrix >
static void humoto::MPC::condenseOutput ( etools::GenericBlockMatrix< t_num_outputs, t_num_vars > &  Ox,
etools::LeftLowerTriangularBlockMatrix< t_num_outputs, t_num_controls > &  Ou,
const std::vector< t_DMatrix > &  D,
const std::vector< t_EMatrix > &  E,
const etools::GenericBlockMatrix< t_num_vars, t_num_vars > &  Ux,
const etools::LeftLowerTriangularBlockMatrix< t_num_vars, t_num_controls > &  Uu 
)
inlinestaticprotected

Condense output of the system.

output = Ox*x0 + Ou*(u0,...,uN)

Template Parameters
t_num_varsnumber of state variables
t_num_controlsnumber of control variables
t_num_outputsnumber of output variables
t_DMatrixD matrix, should be an Eigen matrix or a scalar
t_EMatrixE matrix, should be an Eigen matrix or a scalar
Parameters
[out]Oxmatrix Ox
[out]Oumatrix Ou
[in]Dvector of D matrices
[in]Evector of E matrices
[in]Uxmatrix Ux
[in]Uumatrix Uu

Definition at line 268 of file control_problem.h.

◆ condenseTimeInvariant()

static void humoto::MPC::condenseTimeInvariant ( Eigen::MatrixXd &  S,
Eigen::MatrixXd &  U,
const std::size_t  preview_horizon_len,
const Eigen::MatrixXd &  A,
const Eigen::MatrixXd &  B 
)
inlinestaticprotected

Create the condensed matrices (S,U) of a Time Invariant (constant A,B) Model Predictive Control problem such that X = S*x0 + U*u.

Parameters
[out]S
[out]U
[in]preview_horizon_lenlength of the preview horizon
[in]A
[in]B

Definition at line 428 of file control_problem.h.

◆ guessSolution()

virtual void humoto::ControlProblem::guessSolution ( Solution solution_guess,
const Solution old_solution 
) const
inlinevirtualinherited

Guess solution.

Parameters
[out]solution_guesssolution guess
[in]old_solutionold solution
Attention
This method is called automatically. Can (and often should) be redefined in derived classes.

Reimplemented in humoto::pepper_mpc::MPCforMG, and humoto::wpg04::MPCforWPG.

Definition at line 82 of file control_problem.h.

◆ initSolutionStructure()

void humoto::ControlProblem::initSolutionStructure ( humoto::Solution solution) const
inlineinherited

Initialize structure of the given solution based on the internally stored solution structure.

Parameters
[out]solutionsolution
Attention
This method is called automatically.

Definition at line 64 of file control_problem.h.

◆ log()

virtual void humoto::ControlProblem::log ( humoto::Logger ,
const LogEntryName ,
const std::string &   
) const
pure virtualinherited

Member Data Documentation

◆ sol_structure_

SolutionStructure humoto::ControlProblem::sol_structure_
protectedinherited

Definition at line 43 of file control_problem.h.


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