SupportFSM.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  *
4  * Andrei Herdt
5  * Olivier Stasse
6  *
7  * JRL, CNRS/AIST
8  *
9  * This file is part of walkGenJrl.
10  * walkGenJrl is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * walkGenJrl is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Lesser Public License for more details.
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with walkGenJrl. If not, see <http://www.gnu.org/licenses/>.
21  *
22  * Research carried out within the scope of the
23  * Joint Japanese-French Robotics Laboratory (JRL)
24  */
25 
26 #ifndef _SUPPORT_FSM_
27 #define _SUPPORT_FSM_
28 
29 #include <jrl/walkgen/pgtypes.hh>
30 #include <privatepgtypes.hh>
31 
32 namespace PatternGeneratorJRL {
33 
35 class SupportFSM {
36 
37  //
38  // Public methods:
39  //
40 public:
42  SupportFSM();
43 
45  ~SupportFSM();
46 
51  void update_vel_reference(reference_t &Ref,
52  const support_state_t &CurrentSupport);
53 
61  void set_support_state(double time, unsigned int pi, support_state_t &Support,
62  const reference_t &Ref) const;
63 
66  inline double StepPeriod() const { return StepPeriod_; };
67  inline void StepPeriod(const double StepPeriod) { StepPeriod_ = StepPeriod; };
68 
69  inline double DSPeriod() const { return DSPeriod_; };
70  inline void DSPeriod(const double DSPeriod) { DSPeriod_ = DSPeriod; };
71 
72  inline double DSSSPeriod() const { return DSSSPeriod_; };
73  inline void DSSSPeriod(const double DSSSPeriod) { DSSSPeriod_ = DSSSPeriod; };
74 
75  inline unsigned NBStepsSSDS() const { return NbStepsSSDS_; };
76  inline void NbStepsSSDS(const unsigned NbStepsSSDS) {
77  NbStepsSSDS_ = NbStepsSSDS;
78  };
79 
80  inline double SamplingPeriod() const { return T_; };
81  inline void SamplingPeriod(const double T) { T_ = T; };
83 
84  //
85  // Private members:
86  //
87 private:
89  unsigned NbStepsSSDS_;
90 
92  double DSPeriod_;
93 
95  double StepPeriod_;
96 
98  double DSSSPeriod_;
99 
101  double T_;
102 
104  const double EPS_;
105 
109  bool InTranslation_;
110 
112  bool InRotation_;
113 
115  int NbStepsAfterRotation_;
116 
118  foot_type_e CurrentSupportFoot_;
119 
121  bool PostRotationPhase_;
123 };
124 } // namespace PatternGeneratorJRL
125 
126 #endif /* _SUPPORT_FSM_ */
PatternGeneratorJRL::SupportFSM::~SupportFSM
~SupportFSM()
Destructor.
Definition: SupportFSM.cpp:47
PatternGeneratorJRL::SupportFSM
Finite state machine to determine the support parameters.
Definition: SupportFSM.hh:35
PatternGeneratorJRL::SupportFSM::DSPeriod
double DSPeriod() const
Definition: SupportFSM.hh:69
PatternGeneratorJRL::SupportFSM::DSSSPeriod
void DSSSPeriod(const double DSSSPeriod)
Definition: SupportFSM.hh:73
PatternGeneratorJRL::SupportFSM::NbStepsSSDS
void NbStepsSSDS(const unsigned NbStepsSSDS)
Definition: SupportFSM.hh:76
PatternGeneratorJRL::SupportFSM::SamplingPeriod
void SamplingPeriod(const double T)
Definition: SupportFSM.hh:81
PatternGeneratorJRL::SupportFSM::StepPeriod
void StepPeriod(const double StepPeriod)
Definition: SupportFSM.hh:67
PatternGeneratorJRL::SupportFSM::DSPeriod
void DSPeriod(const double DSPeriod)
Definition: SupportFSM.hh:70
pgtypes.hh
PatternGeneratorJRL::SupportFSM::DSSSPeriod
double DSSSPeriod() const
Definition: SupportFSM.hh:72
PatternGeneratorJRL::SupportFSM::set_support_state
void set_support_state(double time, unsigned int pi, support_state_t &Support, const reference_t &Ref) const
Initialize the previewed state.
Definition: SupportFSM.cpp:84
PatternGeneratorJRL::SupportFSM::update_vel_reference
void update_vel_reference(reference_t &Ref, const support_state_t &CurrentSupport)
Update the velocity reference after a pure rotation.
Definition: SupportFSM.cpp:49
PatternGeneratorJRL::SupportFSM::NBStepsSSDS
unsigned NBStepsSSDS() const
Definition: SupportFSM.hh:75
PatternGeneratorJRL::SupportFSM::StepPeriod
double StepPeriod() const
Definition: SupportFSM.hh:66
PatternGeneratorJRL
\doc Simulate a rigid body
Definition: patterngeneratorinterface.hh:41
PatternGeneratorJRL::SupportFSM::SamplingPeriod
double SamplingPeriod() const
Definition: SupportFSM.hh:80
PatternGeneratorJRL::SupportFSM::SupportFSM
SupportFSM()
Constructor.
Definition: SupportFSM.cpp:34