44\section usecase How to use this package
55
66\subsection use_programmatically General introduction
7+
8+ For control purposes the main use of this package is to create new entities and connect them through signals.
9+
710Objects, which are derived from Entities (base class dynamicgraph::Entity), can be
8- declared within the code and compiled to shared libraries (.so/.dll files).
11+ declared within the code and compiled as shared libraries (.so/.dll files).
912These libraries can be loaded at run-time using the PluginLoader methods,
1013and at the same time register their class names to the Factory (see the
1114examples in the <a href="http://projects.laas.fr/gepetto/doc/stack-of-tasks/sot-core/master/doxygen-html">sot-core documentation</a>
1215for advanced control examples).
1316
1417The Factory can then create instances of these objects and subsequently
15- register them in the Pool, where they can be listed, accessed, and acted upon
18+ register them in the Pool. From the pool they can be listed, accessed, and acted upon
1619(see PoolStorage documentation). Basic commands defined by entities include
1720signal connection graph file generation, help and name print, and signals.
1821This is usually done through a scripting language such as python (see
@@ -27,12 +30,82 @@ For an example of a program creating entities in C++, see the unit test
2730test_pool.cpp (in your package source directory/tests).
2831
2932\subsection Tutorial
30- A tutorial is available <a href="http://stack-of-tasks.github.io/dynamic-graph-tutorial/">here</a>
33+ A tutorial is available <a href="http://stack-of-tasks.github.io/dynamic-graph-tutorial/">here</a>.
34+ It is providing a step-by-step way of building an entity
3135
3236\section sec_htw_helpers Helpers
3337
3438When writing entities you might use some macros which are very useful to write your class.
3539They are given also in the <a href="http://projects.laas.fr/gepetto/doc/stack-of-tasks/sot-core/master/doxygen-html">sot-core</a> package as well.
3640
41+ \subsection subsec_howto_typedef Entity helpers
42+
43+ The header <b>entity-helper.h</b> is defining a type called EntityClassName
44+ \section sec_howto_macros_helpers Macro helpers
45+
46+ \subsection subsec_howto_macros_helpers Preprocessing macros for signals
47+
48+ <ul>
49+ <li> Macro for input signals
50+ <ul>
51+ <li> <b>DECLARE_SIGNAL_IN(signal_name,type)</b>:
52+ Declare an input time dependent signal as a field of the class with the following name:
53+ \code
54+ m_signal_nameSIN
55+ \endcode
56+ </li>
57+ <li> <b>CONSTRUCT_SIGNAL_IN(signal_name,type)</b>:
58+ This macro is used in the constructor of the entity class handling this signal.
59+ It is calling the signal constructor and set the signal name to:
60+ \code
61+ EntityClassName(entity-name)::input(type)::signal_name
62+ \endcode
63+ </ul>
64+ </li>
65+ <li> Macro for output signals
66+ <ul>
67+ <li> <b>DECLARE_SIGNAL_OUT(signal_name,type)</b>:
68+ Declare an output time dependent signal as a field of the class with the following name:
69+ \code
70+ m_signal_nameSOUT
71+ \endcode
72+ It also declares a method with the following pattern:
73+ \code
74+ type signal_nameSOUT_function(type &,int)
75+ \endcode
76+ The second pattern is the time when calling the output.
77+ </li>
78+ <li> <b>CONSTRUCT_SIGNAL_OUT(signal_name,type)</b>
79+ This macro is used in the constructor of the entity class handling this signal.
80+ It creates the binding to the method described previously, and set the signal name to:
81+ \code
82+ EntityClassName(entity_name)::output(type)::signal_name
83+ \endcode
84+ where entity_name is the name of the entity currently instanciated.
85+ </li>
86+
87+ <li> <b>DEFINE_SIGNAL_OUT_FUNCTION(signal_name, type)</b>:
88+ This macro is used when implementing the method specific to the output signal.
89+ It is used in the main body of the entity class to declare the header of the method
90+ with the following pattern:
91+ \code
92+ type EntityClassName::signal_nameSOUT_function(type &, int iter)
93+ \endcode
94+ </li>
95+
96+ </ul>
97+ <li>
98+ </li>
99+ <li> <b> DECLARE_SIGNAL_INNER(signal_name,type)</b>
100+ Inner signal are signal that depend on a state of the entity and not on input signals.
101+ This macro declares an inner signal with the following pattern:
102+ \code
103+ m_signal_nameSINNER
104+ \endcode
105+ </li>
106+ <li> <b>DEFINE_SIGNAL_INNER_FUNCTION</b>
107+ This macro
108+ </li>
109+ </ul>
37110
38111*/
0 commit comments