hpp-centroidal-dynamics  4.12.0
Utility classes for testing (robust) equilibrium of a system in contact with the environment, and other centroidal dynamics methods.
solver_LP_qpoases.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2015, LAAS-CNRS
3  * Author: Andrea Del Prete
4  */
5 
6 #ifndef HPP_CENTROIDAL_DYNAMICS_SOLVER_LP_QPOASES_HH
7 #define HPP_CENTROIDAL_DYNAMICS_SOLVER_LP_QPOASES_HH
8 
12 #include <qpOASES.hpp>
13 
14 namespace centroidal_dynamics {
15 
17  private:
18  qpOASES::Options m_options; // solver options
19  qpOASES::SQProblem m_solver; // qpoases solver
20 
21  MatrixXX m_H; // Hessian matrix
22  bool m_init_succeeded; // true if solver has been successfully initialized
23  qpOASES::returnValue m_status; // status code returned by the solver
24 
25  public:
27 
28  virtual ~Solver_LP_qpoases() {}
29 
35  LP_status solve(Cref_vectorX c, Cref_vectorX lb, Cref_vectorX ub, Cref_matrixXX A, Cref_vectorX Alb,
36  Cref_vectorX Aub, Ref_vectorX sol);
37 
39  virtual LP_status getStatus();
40 
42  virtual double getObjectiveValue() { return m_solver.getObjVal(); }
43 
44  virtual void getDualSolution(Ref_vectorX res) { m_solver.getDualSolution(res.data()); }
45 };
46 
47 } // end namespace centroidal_dynamics
48 
49 #endif // HPP_CENTROIDAL_DYNAMICS_SOLVER_LP_QPOASES_HH
Definition: centroidal_dynamics.hh:14
Definition: solver_LP_qpoases.hh:16
virtual ~Solver_LP_qpoases()
Definition: solver_LP_qpoases.hh:28
const Eigen::Ref< const MatrixXX > & Cref_matrixXX
Definition: util.hh:67
virtual double getObjectiveValue()
Definition: solver_LP_qpoases.hh:42
const Eigen::Ref< const VectorX > & Cref_vectorX
Definition: util.hh:61
virtual void getDualSolution(Ref_vectorX res)
Definition: solver_LP_qpoases.hh:44
#define CENTROIDAL_DYNAMICS_DLLAPI
Definition: local_config.hh:52
Abstract interface for a Linear Program (LP) solver.
Definition: solver_LP_abstract.hh:41
Eigen::Matrix< value_type, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixXX
Definition: util.hh:47
Eigen::Ref< VectorX > Ref_vectorX
Definition: util.hh:51