patterngeneratorinterface.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2007, 2008, 2009, 2010,
3  *
4  * Andrei Herdt
5  * Fumio Kanehiro
6  * Francois Keith
7  * Alireza Nakhaei
8  * Olivier Stasse
9  *
10  * JRL, CNRS/AIST
11  *
12  * This file is part of walkGenJrl.
13  * walkGenJrl is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * walkGenJrl is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Lesser Public License for more details.
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
24  *
25  * Research carried out within the scope of the
26  * Joint Japanese-French Robotics Laboratory (JRL)
27  */
34 #ifndef _PATTERN_GENERATOR_INTERFACE_H_
35 #define _PATTERN_GENERATOR_INTERFACE_H_
36 
37 #include <deque>
38 #include <jrl/walkgen/pgtypes.hh>
40 
42 
56 public:
57  // overload the new[] eigen operator
58  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
65 
68 
75  virtual void AddStepInStack(double dx, double dy, double theta) = 0;
76 
99  virtual void CommonInitializationOfWalking(
100  COMState &lStartingCOMState, Eigen::Vector3d &lStartingZMPPosition,
101  Eigen::VectorXd &BodyAnglesIni, FootAbsolutePosition &InitLeftFootAbsPos,
102  FootAbsolutePosition &InitRightFootAbsPos,
103  std::deque<RelativeFootPosition> &lRelativeFootPositions,
104  std::vector<double> &lCurrentJointValues, bool ClearStepStackHandler) = 0;
105 
127  virtual bool RunOneStepOfTheControlLoop(Eigen::VectorXd &CurrentConfiguration,
128  Eigen::VectorXd &CurrentVelocity,
129  Eigen::VectorXd &CurrentAcceleration,
130  Eigen::VectorXd &ZMPTarget) = 0;
131 
151  virtual bool RunOneStepOfTheControlLoop(
152  Eigen::VectorXd &CurrentConfiguration, Eigen::VectorXd &CurrentVelocity,
153  Eigen::VectorXd &CurrentAcceleration, Eigen::VectorXd &ZMPTarget,
154  COMPosition &COMPosition, FootAbsolutePosition &LeftFootPosition,
155  FootAbsolutePosition &RightFootPosition) = 0;
156 
177  virtual bool RunOneStepOfTheControlLoop(
178  Eigen::VectorXd &CurrentConfiguration, Eigen::VectorXd &CurrentVelocity,
179  Eigen::VectorXd &CurrentAcceleration, Eigen::VectorXd &ZMPTarget,
180  COMState &COMState, FootAbsolutePosition &LeftFootPosition,
181  FootAbsolutePosition &RightFootPosition) = 0;
182 
191  virtual bool
192  RunOneStepOfTheControlLoop(FootAbsolutePosition &LeftFootPosition,
193  FootAbsolutePosition &RightFootPosition,
194  ZMPPosition &ZMPRefPos,
195  COMPosition &COMRefPos) = 0;
196 
199  virtual bool RunOneStepOfTheControlLoop(
200  ControlLoopOneStepArgs &aControlLoopOneStepArgs) = 0;
208  virtual void SetCurrentJointValues(Eigen::VectorXd &lCurrentJointValues) = 0;
209 
211  virtual int GetWalkMode() const = 0;
212 
214  virtual void GetLegJointVelocity(Eigen::VectorXd &dqr,
215  Eigen::VectorXd &dql) const = 0;
216 
218  virtual void ReadSequenceOfSteps(std::istringstream &strm) = 0;
219 
224  virtual void StartOnLineStepSequencing() = 0;
225 
227  virtual void StopOnLineStepSequencing() = 0;
228 
230  virtual void AddOnLineStep(double X, double Y, double Theta) = 0;
231 
251  virtual int ChangeOnLineStep(double Time,
252  FootAbsolutePosition &aFootAbsolutePosition,
253  double &newtime) = 0;
254 
260  virtual void ChangeOnLineStep(std::istringstream &strm, double &newtime) = 0;
261 
267  virtual void UpdateAbsolutePosition(bool UpdateAbsMotionOrNot) = 0;
268 
271  virtual void getWaistPositionAndOrientation(double TQ[7],
272  double &Orientation) const = 0;
273 
275  virtual void setWaistPositionAndOrientation(double TQ[7]) = 0;
276 
278  virtual void getWaistVelocity(double &dx, double &dy,
279  double &omega) const = 0;
280 
282  virtual void getWaistPositionMatrix(Eigen::Matrix4d &lWaistAbsPos) const = 0;
283 
287  virtual void setZMPInitialPoint(Eigen::Vector3d &lZMPInitialPoint) = 0;
288 
290  virtual void getZMPInitialPoint(Eigen::Vector3d &lZMPInitialPoint) const = 0;
291 
298  virtual int ParseCmd(std::istringstream &strm) = 0;
299 
305  virtual void
306  EvaluateStartingState(COMState &lStartingCOMState,
307  Eigen::Vector3d &lStartingZMPPosition,
308  Eigen::Matrix<double, 6, 1> &lStartingWaistPose,
309  FootAbsolutePosition &InitLeftFootAbsPos,
310  FootAbsolutePosition &InitRightFootAbsPos) = 0;
311 
321  virtual void setVelocityReference(double x, double y, double yaw) = 0;
326  virtual void setCoMPerturbationForce(double x, double y) = 0;
327 };
328 
330 WALK_GEN_JRL_EXPORT PatternGeneratorInterface *
331 patternGeneratorInterfaceFactory(PinocchioRobot *);
332 } // namespace PatternGeneratorJRL
333 
334 #endif /* _PATTERN_GENERATOR_INTERFACE_H_ */
PatternGeneratorJRL::PatternGeneratorInterface::~PatternGeneratorInterface
virtual ~PatternGeneratorInterface()
Definition: patterngeneratorinterface.hh:67
PatternGeneratorJRL::ZMPPosition_s
Definition: pgtypes.hh:119
x
doublereal * x
Definition: qld.cpp:386
PatternGeneratorJRL::patternGeneratorInterfaceFactory
WALK_GEN_JRL_EXPORT PatternGeneratorInterface * patternGeneratorInterfaceFactory(PinocchioRobot *)
WALK_GEN_JRL_EXPORT
#define WALK_GEN_JRL_EXPORT
Definition: pgtypes.hh:41
pgtypes.hh
PatternGeneratorJRL::PatternGeneratorInterface
Definition: patterngeneratorinterface.hh:55
PatternGeneratorJRL::FootAbsolutePosition_t
Structure to store the absolute foot position.
Definition: pgtypes.hh:139
PatternGeneratorJRL::COMPosition_s
Structure to store the COM position computed by the preview control.
Definition: pgtypes.hh:53
PatternGeneratorJRL::PinocchioRobot
Definition: pinocchiorobot.hh:57
PatternGeneratorJRL::ControlLoopOneStepArgs
Definition: pgtypes.hh:273
pinocchiorobot.hh
PatternGeneratorJRL
\doc Simulate a rigid body
Definition: patterngeneratorinterface.hh:41
PatternGeneratorJRL::COMState_s
Structure to store the COM state computed by the preview control.
Definition: pgtypes.hh:76
PatternGeneratorJRL::PatternGeneratorInterface::PatternGeneratorInterface
EIGEN_MAKE_ALIGNED_OPERATOR_NEW PatternGeneratorInterface(PinocchioRobot *)
Definition: patterngeneratorinterface.hh:64