A sparse MPC solver for walking motion generation.
Public Member Functions | List of all members
smpc::solver Class Referenceabstract

Abstract class providing common interface functions. More...

#include <smpc_solver.h>

Inheritance diagram for smpc::solver:
smpc::solver_as smpc::solver_ip

Public Member Functions

virtual ~solver ()=0
 Virtual destructor. More...
 
virtual void set_parameters (const double *T, const double *h, const double h_initial, const double *angle, const double *zref_x, const double *zref_y, const double *lb, const double *ub)=0
 Initializes quadratic problem. More...
 
virtual void solve ()=0
 Solve QP problem. More...
 
virtual void get_first_controls (control &c) const =0
 Returns the controls that must be applied to reach the next state. More...
 
virtual void get_controls (control &c, const int ind) const =0
 The same as get_first_controls, but takes an additional parameter - the index of the control inputs. Control[ind] is applied to State[ind-1] to reach State[ind]. More...
 
virtual void form_init_fp (const double *x_coord, const double *y_coord, const state_com &init_state, double *X)=0
 Generates an initial feasible point. More...
 
virtual void form_init_fp (const double *x_coord, const double *y_coord, const state_zmp &init_state, double *X)=0
 Generates an initial feasible point. More...
 
virtual void get_next_state (state_com &s) const =0
 Returns the next state. More...
 
virtual void get_next_state (state_zmp &s) const =0
 Returns the next state. More...
 
virtual void get_state (state_com &s, const int ind) const =0
 Returns a state with given index. More...
 
virtual void get_state (state_zmp &s, const int ind) const =0
 Returns a state with given index. More...
 

Detailed Description

Abstract class providing common interface functions.

Definition at line 201 of file smpc_solver.h.

Constructor & Destructor Documentation

◆ ~solver()

smpc::solver::~solver ( )
pure virtual

Virtual destructor.

Definition at line 43 of file smpc_solver.cpp.

Member Function Documentation

◆ form_init_fp() [1/2]

virtual void smpc::solver::form_init_fp ( const double *  x_coord,
const double *  y_coord,
const state_com init_state,
double *  X 
)
pure virtual

Generates an initial feasible point.

Parameters
[in]x_coordx coordinates of points satisfying constraints
[in]y_coordy coordinates of points satisfying constraints
[in]init_stateinitial state (smpc::state_com or smpc::state_zmp)
[in,out]Xsolution of optimization problem

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ form_init_fp() [2/2]

virtual void smpc::solver::form_init_fp ( const double *  x_coord,
const double *  y_coord,
const state_zmp init_state,
double *  X 
)
pure virtual

Generates an initial feasible point.

Parameters
[in]x_coordx coordinates of points satisfying constraints
[in]y_coordy coordinates of points satisfying constraints
[in]init_stateinitial state (smpc::state_com or smpc::state_zmp)
[in,out]Xsolution of optimization problem

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ get_controls()

virtual void smpc::solver::get_controls ( control c,
const int  ind 
) const
pure virtual

The same as get_first_controls, but takes an additional parameter - the index of the control inputs. Control[ind] is applied to State[ind-1] to reach State[ind].

Parameters
[out]can output control vector
[in]indindex of control inputs [0 : N-1].

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ get_first_controls()

virtual void smpc::solver::get_first_controls ( control c) const
pure virtual

Returns the controls that must be applied to reach the next state.

Parameters
[out]can output control vector

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ get_next_state() [1/2]

virtual void smpc::solver::get_next_state ( state_com s) const
pure virtual

Returns the next state.

Parameters
[out]san output state.

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ get_next_state() [2/2]

virtual void smpc::solver::get_next_state ( state_zmp s) const
pure virtual

Returns the next state.

Parameters
[out]san output state.

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ get_state() [1/2]

virtual void smpc::solver::get_state ( state_com s,
const int  ind 
) const
pure virtual

Returns a state with given index.

Parameters
[out]san output state.
[in]indindex of a state [0 : N-1].

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ get_state() [2/2]

virtual void smpc::solver::get_state ( state_zmp s,
const int  ind 
) const
pure virtual

Returns a state with given index.

Parameters
[out]san output state.
[in]indindex of a state [0 : N-1].

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ set_parameters()

virtual void smpc::solver::set_parameters ( const double *  T,
const double *  h,
const double  h_initial,
const double *  angle,
const double *  zref_x,
const double *  zref_y,
const double *  lb,
const double *  ub 
)
pure virtual

Initializes quadratic problem.

Parameters
[in]Tsampling time for each time step [sec.]
[in]hheight of the center of mass divided by gravity for each time step
[in]h_initialinitial value of height of the center of mass divided by gravity
[in]anglerotation angle for each state relative to the world frame
[in]zref_xreference values of x coordinate of ZMP
[in]zref_yreference values of y coordinate of ZMP
[in]lbarray of lower bounds for coordinates of ZMP
[in]ubarray of upper bounds for coordinates of ZMP

Implemented in smpc::solver_ip, and smpc::solver_as.

◆ solve()

virtual void smpc::solver::solve ( )
pure virtual

Solve QP problem.

Implemented in smpc::solver_ip, and smpc::solver_as.


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