hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
qp-static-stability.hh
Go to the documentation of this file.
1 // Copyright (c) 2015, LAAS-CNRS
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of hpp-constraints.
5 // hpp-constraints 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 //
10 // hpp-constraints is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-constraints. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HPP_CONSTRAINTS_QP_STATIC_STABILITY_HH
18 # define HPP_CONSTRAINTS_QP_STATIC_STABILITY_HH
19 
20 # include <hpp/constraints/fwd.hh>
21 
25 
26 # include <qpOASES.hpp>
27 
28 namespace hpp {
29  namespace constraints {
30 
33  class HPP_CONSTRAINTS_DLLAPI QPStaticStability : public DifferentiableFunction {
34  public:
35  static const Eigen::Matrix <value_type, 6, 1> Gravity;
36 
40 
44  QPStaticStability (const std::string& name, const DevicePtr_t& robot,
45  const Contacts_t& contacts,
46  const CenterOfMassComputationPtr_t& com);
47 
51  QPStaticStability (const std::string& name, const DevicePtr_t& robot,
52  const std::vector <ForceData>& contacts,
53  const CenterOfMassComputationPtr_t& com);
54 
56  const std::string& name,
57  const DevicePtr_t& robot,
58  const Contacts_t& contacts,
59  const CenterOfMassComputationPtr_t& com);
60 
62  const std::string& name,
63  const DevicePtr_t& robot,
64  const std::vector <ForceData>& contacts,
65  const CenterOfMassComputationPtr_t& com);
66 
68  const DevicePtr_t& robot,
69  const Contacts_t& contacts,
70  const CenterOfMassComputationPtr_t& com);
71 
73  return phi_;
74  }
75 
76  private:
77  static const Eigen::Matrix <value_type, 6, 1> MinusGravity;
78 
79  qpOASES::real_t* Zeros;
80  const qpOASES::int_t nWSR;
81 
82  void impl_compute (LiegroupElementRef result, ConfigurationIn_t argument)
83  const;
84 
85  void impl_jacobian (matrixOut_t jacobian, ConfigurationIn_t argument) const;
86 
87  qpOASES::returnValue solveQP (vectorOut_t result) const;
88 
89  bool checkQPSol () const;
90  bool checkStrictComplementarity () const;
91 
92  DevicePtr_t robot_;
93  std::size_t nbContacts_;
95 
97  typedef Eigen::Matrix<qpOASES::real_t, Eigen::Dynamic, Eigen::Dynamic,
98  Eigen::RowMajor> RowMajorMatrix_t;
99  typedef Eigen::Map <RowMajorMatrix_t> InvertStorageOrderMap_t;
100  typedef Eigen::Map <Eigen::Matrix <qpOASES::real_t, Eigen::Dynamic, 1>
101  > VectorMap_t;
102  typedef Eigen::Map <const vector_t> ConstVectorMap_t;
103 
104  mutable RowMajorMatrix_t H_;
105  mutable vector_t G_;
106  mutable qpOASES::QProblemB qp_;
107  mutable MoE_t phi_;
108  mutable vector_t primal_, dual_;
109  };
111  } // namespace constraints
112 } // namespace hpp
113 
114 #endif // HPP_CONSTRAINTS_STATIC_STABILITY_HH
pinocchio::vector_t vector_t
Definition: fwd.hh:45
std::vector< Contact_t > Contacts_t
Definition: static-stability.hh:45
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:91
Matrix having Expression elements.
Definition: symbolic-calculus.hh:921
StaticStability::Contacts_t Contacts_t
Definition: qp-static-stability.hh:38
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
Definition: qp-static-stability.hh:33
MatrixOfExpressions & phi()
Definition: qp-static-stability.hh:72
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:88
Definition: differentiable-function.hh:50
static const Eigen::Matrix< value_type, 6, 1 > Gravity
Definition: qp-static-stability.hh:35
boost::shared_ptr< QPStaticStability > QPStaticStabilityPtr_t
Definition: fwd.hh:113
ConvexShapeContact::ForceData ForceData
Definition: qp-static-stability.hh:39
pinocchio::vectorOut_t vectorOut_t
Definition: fwd.hh:47
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:44
StaticStability::Contact_t Contact_t
Definition: qp-static-stability.hh:37
Definition: convex-shape-contact.hh:97
Definition: static-stability.hh:40
pinocchio::CenterOfMassComputationPtr_t CenterOfMassComputationPtr_t
Definition: fwd.hh:93