hpp-centroidal-dynamics: include/hpp/centroidal-dynamics/solver_LP_qpoases.hh Source File

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
11 #include <hpp/centroidal-dynamics/local_config.hh>
12 #include <hpp/centroidal-dynamics/solver_LP_abstract.hh>
13 #include <hpp/centroidal-dynamics/util.hh>
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,
38 Cref_matrixXX A, Cref_vectorX Alb, Cref_vectorX Aub,
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
local_config.hh
CENTROIDAL_DYNAMICS_DLLAPI
#define CENTROIDAL_DYNAMICS_DLLAPI
Definition: local_config.hh:52
centroidal_dynamics
Definition: centroidal_dynamics.hh:14
centroidal_dynamics::Ref_vectorX
Eigen::Ref< VectorX > Ref_vectorX
Definition: util.hh:53
centroidal_dynamics::Cref_vectorX
const Eigen::Ref< const VectorX > & Cref_vectorX
Definition: util.hh:63
centroidal_dynamics::Cref_matrixXX
const Eigen::Ref< const MatrixXX > & Cref_matrixXX
Definition: util.hh:69
centroidal_dynamics::MatrixXX
Eigen::Matrix< value_type, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixXX
Definition: util.hh:49
solver_LP_abstract.hh
util.hh