tsid 1.9.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
Loading...
Searching...
No Matches
solver-proxqp.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 __solvers_proxqp_hpp__
19#define __solvers_proxqp_hpp__
20
22#include <proxsuite/proxqp/dense/dense.hpp>
23#include <proxsuite/proxqp/sparse/sparse.hpp>
24#include <proxsuite/proxqp/results.hpp>
25
26#ifdef PROFILE_PROXQP
27#define START_PROFILER_PROXQP(x) START_PROFILER(x)
28#define STOP_PROFILER_PROXQP(x) STOP_PROFILER(x)
29#else
30#define START_PROFILER_PROXQP(x)
31#define STOP_PROFILER_PROXQP(x)
32#endif
33
34using namespace proxsuite;
35using namespace proxsuite::proxqp;
36
37namespace tsid {
38namespace solvers {
42class TSID_DLLAPI SolverProxQP : public SolverHQPBase {
43 public:
44 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45
51
52 SolverProxQP(const std::string& name);
53
54 void resize(unsigned int n, unsigned int neq, unsigned int nin) override;
55
57 void retrieveQPData(const HQPData& problemData,
58 const bool hessianRegularization = false) override;
59
61 const QPData getQPData() const { return m_qpData; }
62
65 const HQPOutput& solve(const HQPData& problemData) override;
66
68 double getObjectiveValue() override;
69
71 bool setMaximumIterations(unsigned int maxIter) override;
72
73 void setMuInequality(double muIn);
74 void setMuEquality(double muEq);
75 void setRho(double rho);
76 void setEpsilonAbsolute(double epsAbs);
77 void setEpsilonRelative(double epsRel);
78 void setVerbose(bool isVerbose = false);
79
80 protected:
81 void sendMsg(const std::string& s);
82
83 double m_objValue;
85
86 dense::QP<double> m_solver;
87
88 unsigned int m_neq;
89 unsigned int m_nin;
90 unsigned int m_n;
91
93
94 double m_rho;
95 double m_muIn;
96 double m_muEq;
97 double m_epsAbs;
98 double m_epsRel;
100};
101} // namespace solvers
102} // namespace tsid
103
104#endif // ifndef __solvers_proxqp_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
math::ConstRefVector ConstRefVector
Definition solver-proxqp.hpp:49
double m_muEq
Definition solver-proxqp.hpp:96
double m_muIn
Definition solver-proxqp.hpp:95
bool m_isVerbose
Definition solver-proxqp.hpp:99
double m_rho
Definition solver-proxqp.hpp:94
dense::QP< double > m_solver
Definition solver-proxqp.hpp:86
math::RefVector RefVector
Definition solver-proxqp.hpp:48
math::ConstRefMatrix ConstRefMatrix
Definition solver-proxqp.hpp:50
QPDataTpl< double > m_qpData
number of variables
Definition solver-proxqp.hpp:92
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Matrix Matrix
Definition solver-proxqp.hpp:46
double m_objValue
Definition solver-proxqp.hpp:83
SolverProxQP(const std::string &name)
Definition solver-proxqp.cpp:13
void resize(unsigned int n, unsigned int neq, unsigned int nin) override
Definition solver-proxqp.cpp:33
unsigned int m_n
number of inequality constraints
Definition solver-proxqp.hpp:90
const QPData getQPData() const
Definition solver-proxqp.hpp:61
unsigned int m_neq
Definition solver-proxqp.hpp:88
double m_epsAbs
Definition solver-proxqp.hpp:97
math::Vector Vector
Definition solver-proxqp.hpp:47
double m_hessian_regularization
Definition solver-proxqp.hpp:84
unsigned int m_nin
number of equality constraints
Definition solver-proxqp.hpp:89
void retrieveQPData(const HQPData &problemData, const bool hessianRegularization=false) override
Definition solver-proxqp.cpp:83
double m_epsRel
Definition solver-proxqp.hpp:98
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
QPDataTpl< double > QPData
Definition fwd.hpp:102
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition fwd.hpp:99
Definition constraint-bound.hpp:25
Definition solver-qpData.hpp:23