sot-talos-balance  2.0.5
Collection of dynamic-graph entities aimed at implementing balance control on talos.
simple-admittance-controller.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_admittance_controller_H__
18 #define __sot_talos_balance_admittance_controller_H__
19 
20 /* --------------------------------------------------------------------- */
21 /* --- API ------------------------------------------------------------- */
22 /* --------------------------------------------------------------------- */
23 
24 #if defined(WIN32)
25 #if defined(admittance_controller_EXPORTS)
26 #define SIMPLEADMITTANCECONTROLLER_EXPORT __declspec(dllexport)
27 #else
28 #define SIMPLEADMITTANCECONTROLLER_EXPORT __declspec(dllimport)
29 #endif
30 #else
31 #define SIMPLEADMITTANCECONTROLLER_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 
53  : public ::dynamicgraph::Entity {
54  DYNAMIC_GRAPH_ENTITY_DECL();
55 
56  public:
57  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
58 
59  /* --- CONSTRUCTOR ---- */
60  SimpleAdmittanceController(const std::string& name);
61 
62  void init(const double& dt, const unsigned& n);
63 
64  void setPosition(const dynamicgraph::Vector& position);
65 
66  /* --- SIGNALS --- */
67  DECLARE_SIGNAL_IN(Kp, dynamicgraph::Vector);
68  DECLARE_SIGNAL_IN(state, dynamicgraph::Vector);
69  DECLARE_SIGNAL_IN(tau, dynamicgraph::Vector);
70  DECLARE_SIGNAL_IN(tauDes, dynamicgraph::Vector);
71 
72  DECLARE_SIGNAL_OUT(dqRef, dynamicgraph::Vector);
73  DECLARE_SIGNAL_OUT(qRef, dynamicgraph::Vector);
74 
75  /* --- COMMANDS --- */
76  /* --- ENTITY INHERITANCE --- */
77  virtual void display(std::ostream& os) const;
78 
79  bool m_useState;
80 
81  protected:
82  int m_n;
83  bool
86  dynamicgraph::Vector m_q; // internal state
87  double m_dt;
88 
89 }; // class AdmittanceController
90 
91 } // namespace talos_balance
92 } // namespace sot
93 } // namespace dynamicgraph
94 
95 #endif // #ifndef __sot_talos_balance_admittance_controller_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::SimpleAdmittanceController::m_Kp
dynamicgraph::Vector m_Kp
true if the entity has been successfully initialized
Definition: simple-admittance-controller.hh:85
dynamicgraph::sot::talos_balance::SimpleAdmittanceController::m_dt
double m_dt
Definition: simple-admittance-controller.hh:87
SIMPLEADMITTANCECONTROLLER_EXPORT
#define SIMPLEADMITTANCECONTROLLER_EXPORT
Definition: simple-admittance-controller.hh:31
dynamicgraph::sot::talos_balance::SimpleAdmittanceController::m_initSucceeded
bool m_initSucceeded
Definition: simple-admittance-controller.hh:84
sot_talos_balance.test.test_admittance_single_joint.tau
tau
Definition: test_admittance_single_joint.py:20
sot_talos_balance.test.appli_admittance_single_joint.Kp
list Kp
Definition: appli_admittance_single_joint.py:33
dynamicgraph::sot::talos_balance::SimpleAdmittanceController
Definition: simple-admittance-controller.hh:52
dynamicgraph::sot::talos_balance::math::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: fwd.hh:36
sot_talos_balance.test.appli_admittance_single_joint.dt
dt
Definition: appli_admittance_single_joint.py:17
dynamicgraph::sot::talos_balance::SimpleAdmittanceController::m_useState
bool m_useState
Definition: simple-admittance-controller.hh:79
dynamicgraph::sot::talos_balance::SimpleAdmittanceController::m_q
dynamicgraph::Vector m_q
Definition: simple-admittance-controller.hh:86
dynamicgraph::sot::talos_balance::SimpleAdmittanceController::m_n
int m_n
Definition: simple-admittance-controller.hh:82
sot_talos_balance.test.appli_dcm_zmp_control.name
name
Definition: appli_dcm_zmp_control.py:298