wbc
wbc::OsqpSolver Class Reference

The OsqpSolver solves convex quadratic programs (QPs) of the form. More...

#include <OsqpSolver.hpp>

Inheritance diagram for wbc::OsqpSolver:
wbc::QPSolver

Public Member Functions

 OsqpSolver ()
 
 ~OsqpSolver ()
 
virtual void solve (const HierarchicalQP &hierarchical_qp, Eigen::VectorXd &solver_output, bool allow_warm_start=true)
 solve Solve the given quadratic program
 
- Public Member Functions inherited from wbc::QPSolver
 QPSolver ()
 
virtual ~QPSolver ()
 
void reset ()
 reset Enforces reconfiguration at next call to solve()
 

Public Attributes

OsqpEigen::Solver solver
 

Protected Member Functions

void resize (uint nq, uint nc)
 
std::string exitFlagToString (OsqpEigen::ErrorExitFlag flag)
 

Protected Attributes

bool configured
 
Eigen::MatrixXd hessian_dense
 
Eigen::SparseMatrix< double > hessian_sparse
 
Eigen::MatrixXd constraint_mat_dense
 
Eigen::SparseMatrix< double > constraint_mat_sparse
 
Eigen::VectorXd gradient
 
Eigen::VectorXd lower_bound
 
Eigen::VectorXd upper_bound
 
- Protected Attributes inherited from wbc::QPSolver
bool configured
 

Detailed Description

The OsqpSolver solves convex quadratic programs (QPs) of the form.

\[ \begin{array}{ccc} min(\mathbf{x}) & \frac{1}{2} \mathbf{x}^T\mathbf{P}\mathbf{x}+\mathbf{q}^T\mathbf{x}& \\ & & \\ s.t. & \mathbf{l} \leq Ax \leq u& \\ \end{array} \]

The solver runs the following ADMM algorithm, which is described in Stellato, B., Banjac, G., Goulart, P. et al. OSQP: an operator splitting solver for quadratic programs. Math. Prog. Comp. 12, 637–672 (2020). https://doi.org/10.1007/s12532-020-00179-2

Solver Parameters:

  • Check OSQPSettings Struct in file osqp_api_types.h to see all parameters
  • Check osqp_api_constants.h for the default settings
  • To change parameters you can access the public solver variable: solver.settings()->setXY()

Constructor & Destructor Documentation

◆ OsqpSolver()

wbc::OsqpSolver::OsqpSolver ( )

◆ ~OsqpSolver()

wbc::OsqpSolver::~OsqpSolver ( )

Member Function Documentation

◆ exitFlagToString()

std::string wbc::OsqpSolver::exitFlagToString ( OsqpEigen::ErrorExitFlag flag)
inlineprotected

◆ resize()

void wbc::OsqpSolver::resize ( uint nq,
uint nc )
protected

◆ solve()

void wbc::OsqpSolver::solve ( const HierarchicalQP & hierarchical_qp,
Eigen::VectorXd & solver_output,
bool allow_warm_start = true )
virtual

solve Solve the given quadratic program

Parameters
hierarchical_qpDescription of the (hierarchical) quadratic program to solve.
solver_outputsolution of the quadratic program as vector

Implements wbc::QPSolver.

Member Data Documentation

◆ configured

bool wbc::OsqpSolver::configured
protected

◆ constraint_mat_dense

Eigen::MatrixXd wbc::OsqpSolver::constraint_mat_dense
protected

◆ constraint_mat_sparse

Eigen::SparseMatrix<double> wbc::OsqpSolver::constraint_mat_sparse
protected

◆ gradient

Eigen::VectorXd wbc::OsqpSolver::gradient
protected

◆ hessian_dense

Eigen::MatrixXd wbc::OsqpSolver::hessian_dense
protected

◆ hessian_sparse

Eigen::SparseMatrix<double> wbc::OsqpSolver::hessian_sparse
protected

◆ lower_bound

Eigen::VectorXd wbc::OsqpSolver::lower_bound
protected

◆ solver

OsqpEigen::Solver wbc::OsqpSolver::solver

The osqp wrapper variable

◆ upper_bound

Eigen::VectorXd wbc::OsqpSolver::upper_bound
protected

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