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 RunOneStepOfTheControlLoop(
192  FootAbsolutePosition &LeftFootPosition,
193  FootAbsolutePosition &RightFootPosition, ZMPPosition &ZMPRefPos,
194  COMPosition &COMRefPos) = 0;
195 
198  virtual bool RunOneStepOfTheControlLoop(
199  ControlLoopOneStepArgs &aControlLoopOneStepArgs) = 0;
207  virtual void SetCurrentJointValues(Eigen::VectorXd &lCurrentJointValues) = 0;
208 
210  virtual int GetWalkMode() const = 0;
211 
213  virtual void GetLegJointVelocity(Eigen::VectorXd &dqr,
214  Eigen::VectorXd &dql) const = 0;
215 
217  virtual void ReadSequenceOfSteps(std::istringstream &strm) = 0;
218 
223  virtual void StartOnLineStepSequencing() = 0;
224 
226  virtual void StopOnLineStepSequencing() = 0;
227 
229  virtual void AddOnLineStep(double X, double Y, double Theta) = 0;
230 
250  virtual int ChangeOnLineStep(double Time,
251  FootAbsolutePosition &aFootAbsolutePosition,
252  double &newtime) = 0;
253 
259  virtual void ChangeOnLineStep(std::istringstream &strm, double &newtime) = 0;
260 
266  virtual void UpdateAbsolutePosition(bool UpdateAbsMotionOrNot) = 0;
267 
270  virtual void getWaistPositionAndOrientation(double TQ[7],
271  double &Orientation) const = 0;
272 
274  virtual void setWaistPositionAndOrientation(double TQ[7]) = 0;
275 
277  virtual void getWaistVelocity(double &dx, double &dy,
278  double &omega) const = 0;
279 
281  virtual void getWaistPositionMatrix(Eigen::Matrix4d &lWaistAbsPos) const = 0;
282 
286  virtual void setZMPInitialPoint(Eigen::Vector3d &lZMPInitialPoint) = 0;
287 
289  virtual void getZMPInitialPoint(Eigen::Vector3d &lZMPInitialPoint) const = 0;
290 
297  virtual int ParseCmd(std::istringstream &strm) = 0;
298 
304  virtual void EvaluateStartingState(
305  COMState &lStartingCOMState, Eigen::Vector3d &lStartingZMPPosition,
306  Eigen::Matrix<double, 6, 1> &lStartingWaistPose,
307  FootAbsolutePosition &InitLeftFootAbsPos,
308  FootAbsolutePosition &InitRightFootAbsPos) = 0;
309 
319  virtual void setVelocityReference(double x, double y, double yaw) = 0;
324  virtual void setCoMPerturbationForce(double x, double y) = 0;
325 };
326 
328 WALK_GEN_JRL_EXPORT PatternGeneratorInterface *patternGeneratorInterfaceFactory(
329  PinocchioRobot *);
330 } // namespace PatternGeneratorJRL
331 
332 #endif /* _PATTERN_GENERATOR_INTERFACE_H_ */
PatternGeneratorJRL::PatternGeneratorInterface::~PatternGeneratorInterface
virtual ~PatternGeneratorInterface()
Definition: patterngeneratorinterface.hh:67
PatternGeneratorJRL::ZMPPosition_s
Definition: pgtypes.hh:118
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:138
PatternGeneratorJRL::COMPosition_s
Structure to store the COM position computed by the preview control.
Definition: pgtypes.hh:52
PatternGeneratorJRL::PinocchioRobot
Definition: pinocchiorobot.hh:60
PatternGeneratorJRL::ControlLoopOneStepArgs
Definition: pgtypes.hh:272
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:75
PatternGeneratorJRL::PatternGeneratorInterface::PatternGeneratorInterface
EIGEN_MAKE_ALIGNED_OPERATOR_NEW PatternGeneratorInterface(PinocchioRobot *)
Definition: patterngeneratorinterface.hh:64