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 
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 
152  Eigen::VectorXd &CurrentConfiguration, Eigen::VectorXd &CurrentVelocity,
153  Eigen::VectorXd &CurrentAcceleration, Eigen::VectorXd &ZMPTarget,
154  COMPosition &COMPosition, FootAbsolutePosition &LeftFootPosition,
155  FootAbsolutePosition &RightFootPosition) = 0;
156 
178  Eigen::VectorXd &CurrentConfiguration, Eigen::VectorXd &CurrentVelocity,
179  Eigen::VectorXd &CurrentAcceleration, Eigen::VectorXd &ZMPTarget,
180  COMState &COMState, FootAbsolutePosition &LeftFootPosition,
181  FootAbsolutePosition &RightFootPosition) = 0;
182 
192  FootAbsolutePosition &LeftFootPosition,
193  FootAbsolutePosition &RightFootPosition, ZMPPosition &ZMPRefPos,
194  COMPosition &COMRefPos) = 0;
195 
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 
329  PinocchioRobot *);
330 } // namespace PatternGeneratorJRL
331 
332 #endif /* _PATTERN_GENERATOR_INTERFACE_H_ */
Definition: patterngeneratorinterface.hh:55
virtual int ParseCmd(std::istringstream &strm)=0
Parse a command (to be used out of a plugin) and call all objects which registered the method.
virtual void getWaistVelocity(double &dx, double &dy, double &omega) const =0
Get Waist velocity.
virtual void StartOnLineStepSequencing()=0
Start the creation of steps on line.
virtual void ReadSequenceOfSteps(std::istringstream &strm)=0
Read a sequence of steps.
virtual void getZMPInitialPoint(Eigen::Vector3d &lZMPInitialPoint) const =0
Get the initial ZMP reference point.
virtual void setVelocityReference(double x, double y, double yaw)=0
Set velocity reference This method is only supported by Herdt's algorithm. Currently only a 3D speed ...
virtual int GetWalkMode() const =0
Returns the walking mode.
virtual void getWaistPositionMatrix(Eigen::Matrix4d &lWaistAbsPos) const =0
An other method to get the waist position using a matrix.
virtual bool RunOneStepOfTheControlLoop(Eigen::VectorXd &CurrentConfiguration, Eigen::VectorXd &CurrentVelocity, Eigen::VectorXd &CurrentAcceleration, Eigen::VectorXd &ZMPTarget)=0
Run One Step of the global control loop aka The Main Method To Be Used.
virtual void EvaluateStartingState(COMState &lStartingCOMState, Eigen::Vector3d &lStartingZMPPosition, Eigen::Matrix< double, 6, 1 > &lStartingWaistPose, FootAbsolutePosition &InitLeftFootAbsPos, FootAbsolutePosition &InitRightFootAbsPos)=0
Returns the ZMP, CoM, left foot absolute position, and right foot absolute position for the initiale ...
virtual void setZMPInitialPoint(Eigen::Vector3d &lZMPInitialPoint)=0
Set the initial ZMP reference point.
virtual void setCoMPerturbationForce(double x, double y)=0
Set velocity reference.
virtual void setWaistPositionAndOrientation(double TQ[7])=0
Set Waist position and Orientation
virtual bool RunOneStepOfTheControlLoop(ControlLoopOneStepArgs &aControlLoopOneStepArgs)=0
Rune One Step of the global control loop.
virtual void SetCurrentJointValues(Eigen::VectorXd &lCurrentJointValues)=0
virtual void StopOnLineStepSequencing()=0
Stop the creation of steps on line.
virtual void getWaistPositionAndOrientation(double TQ[7], double &Orientation) const =0
Get the waist position and orientation as a quaternion, and the planar X-Y orientation in Orientation...
virtual bool RunOneStepOfTheControlLoop(FootAbsolutePosition &LeftFootPosition, FootAbsolutePosition &RightFootPosition, ZMPPosition &ZMPRefPos, COMPosition &COMRefPos)=0
Run One Step of the global control loop aka The Main Method To Be Used.
virtual void GetLegJointVelocity(Eigen::VectorXd &dqr, Eigen::VectorXd &dql) const =0
Get the leg joint velocity.
virtual bool RunOneStepOfTheControlLoop(Eigen::VectorXd &CurrentConfiguration, Eigen::VectorXd &CurrentVelocity, Eigen::VectorXd &CurrentAcceleration, Eigen::VectorXd &ZMPTarget, COMState &COMState, FootAbsolutePosition &LeftFootPosition, FootAbsolutePosition &RightFootPosition)=0
Run One Step of the global control loop aka The Main Method To Be Used.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW PatternGeneratorInterface(PinocchioRobot *)
Definition: patterngeneratorinterface.hh:64
virtual ~PatternGeneratorInterface()
Definition: patterngeneratorinterface.hh:67
virtual void ChangeOnLineStep(std::istringstream &strm, double &newtime)=0
Change online step. See the above method for the specifications. This method uses a different format ...
virtual void AddOnLineStep(double X, double Y, double Theta)=0
Add an online step.
virtual bool RunOneStepOfTheControlLoop(Eigen::VectorXd &CurrentConfiguration, Eigen::VectorXd &CurrentVelocity, Eigen::VectorXd &CurrentAcceleration, Eigen::VectorXd &ZMPTarget, COMPosition &COMPosition, FootAbsolutePosition &LeftFootPosition, FootAbsolutePosition &RightFootPosition)=0
Run One Step of the global control loop aka The Main Method To Be Used.
virtual void CommonInitializationOfWalking(COMState &lStartingCOMState, Eigen::Vector3d &lStartingZMPPosition, Eigen::VectorXd &BodyAnglesIni, FootAbsolutePosition &InitLeftFootAbsPos, FootAbsolutePosition &InitRightFootAbsPos, std::deque< RelativeFootPosition > &lRelativeFootPositions, std::vector< double > &lCurrentJointValues, bool ClearStepStackHandler)=0
virtual int ChangeOnLineStep(double Time, FootAbsolutePosition &aFootAbsolutePosition, double &newtime)=0
Change online step. The strategy is the following: the step in single support phase at time t has its...
virtual void UpdateAbsolutePosition(bool UpdateAbsMotionOrNot)=0
Update the current waist absolute position.
virtual void AddStepInStack(double dx, double dy, double theta)=0
Function to specify steps in the stack of the walking pattern generator. This method is different Add...
Definition: pinocchiorobot.hh:60
\doc Simulate a rigid body
Definition: patterngeneratorinterface.hh:41
WALK_GEN_JRL_EXPORT PatternGeneratorInterface * patternGeneratorInterfaceFactory(PinocchioRobot *)
#define WALK_GEN_JRL_EXPORT
Definition: pgtypes.hh:41
doublereal * x
Definition: qld.cpp:386
Structure to store the COM position computed by the preview control.
Definition: pgtypes.hh:52
Structure to store the COM state computed by the preview control.
Definition: pgtypes.hh:75
Structure to store the absolute foot position.
Definition: pgtypes.hh:138
Definition: pgtypes.hh:118