centroidal_control_collection
Public Member Functions | Public Attributes | List of all members
CCC::LinearMpcXY::Model Class Reference

State-space model. More...

#include <LinearMpcXY.h>

Inheritance diagram for CCC::LinearMpcXY::Model:
Inheritance graph
[legend]
Collaboration diagram for CCC::LinearMpcXY::Model:
Collaboration graph
[legend]

Public Member Functions

 Model (double mass, const MotionParam &motion_param, int output_dim=0)
 Constructor. More...
 
- Public Member Functions inherited from CCC::StateSpaceModel< StateDim, InputDim, OutputDim >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW StateSpaceModel (int state_dim=StateDim, int input_dim=InputDim, int output_dim=OutputDim)
 Constructor. More...
 
virtual ~StateSpaceModel ()=default
 Destructor. More...
 
int stateDim () const
 Gets the state dimension. More...
 
int inputDim () const
 Gets the input dimension. More...
 
int outputDim () const
 Gets the output dimension. More...
 
StateDimVector stateEq (const StateDimVector &x, const InputDimVector &u) const
 Calculate the continuous state equation. More...
 
StateDimVector stateEqDisc (const StateDimVector &x, const InputDimVector &u) const
 Calculate the discrete state equation. More...
 
OutputDimVector observEq (const StateDimVector &x) const
 Calculate the observation equation. More...
 
OutputDimVector observEq (const StateDimVector &x, const InputDimVector &u) const
 Calculate the observation equation. More...
 
void calcDiscMatrix (double dt)
 Calculate the discrete system matrices \(\boldsymbol{A}_d, \boldsymbol{B}_d, \boldsymbol{e}_d\). More...
 

Public Attributes

MotionParam motion_param_
 Motion parameter. More...
 
- Public Attributes inherited from CCC::StateSpaceModel< StateDim, InputDim, OutputDim >
const int state_dim_ = 0
 State dimension. More...
 
const int input_dim_ = 0
 Input dimension. More...
 
const int output_dim_ = 0
 Output dimension. More...
 
Eigen::Matrix< double, StateDim, StateDim > A_
 Matrix \(\boldsymbol{A}\) of continuous state equation. More...
 
Eigen::Matrix< double, StateDim, InputDim > B_
 Matrix \(\boldsymbol{B}\) of continuous state equation. More...
 
Eigen::Matrix< double, OutputDim, StateDim > C_
 Matrix \(\boldsymbol{C}\) of observation equation. More...
 
Eigen::Matrix< double, OutputDim, InputDim > D_
 Matrix \(\boldsymbol{D}\) of observation equation. More...
 
StateDimVector E_
 Offset vector \(\boldsymbol{e}\) of continuous state equation. More...
 
OutputDimVector F_
 Offset vector \(\boldsymbol{f}\) of observation equation. More...
 
double dt_ = 0
 Discretization timestep [sec] (zero if discrete coefficients are not initialized) More...
 
Eigen::Matrix< double, StateDim, StateDim > Ad_
 Matrix \(\boldsymbol{A}_d\) of discrete state equation. More...
 
Eigen::Matrix< double, StateDim, InputDim > Bd_
 Matrix \(\boldsymbol{B}_d\) of discrete state equation. More...
 
StateDimVector Ed_
 Offset vector \(\boldsymbol{e}_d\) of discrete state equation. More...
 

Additional Inherited Members

- Public Types inherited from CCC::StateSpaceModel< StateDim, InputDim, OutputDim >
using StateDimVector = Eigen::Matrix< double, StateDim, 1 >
 Type of state vector. More...
 
using InputDimVector = Eigen::Matrix< double, InputDim, 1 >
 Type of input vector. More...
 
using OutputDimVector = Eigen::Matrix< double, OutputDim, 1 >
 Type of output vector. More...
 

Detailed Description

State-space model.

Dynamics is expressed by the following equation.

\begin{align*} \boldsymbol{\dot{P}} &= \sum_i \lambda_i \boldsymbol{\rho}_i - m \boldsymbol{g} \\ \boldsymbol{\dot{L}} &= \sum_i (\boldsymbol{p}_i - \boldsymbol{c}) \times \lambda_i \boldsymbol{\rho}_i \end{align*}

\(\boldsymbol{c}\), \(\boldsymbol{P}\), and \(\boldsymbol{L}\) are CoM, linear momentum, and angular momentum, respectively. \(\boldsymbol{p}_i\), \(\lambda_i\), and \(\boldsymbol{\rho}_i\) are position, force scale, and ridge vector of i-th contact vertex ridge, respectively.

This can be represented as a linear time-variant system as follows.

\begin{align*} \boldsymbol{\dot{x}} &= \begin{bmatrix} 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & - \dfrac{f_z}{m} & 0 & 0 & 0 \\ \dfrac{f_z}{m} & 0 & 0 & 0 & 0 & 0 \end{bmatrix} \boldsymbol{x} + \begin{bmatrix} \cdots & 0 & \cdots \\ \cdots & \rho_{i,x} & \cdots \\ \cdots & 0 & \cdots \\ \cdots & \rho_{i,y} & \cdots \\ \cdots & - (p_{i,z} - c_z) \rho_{i,y} + p_{i,y} \rho_{i,z} & \cdots \\ \cdots & (p_{i,z} - c_z) \rho_{i,x} - p_{i,x} \rho_{i,z} & \cdots \end{bmatrix} \boldsymbol{u} \end{align*}

We assume that vertical moton (i.e., CoM height \(c_z\) and total vertical contact force \(f_z\)) is pre-defined.

State, control input, and output are expressed as follows.

\begin{align*} \boldsymbol{x} = \begin{bmatrix} m c_x \\ P_x \\ m c_y \\ P_y \\ L_x \\ L_y \end{bmatrix}, \boldsymbol{u} = \begin{bmatrix} \vdots \\ \lambda_i \\ \vdots \end{bmatrix} \end{align*}

Definition at line 186 of file LinearMpcXY.h.

Constructor & Destructor Documentation

◆ Model()

CCC::LinearMpcXY::Model::Model ( double  mass,
const MotionParam motion_param,
int  output_dim = 0 
)

Constructor.

Parameters
massrobot mass [kg]
motion_parammotion parameter
output_dimoutput dimension

Member Data Documentation

◆ motion_param_

MotionParam CCC::LinearMpcXY::Model::motion_param_

Motion parameter.

Definition at line 198 of file LinearMpcXY.h.


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