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 
36 
40 #include <SimplePlugin.hh>
41 #include <jrl/walkgen/pgtypes.hh>
42 #include <privatepgtypes.hh>
43 
44 namespace PatternGeneratorJRL {
45 
48 class RelativeFeetInequalities : public SimplePlugin {
49 
50  //
51  // Public types
52  //
53 public:
54  //
55  // Public member functions
56  //
57 public:
60  RelativeFeetInequalities(SimplePluginManager *aSPM, PinocchioRobot *aPR);
63 
69  void set_vertices(convex_hull_t &ConvexHull,
70  const support_state_t &SupportState, ineq_e type);
71 
77  void set_inequalities(convex_hull_t &ConvexHull,
78  const support_state_t &Support, ineq_e type);
79 
86  void compute_linear_system(convex_hull_t &ConvexHull,
87  const support_state_t &PrwSupport) const;
88 
93  virtual void CallMethod(std::string &Method, std::istringstream &Args);
94 
99  void getFeetSize(FootHalfSize &leftFootSize, FootHalfSize &rightFootSize);
100 
101  inline double DSFeetDistance() { return DSFeetDistance_; }
102 
103  //
104  // Private member functions
105  //
106 private:
110  int init_convex_hulls();
111 
116  int set_feet_dimensions(PinocchioRobot *aPR);
117 
121  int init_feet_constraints();
122 
123  //
124  // Private members
125  //
126 private:
127  struct edges_s {
128  convex_hull_t LeftSS, RightSS, RightDS, LeftDS;
129  };
130  struct edges_s FootPosEdges_, ZMPPosEdges_;
131 
133  convex_hull_t CoMHull_;
134 
135  double LeftFPosEdgesX_[5], LeftFPosEdgesY_[5];
136  double RightFPosEdgesX_[5], RightFPosEdgesY_[5];
137 
139  FootHalfSize LeftFootSize_, RightFootSize_;
140 
142  double SecurityMarginX_;
143  double SecurityMarginY_;
144 
146  double DSFeetDistance_;
147 };
148 } // namespace PatternGeneratorJRL
149 #endif /* _RELATIVE_FEET_INEQUALITIES_ */
PatternGeneratorJRL::RelativeFeetInequalities::getFeetSize
void getFeetSize(FootHalfSize &leftFootSize, FootHalfSize &rightFootSize)
Reimplement the interface of SimplePluginManager.
Definition: relative-feet-inequalities.cpp:341
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:219
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:181
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:48
PatternGeneratorJRL::RelativeFeetInequalities::CallMethod
virtual void CallMethod(std::string &Method, std::istringstream &Args)
Reimplement the interface of SimplePluginManager.
Definition: relative-feet-inequalities.cpp:296
PatternGeneratorJRL::RelativeFeetInequalities::~RelativeFeetInequalities
~RelativeFeetInequalities()
Definition: relative-feet-inequalities.cpp:76
PatternGeneratorJRL::FootHalfSize
Definition: FootHalfSize.hh:33
PatternGeneratorJRL::PinocchioRobot
Definition: pinocchiorobot.hh:57
PatternGeneratorJRL::RelativeFeetInequalities::RelativeFeetInequalities
RelativeFeetInequalities(SimplePluginManager *aSPM, PinocchioRobot *aPR)
Definition: relative-feet-inequalities.cpp:42
PatternGeneratorJRL::RelativeFeetInequalities::DSFeetDistance
double DSFeetDistance()
Definition: relative-feet-inequalities.hh:101
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:241
FootHalfSize.hh