hpp-constraints  4.9.1
Definition of basic geometric constraints for motion planning
static-stability.hh
Go to the documentation of this file.
1 // Copyright (c) 2014, 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_STATIC_STABILITY_HH
18 # define HPP_CONSTRAINTS_STATIC_STABILITY_HH
19 
20 # include <vector>
21 
22 # include <hpp/constraints/fwd.hh>
23 # include <hpp/constraints/config.hh>
24 # include <hpp/constraints/deprecated.hh>
25 
28 
29 namespace hpp {
30  namespace constraints {
31 
34  class HPP_CONSTRAINTS_DLLAPI StaticStability :
35  public DifferentiableFunction {
36  public:
37  static const value_type G;
38  static const Eigen::Matrix <value_type, 6, 1> Gravity;
39 
40  struct Contact_t {
41  JointPtr_t joint1, joint2;
42  vector3_t point1, point2;
43  vector3_t normal1, normal2;
44  };
45  typedef std::vector <Contact_t> Contacts_t;
46 
50  StaticStability (const std::string& name, const DevicePtr_t& robot,
51  const Contacts_t& contacts,
52  const CenterOfMassComputationPtr_t& com);
53 
55  const std::string& name,
56  const DevicePtr_t& robot,
57  const Contacts_t& contacts,
58  const CenterOfMassComputationPtr_t& com);
59 
61  const DevicePtr_t& robot,
62  const Contacts_t& contacts,
63  const CenterOfMassComputationPtr_t& com);
64 
66  return phi_;
67  }
68 
69  private:
70  void impl_compute (LiegroupElementRef result,
71  ConfigurationIn_t argument) const;
72 
73  void impl_jacobian (matrixOut_t jacobian, ConfigurationIn_t argument) const;
74 
75  static void findBoundIndex (vectorIn_t u, vectorIn_t v,
76  value_type& lambdaMin, size_type* iMin,
77  value_type& lambdaMax, size_type* iMax);
78 
80  bool computeUminusAndV (vectorIn_t u, vectorOut_t uMinus,
81  vectorOut_t v) const;
82 
83  void computeVDot (const ConfigurationIn_t arg, vectorIn_t uMinus, vectorIn_t S,
84  matrixIn_t uDot, matrixOut_t uMinusDot, matrixOut_t vDot) const;
85 
86  void computeLambdaDot (vectorIn_t u, vectorIn_t v, const std::size_t i0,
87  matrixIn_t uDot, matrixIn_t vDot, vectorOut_t lambdaDot) const;
88 
89  DevicePtr_t robot_;
90  Contacts_t contacts_;
92 
94 
95  mutable MoE_t phi_;
96  mutable vector_t u_, uMinus_, v_;
97  mutable matrix_t uDot_, uMinusDot_, vDot_;
98  mutable vector_t lambdaDot_;
99  };
101  } // namespace constraints
102 } // namespace hpp
103 
104 #endif // HPP_CONSTRAINTS_STATIC_STABILITY_HH
Definition: static-stability.hh:34
pinocchio::vector_t vector_t
Definition: fwd.hh:45
pinocchio::vectorIn_t vectorIn_t
Definition: fwd.hh:46
vector3_t point2
Definition: static-stability.hh:42
std::vector< Contact_t > Contacts_t
Definition: static-stability.hh:45
MatrixOfExpressions & phi()
Definition: static-stability.hh:65
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:91
Matrix having Expression elements.
Definition: symbolic-calculus.hh:921
Eigen::Ref< const matrix_t > matrixIn_t
Definition: fwd.hh:43
ObjectFactory * create(ObjectFactory *parent=NULL, const XMLElement *element=NULL)
pinocchio::matrix_t matrix_t
Definition: fwd.hh:42
pinocchio::vector3_t vector3_t
Definition: fwd.hh:39
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:88
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:37
Definition: differentiable-function.hh:50
vector3_t normal2
Definition: static-stability.hh:43
pinocchio::vectorOut_t vectorOut_t
Definition: fwd.hh:47
boost::shared_ptr< StaticStability > StaticStabilityPtr_t
Definition: fwd.hh:112
pinocchio::size_type size_type
Definition: fwd.hh:35
Eigen::Ref< matrix_t > matrixOut_t
Definition: fwd.hh:44
JointPtr_t joint2
Definition: static-stability.hh:41
static const Eigen::Matrix< value_type, 6, 1 > Gravity
Definition: static-stability.hh:38
static const value_type G
Definition: static-stability.hh:37
pinocchio::value_type value_type
Definition: fwd.hh:36
Definition: static-stability.hh:40
pinocchio::CenterOfMassComputationPtr_t CenterOfMassComputationPtr_t
Definition: fwd.hh:93