hpp-centroidal-dynamics  4.13.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,
37  Ref_vectorX sol);
38 
40  virtual LP_status getStatus();
41 
43  virtual double getObjectiveValue() { return m_solver.getObjVal(); }
44 
45  virtual void getDualSolution(Ref_vectorX res) {
46  m_solver.getDualSolution(res.data());
47  }
48 };
49 
50 } // end namespace centroidal_dynamics
51 
52 #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:69
virtual double getObjectiveValue()
Definition: solver_LP_qpoases.hh:43
const Eigen::Ref< const VectorX > & Cref_vectorX
Definition: util.hh:63
virtual void getDualSolution(Ref_vectorX res)
Definition: solver_LP_qpoases.hh:45
#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:49
Eigen::Ref< VectorX > Ref_vectorX
Definition: util.hh:53