tsid  1.8.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
solver-HQP-qpmad.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022 Inria
3 //
4 // This file is part of tsid
5 // tsid is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 // tsid is distributed in the hope that it will be
10 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Lesser Public License for more details. You should have
13 // received a copy of the GNU Lesser General Public License along with
14 // tsid If not, see
15 // <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef __invdyn_solvers_hqp_qpmad_hpp__
19 #define __invdyn_solvers_hqp_qpmad_hpp__
20 
22 
23 #include <qpmad/solver.h>
24 
25 namespace tsid {
26 namespace solvers {
31  public:
32  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
33 
39 
40  typedef qpmad::SolverParameters Settings;
41 
42  SolverHQpmad(const std::string& name);
43 
44  void resize(unsigned int n, unsigned int neq, unsigned int nin) override;
45 
48  const HQPOutput& solve(const HQPData& problemData) override;
49 
51  void retrieveQPData(const HQPData& problemData,
52  const bool hessianRegularization = true) override;
53 
55  double getObjectiveValue() override;
56 
57  Settings& settings() { return m_settings; }
58 
59  protected:
60  void sendMsg(const std::string& s);
61 
62  qpmad::Solver m_solver;
64 
66 
67  Matrix m_H; // hessian matrix
68  Vector m_g; // gradient vector
69  Vector m_lb; // gradient vector
70  Vector m_ub; // gradient vector
71  Matrix m_C; // constraint matrix
72  Vector m_cl; // constraints lower bound
73  Vector m_cu; // constraints upper bound
74 
76 
77  unsigned int m_nc;
78  unsigned int m_n;
79 };
80 } // namespace solvers
81 } // namespace tsid
82 
83 #endif // ifndef __invdyn_solvers_hqp_qpmad_hpp__
Definition: solver-HQP-output.hpp:29
Abstract interface for a Quadratic Program (HQP) solver.
Definition: solver-HQP-base.hpp:34
Implementation of Quadratic Program (HQP) solver using qpmad.
Definition: solver-HQP-qpmad.hpp:30
Vector m_ub
Definition: solver-HQP-qpmad.hpp:70
math::ConstRefMatrix ConstRefMatrix
Definition: solver-HQP-qpmad.hpp:38
math::Vector Vector
Definition: solver-HQP-qpmad.hpp:35
Vector m_cu
Definition: solver-HQP-qpmad.hpp:73
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Matrix Matrix
Definition: solver-HQP-qpmad.hpp:34
Matrix m_H
Definition: solver-HQP-qpmad.hpp:67
Settings m_settings
Definition: solver-HQP-qpmad.hpp:63
math::RefVector RefVector
Definition: solver-HQP-qpmad.hpp:36
Settings & settings()
Definition: solver-HQP-qpmad.hpp:57
qpmad::SolverParameters Settings
Definition: solver-HQP-qpmad.hpp:40
qpmad::Solver m_solver
Definition: solver-HQP-qpmad.hpp:62
unsigned int m_n
number of equality-inequality constraints
Definition: solver-HQP-qpmad.hpp:78
unsigned int m_nc
Definition: solver-HQP-qpmad.hpp:77
double m_hessian_regularization
Definition: solver-HQP-qpmad.hpp:75
math::ConstRefVector ConstRefVector
Definition: solver-HQP-qpmad.hpp:37
Vector m_cl
Definition: solver-HQP-qpmad.hpp:72
Vector m_lb
Definition: solver-HQP-qpmad.hpp:69
bool m_has_bounds
Definition: solver-HQP-qpmad.hpp:65
Vector m_g
Definition: solver-HQP-qpmad.hpp:68
Matrix m_C
Definition: solver-HQP-qpmad.hpp:71
#define TSID_DLLAPI
Definition: config.hh:88
const Eigen::Ref< const Matrix > ConstRefMatrix
Definition: fwd.hpp:51
const Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:48
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:35
Eigen::Ref< Vector > RefVector
Definition: fwd.hpp:47
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition: fwd.hpp:36
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition: fwd.hpp:99
Definition: constraint-bound.hpp:25