centroidal_control_collection
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
CCC::LinearMpcZ Class Reference

Linear MPC of translational z-component motion. More...

#include <LinearMpcZ.h>

Collaboration diagram for CCC::LinearMpcZ:
Collaboration graph
[legend]

Classes

class  ModelContactPhase
 State-space model for contact phase. More...
 
class  ModelNoncontactPhase
 State-space model for non-contact phase. More...
 
struct  WeightParam
 Weight parameter. More...
 

Public Types

using _StateSpaceModel = StateSpaceModel< state_dim_, Eigen::Dynamic, Eigen::Dynamic >
 Type of state-space model. More...
 
using StateDimVector = _StateSpaceModel::StateDimVector
 Type of state vector. More...
 
using InitialParam = Eigen::Vector2d
 Initial parameter. More...
 

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW LinearMpcZ (double mass, double horizon_dt, int horizon_steps, const WeightParam &weight_param=WeightParam(), QpSolverCollection::QpSolverType qp_solver_type=QpSolverCollection::QpSolverType::Any)
 Constructor. More...
 
double planOnce (const std::function< bool(double)> &contact_func, const std::function< double(double)> &ref_pos_func, const InitialParam &initial_param, double current_time)
 Plan one step. More...
 

Public Attributes

double mass_ = 0
 Robot mass [kg]. More...
 
double horizon_dt_ = 0
 Discretization timestep in horizon [sec]. More...
 
int horizon_steps_ = 0
 Number of steps in horizon. More...
 
WeightParam weight_param_
 Objective weight parameter. More...
 
std::shared_ptr< _StateSpaceModelmodel_contact_
 State-space model for contact phase. More...
 
std::shared_ptr< _StateSpaceModelmodel_noncontact_
 State-space model for non-contact phase. More...
 
std::shared_ptr< QpSolverCollection::QpSolver > qp_solver_
 QP solver. More...
 
QpSolverCollection::QpCoeff qp_coeff_
 QP coefficients. More...
 
std::pair< double, double > force_range_
 Min/max z-component force [N]. More...
 

Static Public Attributes

static constexpr int state_dim_ = 2
 State dimension. More...
 

Protected Member Functions

double procOnce (const std::vector< std::shared_ptr< _StateSpaceModel >> &model_list, const StateDimVector &current_x, const Eigen::VectorXd &ref_pos_seq)
 Process one step. More...
 

Detailed Description

Linear MPC of translational z-component motion.

Definition at line 14 of file LinearMpcZ.h.

Member Typedef Documentation

◆ _StateSpaceModel

using CCC::LinearMpcZ::_StateSpaceModel = StateSpaceModel<state_dim_, Eigen::Dynamic, Eigen::Dynamic>

Type of state-space model.

Definition at line 21 of file LinearMpcZ.h.

◆ InitialParam

using CCC::LinearMpcZ::InitialParam = Eigen::Vector2d

Initial parameter.

First element is CoM position, and second element is CoM velocity.

Definition at line 31 of file LinearMpcZ.h.

◆ StateDimVector

Type of state vector.

Definition at line 24 of file LinearMpcZ.h.

Constructor & Destructor Documentation

◆ LinearMpcZ()

EIGEN_MAKE_ALIGNED_OPERATOR_NEW CCC::LinearMpcZ::LinearMpcZ ( double  mass,
double  horizon_dt,
int  horizon_steps,
const WeightParam weight_param = WeightParam(),
QpSolverCollection::QpSolverType  qp_solver_type = QpSolverCollection::QpSolverType::Any 
)

Constructor.

Parameters
massrobot mass [kg]
horizon_dtdiscretization timestep in horizon [sec]
horizon_stepsnumber of steps in horizon
weight_paramobjective weight parameter
qp_solver_typeQP solver type

Member Function Documentation

◆ planOnce()

double CCC::LinearMpcZ::planOnce ( const std::function< bool(double)> &  contact_func,
const std::function< double(double)> &  ref_pos_func,
const InitialParam initial_param,
double  current_time 
)

Plan one step.

Parameters
contact_funcfunction of contact/non-contact phases (returns true for contact phase)
ref_pos_funcfunction of reference position [m]
initial_paraminitial parameter
current_timecurrent time (i.e., start time of horizon) [sec]
Returns
planned force

◆ procOnce()

double CCC::LinearMpcZ::procOnce ( const std::vector< std::shared_ptr< _StateSpaceModel >> &  model_list,
const StateDimVector current_x,
const Eigen::VectorXd &  ref_pos_seq 
)
protected

Process one step.

Member Data Documentation

◆ force_range_

std::pair<double, double> CCC::LinearMpcZ::force_range_

Min/max z-component force [N].

Definition at line 177 of file LinearMpcZ.h.

◆ horizon_dt_

double CCC::LinearMpcZ::horizon_dt_ = 0

Discretization timestep in horizon [sec].

Definition at line 156 of file LinearMpcZ.h.

◆ horizon_steps_

int CCC::LinearMpcZ::horizon_steps_ = 0

Number of steps in horizon.

Definition at line 159 of file LinearMpcZ.h.

◆ mass_

double CCC::LinearMpcZ::mass_ = 0

Robot mass [kg].

Definition at line 153 of file LinearMpcZ.h.

◆ model_contact_

std::shared_ptr<_StateSpaceModel> CCC::LinearMpcZ::model_contact_

State-space model for contact phase.

Definition at line 165 of file LinearMpcZ.h.

◆ model_noncontact_

std::shared_ptr<_StateSpaceModel> CCC::LinearMpcZ::model_noncontact_

State-space model for non-contact phase.

Definition at line 168 of file LinearMpcZ.h.

◆ qp_coeff_

QpSolverCollection::QpCoeff CCC::LinearMpcZ::qp_coeff_

QP coefficients.

Definition at line 174 of file LinearMpcZ.h.

◆ qp_solver_

std::shared_ptr<QpSolverCollection::QpSolver> CCC::LinearMpcZ::qp_solver_

QP solver.

Definition at line 171 of file LinearMpcZ.h.

◆ state_dim_

constexpr int CCC::LinearMpcZ::state_dim_ = 2
staticconstexpr

State dimension.

Definition at line 18 of file LinearMpcZ.h.

◆ weight_param_

WeightParam CCC::LinearMpcZ::weight_param_

Objective weight parameter.

Definition at line 162 of file LinearMpcZ.h.


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