Loading...
Searching...
No Matches
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
27namespace tsid
28{
29 namespace solvers
30 {
34 template<int nVars, int nEqCon, int nIneqCon>
36 {
37 public:
38 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
39
45
46 SolverHQuadProgRT(const std::string & name);
47
48 void resize(unsigned int n, unsigned int neq, unsigned int nin);
49
52 const HQPOutput & solve(const HQPData & problemData);
53
55 double getObjectiveValue();
56
58 bool setMaximumIterations(unsigned int maxIter);
59
60 protected:
61
62 void sendMsg(const std::string & s);
63
64 eiquadprog::solvers::RtEiquadprog<nVars, nEqCon, 2*nIneqCon> m_solver;
65
66 typename RtMatrixX<nVars, nVars>::d m_H;
67 typename RtVectorX<nVars>::d m_g;
68 typename RtMatrixX<nEqCon, nVars>::d m_CE;
69 typename RtVectorX<nEqCon>::d m_ce0;
70 typename RtMatrixX<2*nIneqCon, nVars>::d m_CI;
71 typename RtVectorX<2*nIneqCon>::d m_ci0;
72 double m_objValue;
73
75
76 Eigen::VectorXi m_activeSet;
78
79// Eigen::FullPivLU<template RtMatrixX<nEqCon, nVars> > m_CE_lu;
80 // ColPivHouseholderQR
81
82 int m_neq;
83 int m_nin;
84 int m_n;
85 };
86 }
87}
88
89#endif // ifndef __invdyn_solvers_hqp_eiquadprog_rt_hpp__
Definition: solver-HQP-output.hpp:33
Abstract interface for a Quadratic Program (HQP) solver.
Definition: solver-HQP-base.hpp:37
Definition: solver-HQP-eiquadprog-rt.hpp:36
math::ConstRefVector ConstRefVector
Definition: solver-HQP-eiquadprog-rt.hpp:43
RtVectorX< 2 *nIneqCon >::d m_ci0
twice the rows because inequality constraints are bilateral
Definition: solver-HQP-eiquadprog-rt.hpp:71
int m_n
number of inequality constraints
Definition: solver-HQP-eiquadprog-rt.hpp:84
double m_objValue
Definition: solver-HQP-eiquadprog-rt.hpp:72
RtMatrixX< nVars, nVars >::d m_H
Definition: solver-HQP-eiquadprog-rt.hpp:66
int m_activeSetSize
vector containing the indexes of the active inequalities
Definition: solver-HQP-eiquadprog-rt.hpp:77
RtVectorX< nVars >::d m_g
Definition: solver-HQP-eiquadprog-rt.hpp:67
RtMatrixX< 2 *nIneqCon, nVars >::d m_CI
Definition: solver-HQP-eiquadprog-rt.hpp:70
math::ConstRefMatrix ConstRefMatrix
Definition: solver-HQP-eiquadprog-rt.hpp:44
Eigen::VectorXi m_activeSet
Definition: solver-HQP-eiquadprog-rt.hpp:76
int m_nin
number of equality constraints
Definition: solver-HQP-eiquadprog-rt.hpp:83
RtVectorX< nEqCon >::d m_ce0
Definition: solver-HQP-eiquadprog-rt.hpp:69
eiquadprog::solvers::RtEiquadprog< nVars, nEqCon, 2 *nIneqCon > m_solver
Definition: solver-HQP-eiquadprog-rt.hpp:64
math::RefVector RefVector
Definition: solver-HQP-eiquadprog-rt.hpp:42
RtMatrixX< nEqCon, nVars >::d m_CE
Definition: solver-HQP-eiquadprog-rt.hpp:68
int m_neq
Definition: solver-HQP-eiquadprog-rt.hpp:82
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Matrix Matrix
Definition: solver-HQP-eiquadprog-rt.hpp:40
double m_hessian_regularization
Definition: solver-HQP-eiquadprog-rt.hpp:74
math::Vector Vector
Definition: solver-HQP-eiquadprog-rt.hpp:41
#define TSID_DLLAPI
Definition: config.hh:64
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hpp:37
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition: fwd.hpp:38
const Eigen::Ref< const Matrix > ConstRefMatrix
Definition: fwd.hpp:53
const Eigen::Ref< const Vector > ConstRefVector
Definition: fwd.hpp:50
Eigen::Ref< Vector > RefVector
Definition: fwd.hpp:49
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition: fwd.hpp:91
Definition: constraint-bound.hpp:27