relative-feet-inequalities.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  *
4  * Mehdi Benallegue
5  * Andrei Herdt
6  * Olivier Stasse
7  *
8  *
9  * JRL, CNRS/AIST
10  *
11  * This file is part of walkGenJrl.
12  * walkGenJrl is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * walkGenJrl is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Lesser Public License for more details.
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
23  *
24  * Research carried out within the scope of the
25  * Joint Japanese-French Robotics Laboratory (JRL)
26  */
27 /* This object generate matrix representation of linear
28  constraint based on foot position.
29  It handles a stack of constraint on a sliding mode
30  for QP solving. */
31 
32 #ifndef _RELATIVE_FEET_INEQUALITIES_
33 #define _RELATIVE_FEET_INEQUALITIES_
34 
38 #include <SimplePlugin.hh>
39 #include <jrl/walkgen/pgtypes.hh>
41 #include <privatepgtypes.hh>
42 
43 namespace PatternGeneratorJRL {
44 
47 class RelativeFeetInequalities : public SimplePlugin {
48  //
49  // Public types
50  //
51  public:
52  //
53  // Public member functions
54  //
55  public:
58  RelativeFeetInequalities(SimplePluginManager *aSPM, PinocchioRobot *aPR);
61 
67  void set_vertices(convex_hull_t &ConvexHull,
68  const support_state_t &SupportState, ineq_e type);
69 
75  void set_inequalities(convex_hull_t &ConvexHull,
76  const support_state_t &Support, ineq_e type);
77 
84  void compute_linear_system(convex_hull_t &ConvexHull,
85  const support_state_t &PrwSupport) const;
86 
91  virtual void CallMethod(std::string &Method, std::istringstream &Args);
92 
97  void getFeetSize(FootHalfSize &leftFootSize, FootHalfSize &rightFootSize);
98 
99  inline double DSFeetDistance() { return DSFeetDistance_; }
100 
101  //
102  // Private member functions
103  //
104  private:
108  int init_convex_hulls();
109 
114  int set_feet_dimensions(PinocchioRobot *aPR);
115 
119  int init_feet_constraints();
120 
121  //
122  // Private members
123  //
124  private:
125  struct edges_s {
126  convex_hull_t LeftSS, RightSS, RightDS, LeftDS;
127  };
128  struct edges_s FootPosEdges_, ZMPPosEdges_;
129 
131  convex_hull_t CoMHull_;
132 
133  double LeftFPosEdgesX_[5], LeftFPosEdgesY_[5];
134  double RightFPosEdgesX_[5], RightFPosEdgesY_[5];
135 
137  FootHalfSize LeftFootSize_, RightFootSize_;
138 
140  double SecurityMarginX_;
141  double SecurityMarginY_;
142 
144  double DSFeetDistance_;
145 };
146 } // namespace PatternGeneratorJRL
147 #endif /* _RELATIVE_FEET_INEQUALITIES_ */
PatternGeneratorJRL::RelativeFeetInequalities::getFeetSize
void getFeetSize(FootHalfSize &leftFootSize, FootHalfSize &rightFootSize)
Reimplement the interface of SimplePluginManager.
Definition: relative-feet-inequalities.cpp:334
PatternGeneratorJRL::RelativeFeetInequalities::set_inequalities
void set_inequalities(convex_hull_t &ConvexHull, const support_state_t &Support, ineq_e type)
Adapt inequalities to the support foot and its orientation.
Definition: relative-feet-inequalities.cpp:214
PatternGeneratorJRL::RelativeFeetInequalities::set_vertices
void set_vertices(convex_hull_t &ConvexHull, const support_state_t &SupportState, ineq_e type)
Adapt vertices to the support foot and its orientation.
Definition: relative-feet-inequalities.cpp:177
SupportFSM.hh
pgtypes.hh
PatternGeneratorJRL::RelativeFeetInequalities
Generate a stack of inequalities relative to feet centers for the whole preview window.
Definition: relative-feet-inequalities.hh:47
PatternGeneratorJRL::RelativeFeetInequalities::CallMethod
virtual void CallMethod(std::string &Method, std::istringstream &Args)
Reimplement the interface of SimplePluginManager.
Definition: relative-feet-inequalities.cpp:290
PatternGeneratorJRL::RelativeFeetInequalities::~RelativeFeetInequalities
~RelativeFeetInequalities()
Definition: relative-feet-inequalities.cpp:74
PatternGeneratorJRL::FootHalfSize
Definition: FootHalfSize.hh:33
PatternGeneratorJRL::PinocchioRobot
Definition: pinocchiorobot.hh:60
PatternGeneratorJRL::RelativeFeetInequalities::RelativeFeetInequalities
RelativeFeetInequalities(SimplePluginManager *aSPM, PinocchioRobot *aPR)
Definition: relative-feet-inequalities.cpp:41
PatternGeneratorJRL::RelativeFeetInequalities::DSFeetDistance
double DSFeetDistance()
Definition: relative-feet-inequalities.hh:99
pinocchiorobot.hh
PatternGeneratorJRL
\doc Simulate a rigid body
Definition: patterngeneratorinterface.hh:41
ConvexHull.hh
PatternGeneratorJRL::RelativeFeetInequalities::compute_linear_system
void compute_linear_system(convex_hull_t &ConvexHull, const support_state_t &PrwSupport) const
Compute the linear inequalities associated with the convex hull specified by a vector of points.
Definition: relative-feet-inequalities.cpp:235
FootHalfSize.hh