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

API of the sparse MPC solver. More...

#include <smpc_solver.h>

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

Public Member Functions

 solver_ip (const int N, const double gain_position=2000.0, const double gain_velocity=150.0, const double gain_acceleration=0.01, const double gain_jerk=1.0, const double tol=1e-3, const double tol_out=1e-2, const double t=100, const double mu=15, const double bs_alpha=0.01, const double bs_beta=0.5, const int unsigned max_iter=0, const backtrackingSearchType bs_type=SMPC_IP_BS_LOGBAR, const bool obj_computation_on=false)
 Constructor: initialize an interior-point method solver. More...
 
 ~solver_ip ()
 
void set_parameters (const double *, const double *, const double, const double *, const double *, const double *, const double *, const double *)
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void form_init_fp (const double *, const double *, const state_com &, double *)
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void form_init_fp (const double *, const double *, const state_zmp &, double *)
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void solve ()
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void get_next_state (state_com &) const
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void get_next_state (state_zmp &) const
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void get_state (state_com &, const int) const
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void get_state (state_zmp &, const int) const
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void get_first_controls (control &) const
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
void get_controls (control &, const int) const
 These functions are documented in the definition of the base abstract class smpc::solver. More...
 
- Public Member Functions inherited from smpc::solver
virtual ~solver ()=0
 Virtual destructor. More...
 

Public Attributes

unsigned int ext_loop_iterations
 The number of iterations of the external loop. More...
 
unsigned int int_loop_iterations
 The total number of iterations of the internal loop. More...
 
unsigned int bt_search_iterations
 The total number of iterations of backtracking search. More...
 
std::vector< double > objective_log
 Contains values of objective function after each iteration, the initial value is also included. More...
 
qp_ipqp_sol
 Internal representation. More...
 

Detailed Description

API of the sparse MPC solver.

Definition at line 434 of file smpc_solver.h.

Constructor & Destructor Documentation

◆ solver_ip()

smpc::solver_ip::solver_ip ( const int  N,
const double  gain_position = 2000.0,
const double  gain_velocity = 150.0,
const double  gain_acceleration = 0.01,
const double  gain_jerk = 1.0,
const double  tol = 1e-3,
const double  tol_out = 1e-2,
const double  t = 100,
const double  mu = 15,
const double  bs_alpha = 0.01,
const double  bs_beta = 0.5,
const int unsigned  max_iter = 0,
const backtrackingSearchType  bs_type = SMPC_IP_BS_LOGBAR,
const bool  obj_computation_on = false 
)

Constructor: initialize an interior-point method solver.

Parameters
[in]NNumber of sampling times in a preview window
[in]gain_positionPosition gain (Alpha)
[in]gain_velocityVelocity gain (Beta)
[in]gain_accelerationAcceleration gain (Gamma)
[in]gain_jerkJerk gain (Eta)
[in]toltolerance (internal loop)
[in]tol_outtolerance of the outer loop, which resolves the problem with new t (kappa) parameter.
[in]tlogarithmic barrier parameter
[in]mumultiplier of t, >1.
[in]bs_alphabacktracking search parameter 0 < alpha < 0.5
[in]bs_betabacktracking search parameter 0 < beta < 1
[in]max_itermaximum number of internal loop iterations (0 = no limit)
[in]bs_typetype of backtracking search, see backtrackingSearchType note that even when it is disabled, the 'bs_beta' parameter is still used.
[in]obj_computation_onenable computation of the objective function (the results are kept in objective_log)

Definition at line 222 of file smpc_solver.cpp.

◆ ~solver_ip()

smpc::solver_ip::~solver_ip ( )

Definition at line 247 of file smpc_solver.cpp.

Member Function Documentation

◆ form_init_fp() [1/2]

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

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 270 of file smpc_solver.cpp.

◆ form_init_fp() [2/2]

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

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 282 of file smpc_solver.cpp.

◆ get_controls()

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

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 389 of file smpc_solver.cpp.

◆ get_first_controls()

void smpc::solver_ip::get_first_controls ( control c) const
virtual

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 383 of file smpc_solver.cpp.

◆ get_next_state() [1/2]

void smpc::solver_ip::get_next_state ( state_com s) const
virtual

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 347 of file smpc_solver.cpp.

◆ get_next_state() [2/2]

void smpc::solver_ip::get_next_state ( state_zmp s) const
virtual

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 312 of file smpc_solver.cpp.

◆ get_state() [1/2]

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

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 353 of file smpc_solver.cpp.

◆ get_state() [2/2]

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

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 318 of file smpc_solver.cpp.

◆ set_parameters()

void smpc::solver_ip::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 
)
virtual

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 256 of file smpc_solver.cpp.

◆ solve()

void smpc::solver_ip::solve ( )
virtual

These functions are documented in the definition of the base abstract class smpc::solver.

Implements smpc::solver.

Definition at line 296 of file smpc_solver.cpp.

Member Data Documentation

◆ bt_search_iterations

unsigned int smpc::solver_ip::bt_search_iterations

The total number of iterations of backtracking search.

Note
Updated by solve function.

Definition at line 520 of file smpc_solver.h.

◆ ext_loop_iterations

unsigned int smpc::solver_ip::ext_loop_iterations

The number of iterations of the external loop.

Note
Updated by solve function.

Definition at line 506 of file smpc_solver.h.

◆ int_loop_iterations

unsigned int smpc::solver_ip::int_loop_iterations

The total number of iterations of the internal loop.

Note
Updated by solve function.

Definition at line 513 of file smpc_solver.h.

◆ objective_log

std::vector<double> smpc::solver_ip::objective_log

Contains values of objective function after each iteration, the initial value is also included.

Note
Updated by solve function (only if the respective flag is set on initialization).

Definition at line 530 of file smpc_solver.h.

◆ qp_sol

qp_ip* smpc::solver_ip::qp_sol

Internal representation.

Definition at line 539 of file smpc_solver.h.


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