tsid  1.8.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
solver-HQP-eiquadprog-rt.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
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_eiquadprog_rt_hpp__
19 #define __invdyn_solvers_hqp_eiquadprog_rt_hpp__
20 
21 #include "tsid/math/fwd.hpp"
22 #include "tsid/solvers/fwd.hpp"
24 
25 #include "eiquadprog/eiquadprog-rt.hpp"
26 
27 namespace tsid {
28 namespace solvers {
32 template <int nVars, int nEqCon, int nIneqCon>
34  public:
35  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
36 
42 
43  SolverHQuadProgRT(const std::string& name);
44 
45  void resize(unsigned int n, unsigned int neq, unsigned int nin) override;
46 
49  const HQPOutput& solve(const HQPData& problemData) override;
50 
51  // TODO: change eiquadprog-rt to new API
53  void retrieveQPData(const HQPData& /*problemData*/,
54  const bool /*hessianRegularization = true*/) override {}
55 
56  // /** Return the QP data object. */
57  // const QPDataQuadProg getQPData() const { return m_qpData; }
58 
60  double getObjectiveValue() override;
61 
63  bool setMaximumIterations(unsigned int maxIter) override;
64 
65  protected:
66  void sendMsg(const std::string& s);
67 
68  eiquadprog::solvers::RtEiquadprog<nVars, nEqCon, 2 * nIneqCon> m_solver;
69 
70  typename RtMatrixX<nVars, nVars>::d m_H;
71  typename RtVectorX<nVars>::d m_g;
72  typename RtMatrixX<nEqCon, nVars>::d m_CE;
73  typename RtVectorX<nEqCon>::d m_ce0;
74  typename RtMatrixX<2 * nIneqCon, nVars>::d
75  m_CI;
76  typename RtVectorX<2 * nIneqCon>::d m_ci0;
77  double m_objValue;
78 
80 
84 
85  // Eigen::FullPivLU<template RtMatrixX<nEqCon, nVars> > m_CE_lu;
86  // ColPivHouseholderQR
87 
88  int m_neq;
89  int m_nin;
90  int m_n;
91 };
92 } // namespace solvers
93 } // namespace tsid
94 
95 #endif // ifndef __invdyn_solvers_hqp_eiquadprog_rt_hpp__
Definition: solver-HQP-output.hpp:29
Abstract interface for a Quadratic Program (HQP) solver.
Definition: solver-HQP-base.hpp:34
Definition: solver-HQP-eiquadprog-rt.hpp:33
math::ConstRefVector ConstRefVector
Definition: solver-HQP-eiquadprog-rt.hpp:40
eiquadprog::solvers::RtEiquadprog< nVars, nEqCon, 2 *nIneqCon > m_solver
Definition: solver-HQP-eiquadprog-rt.hpp:68
RtMatrixX< 2 *nIneqCon, nVars >::d m_CI
Definition: solver-HQP-eiquadprog-rt.hpp:75
int m_n
number of inequality constraints
Definition: solver-HQP-eiquadprog-rt.hpp:90
RtVectorX< 2 *nIneqCon >::d m_ci0
twice the rows because inequality constraints are bilateral
Definition: solver-HQP-eiquadprog-rt.hpp:76
double m_objValue
Definition: solver-HQP-eiquadprog-rt.hpp:77
int m_activeSetSize
vector containing the indexes of the active inequalities
Definition: solver-HQP-eiquadprog-rt.hpp:83
RtVectorX< nVars >::d m_g
Definition: solver-HQP-eiquadprog-rt.hpp:71
RtMatrixX< nEqCon, nVars >::d m_CE
Definition: solver-HQP-eiquadprog-rt.hpp:72
void retrieveQPData(const HQPData &, const bool) override
Definition: solver-HQP-eiquadprog-rt.hpp:53
math::ConstRefMatrix ConstRefMatrix
Definition: solver-HQP-eiquadprog-rt.hpp:41
Eigen::VectorXi m_activeSet
Definition: solver-HQP-eiquadprog-rt.hpp:82
int m_nin
number of equality constraints
Definition: solver-HQP-eiquadprog-rt.hpp:89
RtVectorX< nEqCon >::d m_ce0
Definition: solver-HQP-eiquadprog-rt.hpp:73
math::RefVector RefVector
Definition: solver-HQP-eiquadprog-rt.hpp:39
int m_neq
Definition: solver-HQP-eiquadprog-rt.hpp:88
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Matrix Matrix
Definition: solver-HQP-eiquadprog-rt.hpp:37
RtMatrixX< nVars, nVars >::d m_H
Definition: solver-HQP-eiquadprog-rt.hpp:70
double m_hessian_regularization
Definition: solver-HQP-eiquadprog-rt.hpp:79
math::Vector Vector
Definition: solver-HQP-eiquadprog-rt.hpp:38
#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::VectorXi VectorXi
Definition: fwd.hpp:37
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
class TSID_DLLAPI SolverHQuadProgRT
Definition: fwd.hpp:75
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition: fwd.hpp:99
Definition: constraint-bound.hpp:25