Loading...
Searching...
No Matches
LinearizedInvertedPendulum2D.hh
Go to the documentation of this file.
1/*
2 * Copyright 2009, 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/* \doc This object simulate a 2D Linearized Inverted Pendulum
27 with a control at the jerk level. */
28
29#ifndef _LINEAR_INVERTED_PENDULUM_2D_H_
30#define _LINEAR_INVERTED_PENDULUM_2D_H_
31
33#include <deque>
34
38#include <privatepgtypes.hh>
39
40namespace PatternGeneratorJRL {
42 public:
45
48
54 int InitializeSystem();
55
68 int Interpolation(std::deque<COMState> &COMStates,
69 std::deque<ZMPPosition> &ZMPRefPositions,
70 int CurrentPosition, double CX, double CY);
71
77 com_t OneIteration(double CX, double CY);
78
79 private:
84 double m_T;
85
87 double m_ComHeight;
88
90 int m_InterpolationInterval;
91
93 double m_SamplingPeriod;
94
96 /* ! Matrices for the dynamical system.
97 @{
98 */
99 /* ! Matrix regarding the state of the CoM (pos, velocity, acceleration) */
100 Eigen::MatrixXd m_A;
101 /* ! Vector for the command */
102 Eigen::MatrixXd m_B;
103 /* ! Vector for the ZMP. */
104 Eigen::MatrixXd m_C;
105
108 Eigen::VectorXd m_xk;
109
110 com_t m_CoM;
111
112 /* ! \brief Vector of ZMP */
113 Eigen::VectorXd m_zk;
114
115 /* ! @} */
116
117 public:
122 const double &GetComHeight() const;
123
125 void SetComHeight(const double &);
126
128 const double &GetSimulationControlPeriod() const;
129
131 void SetSimulationControlPeriod(const double &);
132
134 const double &GetRobotControlPeriod();
135
137 void SetRobotControlPeriod(const double &);
138
140 inline const com_t operator()() const { return m_CoM; };
141
143 inline void operator()(com_t CoM) { m_CoM = CoM; };
144
146 void GetState(Eigen::VectorXd &lxk);
148
149 inline com_t getState() { return m_CoM; }
150
152 void setState(com_t aCoM);
153 void setState(COMState &aCoM);
155};
156} // namespace PatternGeneratorJRL
157#endif /* _LINEAR_INVERTED_PENDULUM_2D_H_ */
Definition: LinearizedInvertedPendulum2D.hh:41
void operator()(com_t CoM)
Accessor.
Definition: LinearizedInvertedPendulum2D.hh:143
void SetSimulationControlPeriod(const double &)
Definition: LinearizedInvertedPendulum2D.cpp:70
com_t OneIteration(double CX, double CY)
Simulate one iteration of the LIPM.
Definition: LinearizedInvertedPendulum2D.cpp:233
const double & GetSimulationControlPeriod() const
Definition: LinearizedInvertedPendulum2D.cpp:66
const com_t operator()() const
Accessor.
Definition: LinearizedInvertedPendulum2D.hh:140
void setState(com_t aCoM)
Definition: LinearizedInvertedPendulum2D.cpp:129
void SetRobotControlPeriod(const double &)
Definition: LinearizedInvertedPendulum2D.cpp:83
~LinearizedInvertedPendulum2D()
Definition: LinearizedInvertedPendulum2D.cpp:56
const double & GetRobotControlPeriod()
Definition: LinearizedInvertedPendulum2D.cpp:79
const double & GetComHeight() const
Definition: LinearizedInvertedPendulum2D.cpp:58
int InitializeSystem()
Initialize the system.
Definition: LinearizedInvertedPendulum2D.cpp:131
void SetComHeight(const double &)
Definition: LinearizedInvertedPendulum2D.cpp:62
com_t getState()
Definition: LinearizedInvertedPendulum2D.hh:149
LinearizedInvertedPendulum2D()
Definition: LinearizedInvertedPendulum2D.cpp:39
COMState GetState()
Definition: LinearizedInvertedPendulum2D.cpp:115
int Interpolation(std::deque< COMState > &COMStates, std::deque< ZMPPosition > &ZMPRefPositions, int CurrentPosition, double CX, double CY)
Interpolation during a simulation period with control parameters.
Definition: LinearizedInvertedPendulum2D.cpp:163
\doc Simulate a rigid body
Definition: patterngeneratorinterface.hh:41
Structure to store the COM state computed by the preview control.
Definition: pgtypes.hh:75