tsid  1.8.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
solver-HQP-base.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_base_hpp__
19 #define __invdyn_solvers_hqp_base_hpp__
20 
21 #include "tsid/solvers/fwd.hpp"
24 
25 #include <vector>
26 #include <utility>
27 
28 namespace tsid {
29 namespace solvers {
30 
35  public:
36  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
37 
38  static std::string const HQP_status_string[5];
39 
43 
44  SolverHQPBase(const std::string& name);
45  virtual ~SolverHQPBase() = default;
46 
47  virtual const std::string& name() const { return m_name; }
48 
49  virtual void resize(unsigned int n, unsigned int neq, unsigned int nin) = 0;
50 
53  virtual const HQPOutput& solve(const HQPData& problemData) = 0;
54 
56  virtual void retrieveQPData(const HQPData& problemData,
57  const bool hessianRegularization) = 0;
58 
60  virtual double getObjectiveValue() = 0;
61 
63  virtual bool getUseWarmStart() { return m_useWarmStart; }
65  virtual void setUseWarmStart(bool useWarmStart) {
66  m_useWarmStart = useWarmStart;
67  }
68 
70  virtual unsigned int getMaximumIterations() { return m_maxIter; }
72  virtual bool setMaximumIterations(unsigned int maxIter);
73 
75  virtual double getMaximumTime() { return m_maxTime; }
77  virtual bool setMaximumTime(double seconds);
78 
79  protected:
80  std::string m_name;
81  bool m_useWarmStart; // true if the solver is allowed to warm start
82  unsigned int m_maxIter; // max number of iterations
83  double m_maxTime; // max time to solve the HQP [s]
85 };
86 
87 } // namespace solvers
88 } // namespace tsid
89 
90 #endif // ifndef __invdyn_solvers_hqp_base_hpp__
Definition: solver-HQP-output.hpp:29
Abstract interface for a Quadratic Program (HQP) solver.
Definition: solver-HQP-base.hpp:34
virtual double getMaximumTime()
Definition: solver-HQP-base.hpp:75
bool m_useWarmStart
Definition: solver-HQP-base.hpp:81
virtual ~SolverHQPBase()=default
math::ConstRefMatrix ConstRefMatrix
Definition: solver-HQP-base.hpp:42
virtual bool getUseWarmStart()
Definition: solver-HQP-base.hpp:63
double m_maxTime
Definition: solver-HQP-base.hpp:83
std::string m_name
Definition: solver-HQP-base.hpp:80
virtual double getObjectiveValue()=0
virtual void retrieveQPData(const HQPData &problemData, const bool hessianRegularization)=0
virtual const std::string & name() const
Definition: solver-HQP-base.hpp:47
virtual void resize(unsigned int n, unsigned int neq, unsigned int nin)=0
math::RefVector RefVector
Definition: solver-HQP-base.hpp:40
HQPOutput m_output
Definition: solver-HQP-base.hpp:84
virtual void setUseWarmStart(bool useWarmStart)
Definition: solver-HQP-base.hpp:65
unsigned int m_maxIter
Definition: solver-HQP-base.hpp:82
virtual unsigned int getMaximumIterations()
Definition: solver-HQP-base.hpp:70
math::ConstRefVector ConstRefVector
Definition: solver-HQP-base.hpp:41
virtual const HQPOutput & solve(const HQPData &problemData)=0
#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::Ref< Vector > RefVector
Definition: fwd.hpp:47
class TSID_DLLAPI SolverHQPBase
Definition: fwd.hpp:72
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition: fwd.hpp:99
Definition: constraint-bound.hpp:25