Loading...
Searching...
No Matches
pg.h
Go to the documentation of this file.
1/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 * Copyright Projet JRL-Japan, 2008
3 *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 *
5 * File: sotDynamic.h
6 * Project: SOT
7 * Author: Olivier Stasse
8 *
9 * Version control
10 * ===============
11 *
12 * $Id$
13 *
14 * Description
15 * ============
16 *
17 *
18 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
19
20#ifndef __SOT_PATTERN_GENERATOR_H__
21#define __SOT_PATTERN_GENERATOR_H__
22
23/* --------------------------------------------------------------------- */
24/* --- INCLUDE --------------------------------------------------------- */
25/* --------------------------------------------------------------------- */
26
27/* STD */
28#include <string>
29
30#include <pinocchio/fwd.hpp>
31
32/* SOT */
33
34#include <dynamic-graph/entity.h>
35#include <dynamic-graph/pool.h>
36#include <dynamic-graph/signal-ptr.h>
37#include <dynamic-graph/signal-time-dependent.h>
38#include <pinocchio/fwd.hpp>
40#include <sot/core/flags.hh>
41#include <sot/core/matrix-geometry.hh>
42
43/* Pattern Generator */
44#include <jrl/walkgen/patterngeneratorinterface.hh>
45#include <jrl/walkgen/pinocchiorobot.hh>
46namespace pg = PatternGeneratorJRL;
47
48/* --------------------------------------------------------------------- */
49/* --- API ------------------------------------------------------------- */
50/* --------------------------------------------------------------------- */
51
52#if defined(WIN32)
53#if defined(pg_EXPORTS)
54#define PatternGenerator_EXPORT __declspec(dllexport)
55#else
56#define PatternGenerator_EXPORT __declspec(dllimport)
57#endif
58#else
59#define PatternGenerator_EXPORT
60#endif
61
62namespace dynamicgraph {
63namespace sot {
64
70};
71
72/* --------------------------------------------------------------------- */
73/* --- CLASS ----------------------------------------------------------- */
74/* --------------------------------------------------------------------- */
75
85 public:
86 // overload the new[] eigen operator
87 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
88
95 static const int WORLD_FRAME = 0;
96
99 static const int EGOCENTERED_FRAME = 1;
100
103 static const int LEFT_FOOT_CENTERED_FRAME = 2;
104
107 static const int WAIST_CENTERED_FRAME = 3;
108
112 protected:
113 public:
115
116 protected:
118 pinocchio::Model m_robotModel;
120 pg::PinocchioRobot *m_PR;
122 pinocchio::Data *m_robotData;
124 pg::PatternGeneratorInterface *m_PGI;
125
131
134 std::string m_urdfFile;
135
138 std::string m_srdfFile;
139
142 std::string m_xmlRankFile;
143
144 std::vector<unsigned> m_wrml2urdfIndex;
145
148
151
152 /* \brief Special joints map for the parser */
153 std::map<std::string, std::string> specialJoints_;
154
159 bool m_init;
160
165
168
171
174
177
181
184
186 unsigned int m_count;
187
188 /* \name Body names of the end effectors
189 @{ */
190 /* \brief Left ankle */
192
193 /* \brief Right ankle */
195
196 /* \brief Left wrist */
198
199 /* \brief Right wrist */
201
202 /* @} */
203 public: /* --- CONSTRUCTION --- */
205 PatternGenerator(const std::string &name = "PatternGenerator");
207 virtual ~PatternGenerator(void);
208
209 public: /* --- MODEL CREATION --- */
217 bool buildPGI(void);
218
221
224
226 void readFootParameters(std::string &rootFootPath, pg::PRFoot &aFoot);
227
229 bool InitState(void);
230
233 void setPreviewControlParametersFile(const std::string &filename);
234
236 void setURDFFile(const std::string &filename);
237
242 void setSRDFFile(const std::string &filename);
243
245 void setXmlRankFile(const std::string &filename);
246
249 void setParamPreviewFile(const std::string &filename);
250
252 void setSoleParameters(const double &inSoleLength, const double &inSoleWidth);
253
255 void addJointMapping(const std::string &link, const std::string &repName);
256
259 pg::PatternGeneratorInterface *GetPatternGeneratorInterface() {
260 return m_PGI;
261 };
262
265 public: /* --- SIGNALS --- */
266 typedef int Dummy;
267
273 SignalTimeDependent<Dummy, int> firstSINTERN;
274
276 SignalTimeDependent<Dummy, int> OneStepOfControlS;
277
280 protected:
285 dynamicgraph::Vector &getZMPRef(dynamicgraph::Vector &res, int time);
286
288 dynamicgraph::Vector &getCoMRef(dynamicgraph::Vector &res, int time);
289
291 dynamicgraph::Vector &getdCoMRef(dynamicgraph::Vector &res, int time);
292
294 dynamicgraph::Vector &getddCoMRef(dynamicgraph::Vector &res, int time);
295
297 dynamicgraph::Vector &getExternalForces(dynamicgraph::Vector &forces,
298 int time);
299
301 MatrixHomogeneous &getLeftFootRef(MatrixHomogeneous &res, int time);
302
304 MatrixHomogeneous &getRightFootRef(MatrixHomogeneous &res, int time);
305
307 MatrixHomogeneous &getdotLeftFootRef(MatrixHomogeneous &res, int time);
308
310 MatrixHomogeneous &getdotRightFootRef(MatrixHomogeneous &res, int time);
311
313 MatrixHomogeneous &getFlyingFootRef(MatrixHomogeneous &res, int time);
314
316 dynamicgraph::Vector &getjointWalkingErrorPosition(dynamicgraph::Vector &res,
317 int time);
318
320 dynamicgraph::Vector &getdComAttitude(dynamicgraph::Vector &res, int time);
321
324 dynamicgraph::Vector &getddComAttitude(dynamicgraph::Vector &res, int time);
325
327 dynamicgraph::Vector &getComAttitude(dynamicgraph::Vector &res, int time);
328
330 VectorRollPitchYaw &getWaistAttitude(VectorRollPitchYaw &res, int time);
331
333 VectorRollPitchYaw &getWaistAttitudeAbsolute(VectorRollPitchYaw &res,
334 int time);
335
338 MatrixHomogeneous &getWaistAttitudeMatrixAbsolute(MatrixHomogeneous &res,
339 int time);
340
342 unsigned &getDataInProcess(unsigned &res, int time);
343
345 dynamicgraph::Vector &getWaistPosition(dynamicgraph::Vector &res, int time);
346
348 dynamicgraph::Vector &getWaistPositionAbsolute(dynamicgraph::Vector &res,
349 int time);
350
354 int &getSupportFoot(int &res, int time);
355
357 int &InitOneStepOfControl(int &dummy, int time);
359 int &OneStepOfControl(int &dummy, int time);
360
367 MatrixHomogeneous m_k_Waist_kp1;
368
370 MatrixHomogeneous m_LeftFootPosition, m_RightFootPosition;
371 PatternGeneratorJRL::FootAbsolutePosition m_PrevSamplingRightFootAbsPos,
373 PatternGeneratorJRL::FootAbsolutePosition m_NextSamplingRightFootAbsPos,
375 PatternGeneratorJRL::FootAbsolutePosition m_InitRightFootAbsPos,
377
379 MatrixHomogeneous m_dotLeftFootPosition, m_dotRightFootPosition;
380
383 MatrixHomogeneous m_InitLeftFootPosition, m_InitRightFootPosition;
384
387
389 MatrixHomogeneous m_FlyingFootPosition;
390
392 dynamicgraph::Vector m_ZMPRefPos;
393
397 dynamicgraph::Vector m_ComAttitude;
398
401 dynamicgraph::Vector m_dComAttitude;
402
405 dynamicgraph::Vector m_ddComAttitude;
406
408 dynamicgraph::Vector m_COMRefPos;
409 dynamicgraph::Vector m_PrevSamplingCOMRefPos;
410 dynamicgraph::Vector m_NextSamplingCOMRefPos;
411
413 dynamicgraph::Vector m_dCOMRefPos;
414 dynamicgraph::Vector m_PrevSamplingdCOMRefPos;
415 dynamicgraph::Vector m_NextSamplingdCOMRefPos;
416
418 dynamicgraph::Vector m_ddCOMRefPos;
419 dynamicgraph::Vector m_PrevSamplingddCOMRefPos;
420 dynamicgraph::Vector m_NextSamplingddCOMRefPos;
421
423 dynamicgraph::Vector m_InitZMPRefPos;
424
427 dynamicgraph::Vector m_InitWaistRefPos, m_InitWaistRefAtt;
428
430 dynamicgraph::Vector m_InitCOMRefPos;
431
433 dynamicgraph::Vector m_WaistPosition;
434
436 dynamicgraph::Vector m_WaistPositionAbsolute;
437
439 dynamicgraph::Vector m_WaistAttitude;
440
442 dynamicgraph::Vector m_WaistAttitudeAbsolute;
443 dynamicgraph::Vector m_PrevSamplingWaistAttAbs;
444 dynamicgraph::Vector m_NextSamplingWaistAttAbs;
445
448
450 dynamicgraph::Vector m_JointErrorValuesForWalking;
451
453 dynamicgraph::Vector m_VelocityReference;
454
457
461 unsigned int m_dataInProcess;
462
466
470
472 bool m_rightFootContact, m_leftFootContact;
473
480 void ParseCmdFile(std::istringstream &cmdArg, std::ostream &os);
481
485 pg::FootAbsolutePosition aFootPosition, MatrixHomogeneous &aFootMH,
486 MatrixHomogeneous &adotFootMH);
487
490 void FromAbsoluteFootPosToHomogeneous(pg::FootAbsolutePosition aFootPosition,
491 MatrixHomogeneous &aFootMH);
492
495 void getAbsoluteWaistPosAttHomogeneousMatrix(MatrixHomogeneous &aWaistMH);
496
497 void SubsamplingFootPos(pg::FootAbsolutePosition &PrevFootPosition,
498 pg::FootAbsolutePosition &NextFootPosition,
499 MatrixHomogeneous &FootPositionOut,
500 MatrixHomogeneous &dotFootPositionOut,
501 unsigned int &count);
502
503 void SubsamplingVector(dynamicgraph::Vector &PrevPosition,
504 dynamicgraph::Vector &NextPosition,
505 dynamicgraph::Vector &PositionOut,
506 unsigned int &count);
507
508 void CopyFootPosition(pg::FootAbsolutePosition &FootPositionIn,
509 pg::FootAbsolutePosition &FootPositionOut);
510
513 dynamicgraph::Vector &getInitZMPRef(dynamicgraph::Vector &res, int time);
514
517 dynamicgraph::Vector &getInitCoMRef(dynamicgraph::Vector &res, int time);
518
521 dynamicgraph::Vector &getInitWaistPosRef(dynamicgraph::Vector &res, int time);
522
525 VectorRollPitchYaw &getInitWaistAttRef(VectorRollPitchYaw &res, int time);
526
528 MatrixHomogeneous &getInitLeftFootRef(MatrixHomogeneous &res, int time);
529
531 MatrixHomogeneous &getInitRightFootRef(MatrixHomogeneous &res, int time);
532
535 bool &getLeftFootContact(bool &res, int time);
536 bool &getRightFootContact(bool &res, int time);
538 int &getContactPhase(int &res, int time);
539
540 public:
544 SignalPtr<dynamicgraph::Vector, int> jointPositionSIN;
545
547 SignalPtr<dynamicgraph::Vector, int> motorControlJointPositionSIN;
548
550 SignalPtr<dynamicgraph::Vector, int> ZMPPreviousControllerSIN;
551
553 SignalTimeDependent<dynamicgraph::Vector, int> ZMPRefSOUT;
554
556 SignalTimeDependent<dynamicgraph::Vector, int> CoMRefSOUT;
557
559 SignalTimeDependent<dynamicgraph::Vector, int> dCoMRefSOUT;
560
561 SignalTimeDependent<dynamicgraph::Vector, int> ddCoMRefSOUT;
563 SignalPtr<dynamicgraph::Vector, int> comSIN;
564
566 SignalPtr<dynamicgraph::Vector, int> comStateSIN;
567
569 SignalPtr<dynamicgraph::Vector, int> zmpSIN;
570
573 SignalPtr<dynamicgraph::Vector, int> forceSIN;
574 SignalTimeDependent<dynamicgraph::Vector, int> forceSOUT;
575 dynamicgraph::Vector m_initForce;
576 dynamicgraph::Vector m_currentForces;
577 std::deque<dynamicgraph::Vector> m_bufferForce;
578 std::vector<double> m_filterWindow;
579
581 SignalPtr<dynamicgraph::Vector, int> velocitydesSIN;
582
584 SignalPtr<bool, int> triggerSIN;
585
587 SignalPtr<MatrixHomogeneous, int> LeftFootCurrentPosSIN;
588
590 SignalPtr<MatrixHomogeneous, int> RightFootCurrentPosSIN;
591
593 SignalTimeDependent<MatrixHomogeneous, int> LeftFootRefSOUT;
594
596 SignalTimeDependent<MatrixHomogeneous, int> RightFootRefSOUT;
597
599 SignalTimeDependent<MatrixHomogeneous, int> dotLeftFootRefSOUT;
600
602 SignalTimeDependent<MatrixHomogeneous, int> dotRightFootRefSOUT;
603
606 SignalTimeDependent<MatrixHomogeneous, int> FlyingFootRefSOUT;
607
609 SignalTimeDependent<int, int> SupportFootSOUT;
610
612 SignalTimeDependent<dynamicgraph::Vector, int> jointWalkingErrorPositionSOUT;
613
615 SignalTimeDependent<dynamicgraph::Vector, int> comattitudeSOUT;
616
618 SignalTimeDependent<dynamicgraph::Vector, int> dcomattitudeSOUT;
619
621 SignalTimeDependent<dynamicgraph::Vector, int> ddcomattitudeSOUT;
622
624 SignalTimeDependent<VectorRollPitchYaw, int> waistattitudeSOUT;
625
627 SignalTimeDependent<VectorRollPitchYaw, int> waistattitudeabsoluteSOUT;
628
631 SignalTimeDependent<MatrixHomogeneous, int> waistattitudematrixabsoluteSOUT;
632
634 SignalTimeDependent<dynamicgraph::Vector, int> waistpositionSOUT;
635
637 SignalTimeDependent<dynamicgraph::Vector, int> waistpositionabsoluteSOUT;
638
640 SignalTimeDependent<unsigned int, int> dataInProcessSOUT;
641
643 SignalTimeDependent<dynamicgraph::Vector, int> InitZMPRefSOUT;
644
646 SignalTimeDependent<dynamicgraph::Vector, int> InitCoMRefSOUT;
647
649 SignalTimeDependent<dynamicgraph::Vector, int> InitWaistPosRefSOUT;
650
652 SignalTimeDependent<VectorRollPitchYaw, int> InitWaistAttRefSOUT;
653
655 SignalTimeDependent<MatrixHomogeneous, int> InitLeftFootRefSOUT;
656
658 SignalTimeDependent<MatrixHomogeneous, int> InitRightFootRefSOUT;
659
661 SignalTimeDependent<bool, int> leftFootContactSOUT;
662 SignalTimeDependent<bool, int> rightFootContactSOUT;
666 SignalTimeDependent<int, int> contactPhaseSOUT;
667
672 protected:
674 Eigen::VectorXd m_ZMPPrevious;
675
676 public: /* --- PARAMS --- */
677 void initCommands(void);
678 int stringToReferenceEnum(const std::string &FrameReference);
679 void setReferenceFromString(const std::string &str);
680 void addOnLineStep(const double &x, const double &y, const double &th);
681 void addStep(const double &x, const double &y, const double &th);
682 void pgCommandLine(const std::string &cmdline);
683 void useFeedBackSignals(const bool &feedBack);
684 void useDynamicFilter(const bool &dynamicFilter);
685
686 void debug(void);
687};
688
689} // namespace sot
690} // namespace dynamicgraph
691
692#endif // #ifndef __SOT_PATTERN_GENERATOR_H__
This class provides dynamically stable CoM, ZMP, feet trajectories. It wraps up the algorithms implem...
Definition: pg.h:84
SignalTimeDependent< dynamicgraph::Vector, int > CoMRefSOUT
Externalize the CoM reference.
Definition: pg.h:556
std::vector< double > m_filterWindow
Definition: pg.h:578
SignalTimeDependent< MatrixHomogeneous, int > InitRightFootRefSOUT
Externalize the right foot position reference.
Definition: pg.h:658
dynamicgraph::Vector m_WaistAttitude
Waist Attitude.
Definition: pg.h:439
dynamicgraph::Vector & getdCoMRef(dynamicgraph::Vector &res, int time)
Internal method to get the reference dCoM at a given time.
unsigned int m_dataInProcess
true iff the pattern if dealing with data, false if pg is not working anymore/yet.
Definition: pg.h:461
void FromAbsoluteFootPosToDotHomogeneous(pg::FootAbsolutePosition aFootPosition, MatrixHomogeneous &aFootMH, MatrixHomogeneous &adotFootMH)
Transfert from a current absolute foot position to a dot homogeneous matrix.
dynamicgraph::Vector & getInitZMPRef(dynamicgraph::Vector &res, int time)
Internal method to get the initial reference ZMP at a given time.
unsigned int m_count
count for subsampling.
Definition: pg.h:186
void setParamPreviewFile(const std::string &filename)
Set the name of the file specifying the control parameters of the preview control.
SignalTimeDependent< dynamicgraph::Vector, int > ZMPRefSOUT
Externalize the ZMP reference .
Definition: pg.h:553
SignalTimeDependent< MatrixHomogeneous, int > waistattitudematrixabsoluteSOUT
Externalize the absolute waist attitude into a homogeneous matrix.
Definition: pg.h:631
dynamicgraph::Vector m_initForce
Definition: pg.h:575
dynamicgraph::Vector & getdComAttitude(dynamicgraph::Vector &res, int time)
Internal method to get the derivative of the com attitude.
dynamicgraph::Vector m_NextSamplingddCOMRefPos
Definition: pg.h:420
MatrixHomogeneous & getRightFootRef(MatrixHomogeneous &res, int time)
Internal method to get the position of the right foot.
dynamicgraph::Vector & getjointWalkingErrorPosition(dynamicgraph::Vector &res, int time)
Internal method to get the joint position for walking.
dynamicgraph::Vector & getWaistPosition(dynamicgraph::Vector &res, int time)
Internal method to get the position of the waist.
SignalTimeDependent< VectorRollPitchYaw, int > waistattitudeabsoluteSOUT
Externalize the absolute waist attitude.
Definition: pg.h:627
std::deque< dynamicgraph::Vector > m_bufferForce
Definition: pg.h:577
void ParseCmdFile(std::istringstream &cmdArg, std::ostream &os)
dynamicgraph::Vector m_PrevSamplingddCOMRefPos
Definition: pg.h:419
bool m_feedBackControl
Booleans used to indicate if feedback signals shoul be used or not.
Definition: pg.h:465
SignalPtr< dynamicgraph::Vector, int > forceSIN
Take the current external force applied to the com (fx, fy, fz).
Definition: pg.h:573
std::string m_PreviewControlParametersFile
Some information related to the preview control.
Definition: pg.h:130
MatrixHomogeneous m_FlyingFootPosition
Relative Position of the flying foot.
Definition: pg.h:389
SignalTimeDependent< MatrixHomogeneous, int > RightFootRefSOUT
Externalize the right foot position reference.
Definition: pg.h:596
SignalTimeDependent< VectorRollPitchYaw, int > waistattitudeSOUT
Externalize the waist attitude.
Definition: pg.h:624
void pgCommandLine(const std::string &cmdline)
dynamicgraph::Vector m_WaistAttitudeAbsolute
Waist Attitude Absolute.
Definition: pg.h:442
void SubsamplingFootPos(pg::FootAbsolutePosition &PrevFootPosition, pg::FootAbsolutePosition &NextFootPosition, MatrixHomogeneous &FootPositionOut, MatrixHomogeneous &dotFootPositionOut, unsigned int &count)
SignalTimeDependent< MatrixHomogeneous, int > LeftFootRefSOUT
Externalize the left foot position reference.
Definition: pg.h:593
dynamicgraph::Vector m_WaistPosition
Waist position.
Definition: pg.h:433
void setSRDFFile(const std::string &filename)
Set the path which contains the SRDF files robot's model. More precisely this file describes which jo...
PatternGeneratorJRL::FootAbsolutePosition m_InitLeftFootAbsPos
Definition: pg.h:376
dynamicgraph::Vector m_PrevSamplingWaistAttAbs
Definition: pg.h:443
SignalTimeDependent< dynamicgraph::Vector, int > InitCoMRefSOUT
Externalize the initial CoM reference.
Definition: pg.h:646
dynamicgraph::Vector m_InitWaistRefAtt
Definition: pg.h:427
dynamicgraph::Vector & getExternalForces(dynamicgraph::Vector &forces, int time)
Internal method to get the external forces at a given time.
bool m_leftFootContact
Definition: pg.h:472
dynamicgraph::Vector m_ddCOMRefPos
Absolute position of the reference ddCoM.
Definition: pg.h:418
void addOnLineStep(const double &x, const double &y, const double &th)
VectorRollPitchYaw & getWaistAttitudeAbsolute(VectorRollPitchYaw &res, int time)
Internal method to get the absolute attitude of the waist.
PatternGeneratorJRL::FootAbsolutePosition m_NextSamplingLeftFootAbsPos
Definition: pg.h:374
int m_DSStartingTime
Definition: pg.h:180
void SubsamplingVector(dynamicgraph::Vector &PrevPosition, dynamicgraph::Vector &NextPosition, dynamicgraph::Vector &PositionOut, unsigned int &count)
SignalTimeDependent< MatrixHomogeneous, int > FlyingFootRefSOUT
Externalize the foot which is not considered as support foot, the information are given in a relative...
Definition: pg.h:606
double m_AnkleSoilDistance
Distance between ankle and soil.
Definition: pg.h:173
pg::PinocchioRobot * m_PR
Pointer towards the robot model inside jrl-walkgen.
Definition: pg.h:120
bool m_init
Boolean variable to initialize the object by loading an object.
Definition: pg.h:159
bool & getLeftFootContact(bool &res, int time)
Internal method to get the information of contact or not on the feet.
pinocchio::Data * m_robotData
The pointor toward the robot data.
Definition: pg.h:122
int stringToReferenceEnum(const std::string &FrameReference)
SignalPtr< dynamicgraph::Vector, int > zmpSIN
Take the current zmp (x, y, z).
Definition: pg.h:569
std::string m_srdfFile
Directory+Name where the SRDF file of the robot's model is located.
Definition: pg.h:138
void useFeedBackSignals(const bool &feedBack)
int m_ReferenceFrame
Keep the frame reference.
Definition: pg.h:170
double m_TimeStep
Time step.
Definition: pg.h:176
SignalTimeDependent< dynamicgraph::Vector, int > comattitudeSOUT
Externalize the com attitude.
Definition: pg.h:615
bool addComplementaryFrames()
Add complementary frame.
bool buildPGI(void)
Build the pattern generator interface from the parameter "/robot_description" and the informations in...
std::string m_right_ankle_body_name
Definition: pg.h:194
dynamicgraph::Vector & getComAttitude(dynamicgraph::Vector &res, int time)
Internal method to get the attitude of the com.
bool & getRightFootContact(bool &res, int time)
dynamicgraph::Vector & getInitWaistPosRef(dynamicgraph::Vector &res, int time)
Internal method to get the initial reference CoM at a given time.
MatrixHomogeneous & getdotLeftFootRef(MatrixHomogeneous &res, int time)
Internal method to get the derivative of the left foot.
pg::PatternGeneratorInterface * m_PGI
Pointer towards the interface of the pattern generator.
Definition: pg.h:124
int & getContactPhase(int &res, int time)
Internal method to get the information of contact phase leftFoot=1, rightFoot=-1, doubleSupport=0.
dynamicgraph::Vector m_WaistPositionAbsolute
Waist position Absolute.
Definition: pg.h:436
SignalTimeDependent< dynamicgraph::Vector, int > dcomattitudeSOUT
Externalize the dcom attitude.
Definition: pg.h:618
void setReferenceFromString(const std::string &str)
dynamicgraph::Vector m_JointErrorValuesForWalking
Joint values for walking.
Definition: pg.h:450
int m_SupportFoot
Integer for the support foot.
Definition: pg.h:167
SignalTimeDependent< unsigned int, int > dataInProcessSOUT
true iff PG is processing. Use it for synchronize.
Definition: pg.h:640
dynamicgraph::Vector & getZMPRef(dynamicgraph::Vector &res, int time)
Internal method to get the reference ZMP at a given time.
SignalPtr< dynamicgraph::Vector, int > comStateSIN
Take the current CoM state (pos, vel, acc).
Definition: pg.h:566
pinocchio::Model m_robotModel
The model of the robot.
Definition: pg.h:118
Eigen::VectorXd m_ZMPPrevious
Definition: pg.h:674
MatrixHomogeneous & getWaistAttitudeMatrixAbsolute(MatrixHomogeneous &res, int time)
Internal method to get the absolute attitude of the waist into an homogeneous matrix.
dynamicgraph::Vector m_NextSamplingWaistAttAbs
Definition: pg.h:444
SignalTimeDependent< Dummy, int > firstSINTERN
Internal signal for initialization and one shot signals.
Definition: pg.h:273
MatrixHomogeneous & getInitRightFootRef(MatrixHomogeneous &res, int time)
Internal method to get the position of the right foot.
dynamicgraph::Vector & getInitCoMRef(dynamicgraph::Vector &res, int time)
Internal method to get the initial reference CoM at a given time.
dynamicgraph::Vector & getddComAttitude(dynamicgraph::Vector &res, int time)
Internal method to get the second derivative of the com attitude.
PatternGeneratorJRL::FootAbsolutePosition m_PrevSamplingRightFootAbsPos
Definition: pg.h:371
int Dummy
Definition: pg.h:266
dynamicgraph::Vector m_PrevSamplingCOMRefPos
Definition: pg.h:409
void setSoleParameters(const double &inSoleLength, const double &inSoleWidth)
Set the foot parameters.
unsigned & getDataInProcess(unsigned &res, int time)
Internal method to get the dataInPorcess flag.
void addJointMapping(const std::string &link, const std::string &repName)
Set mapping between a link and actual robot name.
SignalPtr< MatrixHomogeneous, int > LeftFootCurrentPosSIN
Take the current left foot homogeneous position.
Definition: pg.h:587
bool m_InitPositionByRealState
Boolean variable to initialize the position: first through the real state of the robot,...
Definition: pg.h:164
std::string m_urdfFile
Directory+Name where the URDF file of the robot's model is located.
Definition: pg.h:134
dynamicgraph::Vector m_ddComAttitude
ddCom Attitude: does not really exist apart when the robot is seen as an inverted pendulum
Definition: pg.h:405
dynamicgraph::Vector m_dCOMRefPos
Absolute position of the reference dCoM.
Definition: pg.h:413
SignalTimeDependent< dynamicgraph::Vector, int > waistpositionabsoluteSOUT
Externalize the absolute waist position.
Definition: pg.h:637
pg::PatternGeneratorInterface * GetPatternGeneratorInterface()
Give access directly to the pattern generator... You really have to know what your are doing.
Definition: pg.h:259
SignalTimeDependent< dynamicgraph::Vector, int > InitZMPRefSOUT
Externalize the initial ZMP reference .
Definition: pg.h:643
std::vector< unsigned > m_wrml2urdfIndex
Definition: pg.h:144
MatrixHomogeneous m_dotLeftFootPosition
Absolute Derivate for the left and right feet.
Definition: pg.h:379
MatrixHomogeneous m_WaistAttitudeMatrixAbsolute
Waist Attitude Homogeneous Matrix.
Definition: pg.h:447
dynamicgraph::Vector m_dComAttitude
dCom Attitude: does not really exist apart when the robot is seen as an inverted pendulum
Definition: pg.h:401
SignalTimeDependent< dynamicgraph::Vector, int > ddcomattitudeSOUT
Externalize the ddcom attitude.
Definition: pg.h:621
double m_soleLength
Lenght of the sole.
Definition: pg.h:147
SignalTimeDependent< int, int > contactPhaseSOUT
Int Vector of support phase: leftFoot=1, rightFoot=-1, doubleSupport=0 (see enum).
Definition: pg.h:666
bool m_forceFeedBack
Booleans used to indicate if force feedback signals shoul be used or not.
Definition: pg.h:469
std::string m_left_ankle_body_name
Definition: pg.h:191
SignalTimeDependent< dynamicgraph::Vector, int > InitWaistPosRefSOUT
Externalize the initial Waist reference.
Definition: pg.h:649
int m_LocalTime
iteration time.
Definition: pg.h:183
void setURDFFile(const std::string &filename)
Set the path which contains the URDF files robot's model.
int & OneStepOfControl(int &dummy, int time)
Trigger one step of the algorithm.
SignalTimeDependent< dynamicgraph::Vector, int > ddCoMRefSOUT
Definition: pg.h:561
dynamicgraph::Vector & getCoMRef(dynamicgraph::Vector &res, int time)
Internal method to get the reference CoM at a given time.
SignalPtr< dynamicgraph::Vector, int > motorControlJointPositionSIN
Motor control joint position values.
Definition: pg.h:547
MatrixHomogeneous & getdotRightFootRef(MatrixHomogeneous &res, int time)
Internal method to get the derivative of the right foot.
dynamicgraph::Vector m_ZMPRefPos
Absolute position of the reference ZMP.
Definition: pg.h:392
SignalTimeDependent< dynamicgraph::Vector, int > dCoMRefSOUT
Externalize the CoM reference.
Definition: pg.h:559
MatrixHomogeneous m_InitLeftFootPosition
Initial Absolute Starting Position for the left and right feet.
Definition: pg.h:383
SignalTimeDependent< VectorRollPitchYaw, int > InitWaistAttRefSOUT
Externalize the initial Waist reference.
Definition: pg.h:652
SignalPtr< MatrixHomogeneous, int > RightFootCurrentPosSIN
Take the current right foot homogeneous position.
Definition: pg.h:590
dynamicgraph::Vector m_InitZMPRefPos
Initial Absolute position of the reference ZMP.
Definition: pg.h:423
PatternGeneratorJRL::FootAbsolutePosition m_NextSamplingRightFootAbsPos
Definition: pg.h:373
SignalTimeDependent< bool, int > rightFootContactSOUT
Definition: pg.h:662
virtual ~PatternGenerator(void)
Default destructor.
std::string m_right_wrist_body_name
Definition: pg.h:200
void getAbsoluteWaistPosAttHomogeneousMatrix(MatrixHomogeneous &aWaistMH)
Provide an homogeneous matrix from the current waist position and attitude.
SignalPtr< dynamicgraph::Vector, int > ZMPPreviousControllerSIN
Previous ZMP value (ZMP send by the preceding controller).
Definition: pg.h:550
SignalTimeDependent< MatrixHomogeneous, int > InitLeftFootRefSOUT
Externalize the left foot position reference.
Definition: pg.h:655
SignalTimeDependent< int, int > SupportFootSOUT
Externalize the support foot.
Definition: pg.h:609
dynamicgraph::Vector m_InitCOMRefPos
Initial Absolute position of the reference CoM.
Definition: pg.h:430
bool m_trigger
trigger to start walking
Definition: pg.h:456
dynamicgraph::Vector m_ComAttitude
Com Attitude: does not really exist apart from when the robot is seen as an inverted pendulum.
Definition: pg.h:397
MatrixHomogeneous m_k_Waist_kp1
Rigit motion between two waist positions at the beginning of the walking and at the end of the walkin...
Definition: pg.h:367
PatternGenerator(const std::string &name="PatternGenerator")
Default constructor.
MatrixHomogeneous & getFlyingFootRef(MatrixHomogeneous &res, int time)
Internal method to get the position of the flying foot.
SignalTimeDependent< bool, int > leftFootContactSOUT
Booleans for contact of the feet.
Definition: pg.h:661
std::string m_xmlRankFile
Directory+Name where the Rank of the joints are notified.
Definition: pg.h:142
dynamicgraph::Vector m_PrevSamplingdCOMRefPos
Definition: pg.h:414
SignalPtr< dynamicgraph::Vector, int > comSIN
Take the current CoM.
Definition: pg.h:563
SignalTimeDependent< MatrixHomogeneous, int > dotRightFootRefSOUT
Externalize the right foot position reference.
Definition: pg.h:602
VectorRollPitchYaw & getInitWaistAttRef(VectorRollPitchYaw &res, int time)
Internal method to get the initial reference CoM at a given time.
SignalTimeDependent< dynamicgraph::Vector, int > waistpositionSOUT
Externalize the waist position.
Definition: pg.h:634
dynamicgraph::Vector & getddCoMRef(dynamicgraph::Vector &res, int time)
Internal method to get the reference ddCoM at a given time.
SignalTimeDependent< dynamicgraph::Vector, int > jointWalkingErrorPositionSOUT
Externalize the joint values for walking.
Definition: pg.h:612
std::string m_left_wrist_body_name
Definition: pg.h:197
void useDynamicFilter(const bool &dynamicFilter)
int & getSupportFoot(int &res, int time)
Getting the current support foot: 1 Left -1 Right.
dynamicgraph::Vector m_COMRefPos
Absolute position of the reference CoM.
Definition: pg.h:408
bool InitState(void)
Initialize the state of the robot.
dynamicgraph::Vector m_NextSamplingCOMRefPos
Definition: pg.h:410
SignalPtr< dynamicgraph::Vector, int > jointPositionSIN
Real state position values.
Definition: pg.h:544
MatrixHomogeneous & getLeftFootRef(MatrixHomogeneous &res, int time)
Internal method to get the position of the left foot.
dynamicgraph::Vector m_VelocityReference
Velocity reference for Herdt's PG.
Definition: pg.h:453
dynamicgraph::Vector & getWaistPositionAbsolute(dynamicgraph::Vector &res, int time)
Internal method to get the absolute position of the waist.
MatrixHomogeneous m_MotionSinceInstanciationToThisSequence
Keep track of the motion between sequence of motions.
Definition: pg.h:386
bool buildReducedModel(void)
Build the reduced model.
MatrixHomogeneous & getInitLeftFootRef(MatrixHomogeneous &res, int time)
Internal method to get the position of the left foot.
void addStep(const double &x, const double &y, const double &th)
void setXmlRankFile(const std::string &filename)
Set the path which contains the Joint Rank model.
VectorRollPitchYaw & getWaistAttitude(VectorRollPitchYaw &res, int time)
Internal method to get the attitude of the waist.
void setPreviewControlParametersFile(const std::string &filename)
Set the directory which contains the parameters for the preview control.
PatternGeneratorJRL::FootAbsolutePosition m_PrevSamplingLeftFootAbsPos
Definition: pg.h:372
void CopyFootPosition(pg::FootAbsolutePosition &FootPositionIn, pg::FootAbsolutePosition &FootPositionOut)
SupportPhase m_ContactPhase
Current support/contact phase defined by enum: leftFoot=1, rightFoot=-1, doubleSupport=0.
Definition: pg.h:179
PatternGeneratorJRL::FootAbsolutePosition m_InitRightFootAbsPos
Definition: pg.h:375
void FromAbsoluteFootPosToHomogeneous(pg::FootAbsolutePosition aFootPosition, MatrixHomogeneous &aFootMH)
Transfert from a current absolute foot position to a homogeneous matrix.
SignalPtr< bool, int > triggerSIN
Take the current trigger to start OneStepOfControl.
Definition: pg.h:584
SignalPtr< dynamicgraph::Vector, int > velocitydesSIN
Take the current desired velocity.
Definition: pg.h:581
int & InitOneStepOfControl(int &dummy, int time)
Trigger the initialization of the algorithm.
SignalTimeDependent< dynamicgraph::Vector, int > forceSOUT
Definition: pg.h:574
std::map< std::string, std::string > specialJoints_
Definition: pg.h:153
SignalTimeDependent< Dummy, int > OneStepOfControlS
Internal signal to trigger one step of the algorithm.
Definition: pg.h:276
MatrixHomogeneous m_LeftFootPosition
Absolute Position for the left and right feet.
Definition: pg.h:370
void readFootParameters(std::string &rootFootPath, pg::PRFoot &aFoot)
readFootParameters
dynamicgraph::Vector m_NextSamplingdCOMRefPos
Definition: pg.h:415
SignalTimeDependent< MatrixHomogeneous, int > dotLeftFootRefSOUT
Externalize the left foot position reference.
Definition: pg.h:599
dynamicgraph::Vector m_currentForces
Definition: pg.h:576
double m_soleWidth
Width of the sole.
Definition: pg.h:150
SupportPhase
Define the support phase of the robot.
Definition: pg.h:66
@ LEFT_SUPPORT_PHASE
Definition: pg.h:68
@ DOUBLE_SUPPORT_PHASE
Definition: pg.h:67
@ RIGHT_SUPPORT_PHASE
Definition: pg.h:69
Definition: exception-pg.h:47
#define PatternGenerator_EXPORT
Definition: pg.h:59