tsid 1.9.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
Loading...
Searching...
No Matches
solver-HQP-eiquadprog.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_hpp__
19#define __invdyn_solvers_hqp_eiquadprog_hpp__
20
21#include "tsid/deprecated.hh"
23
24namespace tsid {
25namespace solvers {
29class TSID_DLLAPI SolverHQuadProg : public SolverHQPBase {
30 public:
31 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
32
38
39 SolverHQuadProg(const std::string& name);
40
41 void resize(unsigned int n, unsigned int neq, unsigned int nin) override;
42
45 const HQPOutput& solve(const HQPData& problemData) override;
46
48 void retrieveQPData(const HQPData& problemData,
49 const bool hessianRegularization = true) override;
50
52 const QPDataQuadProg getQPData() const { return m_qpData; }
53
55 double getObjectiveValue() override;
56
57 protected:
58 void sendMsg(const std::string& s);
59
60 TSID_DEPRECATED Matrix m_H;
61 TSID_DEPRECATED Vector m_g;
62 TSID_DEPRECATED Matrix m_CE;
63 TSID_DEPRECATED Vector m_ce0;
64 TSID_DEPRECATED Matrix m_CI;
65 TSID_DEPRECATED Vector m_ci0;
66 double m_objValue;
68
69 Eigen::VectorXi
72
73#ifdef ELIMINATE_EQUALITY_CONSTRAINTS
74 // Eigen::FullPivLU<Matrix> m_CE_dec;
75 // Eigen::ColPivHouseholderQR<Matrix> m_CE_dec; // fast, but
76 // difficult to retrieve null space basis
77 // Eigen::FullPivHouseholderQR<Matrix> m_CE_dec; // doc says
78 // it is slow
79 Eigen::CompleteOrthogonalDecomposition<Matrix>
80 m_CE_dec; // available from Eigen 3.3.0, 40 us for decomposition, 40 us
81 // to get null space basis, 40 us to project Hessian
82 // Eigen::JacobiSVD<Matrix, Eigen::HouseholderQRPreconditioner> m_CE_dec;
83 // // too slow
84 Matrix m_ZT_H_Z;
85 Matrix m_CI_Z;
86#endif
87
88 unsigned int m_neq;
89 unsigned int m_nin;
90 unsigned int m_n;
91
93};
94} // namespace solvers
95} // namespace tsid
96
97#endif // ifndef __invdyn_solvers_hqp_eiquadprog_hpp__
Definition solver-HQP-output.hpp:29
SolverHQPBase(const std::string &name)
Definition solver-HQP-base.cpp:16
virtual const std::string & name() const
Definition solver-HQP-base.hpp:47
TSID_DEPRECATED Matrix m_CI
Definition solver-HQP-eiquadprog.hpp:64
double m_hessian_regularization
Definition solver-HQP-eiquadprog.hpp:67
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Matrix Matrix
Definition solver-HQP-eiquadprog.hpp:33
math::Vector Vector
Definition solver-HQP-eiquadprog.hpp:34
const HQPOutput & solve(const HQPData &problemData) override
Definition solver-HQP-eiquadprog.cpp:207
math::ConstRefVector ConstRefVector
Definition solver-HQP-eiquadprog.hpp:36
math::RefVector RefVector
Definition solver-HQP-eiquadprog.hpp:35
QPDataQuadProgTpl< double > m_qpData
number of variables
Definition solver-HQP-eiquadprog.hpp:92
void resize(unsigned int n, unsigned int neq, unsigned int nin) override
Definition solver-HQP-eiquadprog.cpp:26
double m_objValue
Definition solver-HQP-eiquadprog.hpp:66
unsigned int m_neq
Definition solver-HQP-eiquadprog.hpp:88
tsid::math::Index m_activeSetSize
vector containing the indexes of the active inequalities
Definition solver-HQP-eiquadprog.hpp:71
void retrieveQPData(const HQPData &problemData, const bool hessianRegularization=true) override
Definition solver-HQP-eiquadprog.cpp:62
math::ConstRefMatrix ConstRefMatrix
Definition solver-HQP-eiquadprog.hpp:37
Eigen::VectorXi m_activeSet
Definition solver-HQP-eiquadprog.hpp:70
TSID_DEPRECATED Vector m_g
Definition solver-HQP-eiquadprog.hpp:61
TSID_DEPRECATED Matrix m_H
Definition solver-HQP-eiquadprog.hpp:60
SolverHQuadProg(const std::string &name)
Definition solver-HQP-eiquadprog.cpp:14
const QPDataQuadProg getQPData() const
Definition solver-HQP-eiquadprog.hpp:52
unsigned int m_n
number of inequality constraints
Definition solver-HQP-eiquadprog.hpp:90
unsigned int m_nin
number of equality constraints
Definition solver-HQP-eiquadprog.hpp:89
TSID_DEPRECATED Vector m_ce0
Definition solver-HQP-eiquadprog.hpp:63
TSID_DEPRECATED Vector m_ci0
Definition solver-HQP-eiquadprog.hpp:65
TSID_DEPRECATED Matrix m_CE
Definition solver-HQP-eiquadprog.hpp:62
std::size_t Index
Definition fwd.hpp:40
const Eigen::Ref< const Matrix > ConstRefMatrix
Definition fwd.hpp:38
const Eigen::Ref< const Vector > ConstRefVector
Definition fwd.hpp:35
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition fwd.hpp:22
Eigen::Ref< Vector > RefVector
Definition fwd.hpp:34
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition fwd.hpp:23
Definition fwd.hpp:31
QPDataQuadProgTpl< double > QPDataQuadProg
Definition fwd.hpp:104
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition fwd.hpp:99
Definition constraint-bound.hpp:25
Definition solver-qpData.hpp:33