hpp-centroidal-dynamics  9.0.2
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 #ifdef qpOASES_FOUND
7 
8 #ifndef HPP_CENTROIDAL_DYNAMICS_SOLVER_LP_QPOASES_HH
9 #define HPP_CENTROIDAL_DYNAMICS_SOLVER_LP_QPOASES_HH
10 
14 #include <qpOASES.hpp>
15 
16 namespace centroidal_dynamics {
17 
18 class CENTROIDAL_DYNAMICS_DLLAPI Solver_LP_qpoases : public Solver_LP_abstract {
19  private:
20  qpOASES::Options m_options; // solver options
21  qpOASES::SQProblem m_solver; // qpoases solver
22 
23  MatrixXX m_H; // Hessian matrix
24  bool m_init_succeeded; // true if solver has been successfully initialized
25  qpOASES::returnValue m_status; // status code returned by the solver
26 
27  public:
28  Solver_LP_qpoases();
29 
30  virtual ~Solver_LP_qpoases() {}
31 
37  LP_status solve(Cref_vectorX c, Cref_vectorX lb, Cref_vectorX ub,
39  Ref_vectorX sol);
40 
42  virtual LP_status getStatus();
43 
45  virtual double getObjectiveValue() { return m_solver.getObjVal(); }
46 
47  virtual void getDualSolution(Ref_vectorX res) {
48  m_solver.getDualSolution(res.data());
49  }
50 };
51 
52 } // end namespace centroidal_dynamics
53 
54 #endif // HPP_CENTROIDAL_DYNAMICS_SOLVER_LP_QPOASES_HH
55 
56 #endif // qpOASES_FOUND
#define CENTROIDAL_DYNAMICS_DLLAPI
Definition: local_config.hh:52
Definition: centroidal_dynamics.hh:14
Eigen::Ref< VectorX > Ref_vectorX
Definition: util.hh:53
const Eigen::Ref< const VectorX > & Cref_vectorX
Definition: util.hh:63
const Eigen::Ref< const MatrixXX > & Cref_matrixXX
Definition: util.hh:69
Eigen::Matrix< value_type, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixXX
Definition: util.hh:49