sot-talos-balance  2.0.5
Collection of dynamic-graph entities aimed at implementing balance control on talos.
simple-pid.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2018, Gepetto team, LAAS-CNRS
3  *
4  * This file is part of sot-talos-balance.
5  * sot-talos-balance is free software: you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation, either version 3 of
8  * the License, or (at your option) any later version.
9  * sot-talos-balance is distributed in the hope that it will be
10  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details. You should
13  * have received a copy of the GNU Lesser General Public License along
14  * with sot-talos-balance. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef __sot_talos_balance_simple_pid_H__
18 #define __sot_talos_balance_simple_pid_H__
19 
20 /* --------------------------------------------------------------------- */
21 /* --- API ------------------------------------------------------------- */
22 /* --------------------------------------------------------------------- */
23 
24 #if defined(WIN32)
25 #if defined(simple_pid_EXPORTS)
26 #define SIMPLE_PID_EXPORT __declspec(dllexport)
27 #else
28 #define SIMPLE_PID_EXPORT __declspec(dllimport)
29 #endif
30 #else
31 #define SIMPLE_PID_EXPORT
32 #endif
33 
34 /* --------------------------------------------------------------------- */
35 /* --- INCLUDE --------------------------------------------------------- */
36 /* --------------------------------------------------------------------- */
37 
38 #include <dynamic-graph/signal-helper.h>
39 
40 #include <map>
41 
42 #include "boost/assign.hpp"
43 
44 namespace dynamicgraph {
45 namespace sot {
46 namespace talos_balance {
47 
48 /* --------------------------------------------------------------------- */
49 /* --- CLASS ----------------------------------------------------------- */
50 /* --------------------------------------------------------------------- */
51 
52 class SIMPLE_PID_EXPORT SimplePID : public ::dynamicgraph::Entity {
53  DYNAMIC_GRAPH_ENTITY_DECL();
54 
55  public:
56  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
57 
58  /* --- CONSTRUCTOR ---- */
59  SimplePID(const std::string& name);
60 
61  void init(const double& dt, const int& N);
62 
63  void resetIntegralError();
64 
65  /* --- SIGNALS --- */
66  DECLARE_SIGNAL_IN(Kp, dynamicgraph::Vector);
67  DECLARE_SIGNAL_IN(Ki, dynamicgraph::Vector);
68 
69  DECLARE_SIGNAL_IN(decayFactor, double);
70 
71  DECLARE_SIGNAL_IN(x, dynamicgraph::Vector);
72  DECLARE_SIGNAL_IN(x_des, dynamicgraph::Vector);
73 
74  DECLARE_SIGNAL_IN(dx_des, dynamicgraph::Vector);
75 
76  DECLARE_SIGNAL_OUT(dx_ref, dynamicgraph::Vector);
77 
78  /* --- COMMANDS --- */
79  /* --- ENTITY INHERITANCE --- */
80  virtual void display(std::ostream& os) const;
81 
82  protected:
83  bool
86  double m_dt;
87 
88 }; // class SimplePID
89 
90 } // namespace talos_balance
91 } // namespace sot
92 } // namespace dynamicgraph
93 
94 #endif // #ifndef __sot_talos_balance_simple_pid_H__
sot_talos_balance.test.appli_admittance_end_effector.sot
sot
Definition: appli_admittance_end_effector.py:117
dynamicgraph
Definition: treeview.dox:24
dynamicgraph::sot::talos_balance::SimplePID
Definition: simple-pid.hh:52
sot_talos_balance.test.script_test_end_effector.x
x
Definition: script_test_end_effector.py:10
sot_talos_balance.test.appli_admittance_single_joint.Kp
list Kp
Definition: appli_admittance_single_joint.py:33
dynamicgraph::sot::talos_balance::math::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hh:36
dynamicgraph::sot::talos_balance::SimplePID::m_dt
double m_dt
Definition: simple-pid.hh:86
sot_talos_balance.test.appli_admittance_single_joint.dt
dt
Definition: appli_admittance_single_joint.py:17
dynamicgraph::sot::talos_balance::SimplePID::m_integralError
dynamicgraph::Vector m_integralError
true if the entity has been successfully initialized
Definition: simple-pid.hh:85
SIMPLE_PID_EXPORT
#define SIMPLE_PID_EXPORT
Definition: simple-pid.hh:31
dynamicgraph::sot::talos_balance::SimplePID::m_initSucceeded
bool m_initSucceeded
Definition: simple-pid.hh:84
sot_talos_balance.test.appli_dcm_zmp_control.name
name
Definition: appli_dcm_zmp_control.py:298