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  // Public methods:
38  //
39  public:
41  SupportFSM();
42 
44  ~SupportFSM();
45 
50  void update_vel_reference(reference_t &Ref,
51  const support_state_t &CurrentSupport);
52 
60  void set_support_state(double time, unsigned int pi, support_state_t &Support,
61  const reference_t &Ref) const;
62 
65  inline double StepPeriod() const { return StepPeriod_; };
66  inline void StepPeriod(const double StepPeriod) { StepPeriod_ = StepPeriod; };
67 
68  inline double DSPeriod() const { return DSPeriod_; };
69  inline void DSPeriod(const double DSPeriod) { DSPeriod_ = DSPeriod; };
70 
71  inline double DSSSPeriod() const { return DSSSPeriod_; };
72  inline void DSSSPeriod(const double DSSSPeriod) { DSSSPeriod_ = DSSSPeriod; };
73 
74  inline unsigned NBStepsSSDS() const { return NbStepsSSDS_; };
75  inline void NbStepsSSDS(const unsigned NbStepsSSDS) {
76  NbStepsSSDS_ = NbStepsSSDS;
77  };
78 
79  inline double SamplingPeriod() const { return T_; };
80  inline void SamplingPeriod(const double T) { T_ = T; };
82 
83  //
84  // Private members:
85  //
86  private:
88  unsigned NbStepsSSDS_;
89 
91  double DSPeriod_;
92 
94  double StepPeriod_;
95 
97  double DSSSPeriod_;
98 
100  double T_;
101 
103  const double EPS_;
104 
108  bool InTranslation_;
109 
111  bool InRotation_;
112 
114  int NbStepsAfterRotation_;
115 
117  foot_type_e CurrentSupportFoot_;
118 
120  bool PostRotationPhase_;
122 };
123 } // namespace PatternGeneratorJRL
124 
125 #endif /* _SUPPORT_FSM_ */
PatternGeneratorJRL::SupportFSM::~SupportFSM
~SupportFSM()
Destructor.
Definition: SupportFSM.cpp:49
PatternGeneratorJRL::SupportFSM
Finite state machine to determine the support parameters.
Definition: SupportFSM.hh:35
PatternGeneratorJRL::SupportFSM::DSPeriod
double DSPeriod() const
Definition: SupportFSM.hh:68
PatternGeneratorJRL::SupportFSM::DSSSPeriod
void DSSSPeriod(const double DSSSPeriod)
Definition: SupportFSM.hh:72
PatternGeneratorJRL::SupportFSM::NbStepsSSDS
void NbStepsSSDS(const unsigned NbStepsSSDS)
Definition: SupportFSM.hh:75
PatternGeneratorJRL::SupportFSM::SamplingPeriod
void SamplingPeriod(const double T)
Definition: SupportFSM.hh:80
PatternGeneratorJRL::SupportFSM::StepPeriod
void StepPeriod(const double StepPeriod)
Definition: SupportFSM.hh:66
PatternGeneratorJRL::SupportFSM::DSPeriod
void DSPeriod(const double DSPeriod)
Definition: SupportFSM.hh:69
pgtypes.hh
PatternGeneratorJRL::SupportFSM::DSSSPeriod
double DSSSPeriod() const
Definition: SupportFSM.hh:71
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:86
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:51
PatternGeneratorJRL::SupportFSM::NBStepsSSDS
unsigned NBStepsSSDS() const
Definition: SupportFSM.hh:74
PatternGeneratorJRL::SupportFSM::StepPeriod
double StepPeriod() const
Definition: SupportFSM.hh:65
PatternGeneratorJRL
\doc Simulate a rigid body
Definition: patterngeneratorinterface.hh:41
PatternGeneratorJRL::SupportFSM::SamplingPeriod
double SamplingPeriod() const
Definition: SupportFSM.hh:79
PatternGeneratorJRL::SupportFSM::SupportFSM
SupportFSM()
Constructor.
Definition: SupportFSM.cpp:33