sot-talos-balance  1.7.0
int-identity.cpp
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 
18 
19 #include <sot/core/debug.hh>
20 #include <dynamic-graph/factory.h>
21 #include <dynamic-graph/all-commands.h>
22 
23 namespace dynamicgraph
24 {
25  namespace sot
26  {
27  namespace talos_balance
28  {
29  namespace dg = ::dynamicgraph;
30  using namespace dg;
31  using namespace dg::command;
32 
33 #define INPUT_SIGNALS m_sinSIN
34 
35 #define OUTPUT_SIGNALS m_soutSOUT
36 
39  typedef IntIdentity EntityClassName;
40 
41  /* --- DG FACTORY ---------------------------------------------------- */
43  "IntIdentity");
44 
45  /* ------------------------------------------------------------------- */
46  /* --- CONSTRUCTION -------------------------------------------------- */
47  /* ------------------------------------------------------------------- */
48  IntIdentity::IntIdentity(const std::string& name)
49  : Entity(name)
50  , CONSTRUCT_SIGNAL_IN(sin, int)
51  , CONSTRUCT_SIGNAL_OUT(sout, int, INPUT_SIGNALS)
52  {
53  Entity::signalRegistration( INPUT_SIGNALS << OUTPUT_SIGNALS );
54 
55  /* Commands. */
56  addCommand("init", makeCommandVoid0(*this, &IntIdentity::init, docCommandVoid0("Initialize the entity.")));
57  }
58 
59  /* ------------------------------------------------------------------- */
60  /* --- SIGNALS ------------------------------------------------------- */
61  /* ------------------------------------------------------------------- */
62 
64  {
65  s = m_sinSIN(iter);
66  return s;
67  }
68 
69  /* ------------------------------------------------------------------- */
70  /* --- ENTITY -------------------------------------------------------- */
71  /* ------------------------------------------------------------------- */
72 
73  void IntIdentity::display(std::ostream& os) const
74  {
75  os << "IntIdentity " << getName();
76 // try
77 // {
78 // getProfiler().report_all(3, os);
79 // }
80 // catch (ExceptionSignal e) {}
81  }
82 
83  } // namespace talos_balance
84  } // namespace sot
85 } // namespace dynamicgraph
86 
#define OUTPUT_SIGNALS
virtual void display(std::ostream &os) const
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(AdmittanceControllerEndEffector, "AdmittanceControllerEndEffector")
EIGEN_MAKE_ALIGNED_OPERATOR_NEW IntIdentity(const std::string &name)
#define INPUT_SIGNALS