Commit df48199d authored by Olivier Stasse's avatar Olivier Stasse
Browse files

[clang-format] Comply to Google style.

parent 48e05f15
Pipeline #6419 failed with stage
in 3 minutes and 48 seconds
---
ColumnLimit: 80
...
/** /**
\page debug Debugging \page debug Debugging
They are several ways to perform debugging in dynamic-graph depending on your needs or situation: They are several ways to perform debugging in dynamic-graph depending on your
- Programmatically inside the entity in C++ will write inside a buffer in a different thread and output in a stream needs or situation:
(either std::cout or a file). It is detailed in \subpage subp_debug_rt_logger. - Programmatically inside the entity in C++ will write inside a buffer in a
- Programmatically inside the entity in C++ using a member of the entities and the previous real-time mechanism. different thread and output in a stream (either std::cout or a file). It is
It provides 4 levels of messags :(DEBUG,INFO, WARNING, ERROR). It is described in details here: detailed in \subpage subp_debug_rt_logger.
\subpage subp_logger - Programmatically inside the entity in C++ using a member of the entities and
- Programmatically in C++ to avoid overhead with macros and handling level as an int: \subpage subp_dbg_trace the previous real-time mechanism. It provides 4 levels of messags :(DEBUG,INFO,
- If you just need to collect informations from signals (like rosbag). You can use WARNING, ERROR). It is described in details here: \subpage subp_logger
an entity called Tracer inside the graph:\subpage tracerdoc . <br> - Programmatically in C++ to avoid overhead with macros and handling level as an
A real time version exists int: \subpage subp_dbg_trace
to write directly inside a memory buffer \subpage tracerrealtimedoc - If you just need to collect informations from signals (like rosbag). You can
use an entity called Tracer inside the graph:\subpage tracerdoc . <br> A real
time version exists to write directly inside a memory buffer \subpage
tracerrealtimedoc
**/ **/
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
In order to activate the logger you need to add the following lines: In order to activate the logger you need to add the following lines:
\code \code
#define ENABLE_RT_LOG #define ENABLE_RT_LOG
#include <dynamic-graph/real-time-logger.h>
#include <dynamic-graph/logger.h> #include <dynamic-graph/logger.h>
#include <dynamic-graph/real-time-logger.h>
\endcode \endcode
\subsection subsec_logger_ Initialize the output stream \subsection subsec_logger_ Initialize the output stream
...@@ -39,14 +39,16 @@ The second line specifies at which frequency the STREAM messages should be ...@@ -39,14 +39,16 @@ The second line specifies at which frequency the STREAM messages should be
printed.<br> printed.<br>
The third line specifies the level of message to accept.<br> The third line specifies the level of message to accept.<br>
The fourth line returns the level of verbosity. The fourth line returns the level of verbosity.
In this case, all messages are accepted and the STREAM message are displayed on the output streams once on five. <br> In this case, all messages are accepted and the STREAM message are displayed on
the output streams once on five. <br>
The full list of options are: The full list of options are:
<ul> <ul>
<li>VERBOSITY_ALL: Accept all messages</li> <li>VERBOSITY_ALL: Accept all messages</li>
<li>VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO, WARNING, ERROR</li> <li>VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO,
<li>VERBOSITY_WARNING_ERROR: Accept messages at minimum level : WARNING, ERROR</li> WARNING, ERROR</li> <li>VERBOSITY_WARNING_ERROR: Accept messages at minimum
<li>VERBOSITY_ERROR: Accept messages at minimum level : ERROR</li> level : WARNING, ERROR</li> <li>VERBOSITY_ERROR: Accept messages at minimum
level : ERROR</li>
</ul> </ul>
...@@ -54,19 +56,23 @@ The full list of options are: ...@@ -54,19 +56,23 @@ The full list of options are:
Here is some example on how to display or record some information. Here is some example on how to display or record some information.
\code \code
sendMsg("This is a message of level MSG_TYPE_DEBUG",MSG_TYPE_DEBUG, __FILE__,__LINE__); sendMsg("This is a message of level MSG_TYPE_DEBUG",MSG_TYPE_DEBUG,
sendMsg("This is a message of level MSG_TYPE_INFO",MSG_TYPE_INFO, __FILE__,__LINE__); __FILE__,__LINE__); sendMsg("This is a message of level
sendMsg("This is a message of level MSG_TYPE_WARNING",MSG_TYPE_WARNING, __FILE__,__LINE__); MSG_TYPE_INFO",MSG_TYPE_INFO, __FILE__,__LINE__); sendMsg("This is a message of
sendMsg("This is a message of level MSG_TYPE_ERROR",MSG_TYPE_ERROR, __FILE__,__LINE__); level MSG_TYPE_WARNING",MSG_TYPE_WARNING, __FILE__,__LINE__); sendMsg("This is a
sendMsg("This is a message of level MSG_TYPE_DEBUG_STREAM",MSG_TYPE_DEBUG_STREAM, __FILE__,__LINE__); message of level MSG_TYPE_ERROR",MSG_TYPE_ERROR, __FILE__,__LINE__);
sendMsg("This is a message of level MSG_TYPE_INFO_STREAM",MSG_TYPE_INFO_STREAM, __FILE__,__LINE__); sendMsg("This is a message of level
sendMsg("This is a message of level MSG_TYPE_WARNING_STREAM",MSG_TYPE_WARNING_STREAM, __FILE__,__LINE__); MSG_TYPE_DEBUG_STREAM",MSG_TYPE_DEBUG_STREAM, __FILE__,__LINE__); sendMsg("This
sendMsg("This is a message of level MSG_TYPE_ERROR_STREAM",MSG_TYPE_ERROR_STREAM, __FILE__,__LINE__); is a message of level MSG_TYPE_INFO_STREAM",MSG_TYPE_INFO_STREAM,
__FILE__,__LINE__); sendMsg("This is a message of level
MSG_TYPE_WARNING_STREAM",MSG_TYPE_WARNING_STREAM, __FILE__,__LINE__);
sendMsg("This is a message of level
MSG_TYPE_ERROR_STREAM",MSG_TYPE_ERROR_STREAM, __FILE__,__LINE__);
logger_.countdown(); logger_.countdown();
\endcode \endcode
Specifying the file with __FILE__ and the line inside the file by __LINE__ are necessary for the Specifying the file with __FILE__ and the line inside the file by __LINE__ are
STREAM messages. Indeed they are indexed using the two values. As the default value are "" and 0 necessary for the STREAM messages. Indeed they are indexed using the two values.
the counting will be confused. As the default value are "" and 0 the counting will be confused.
*/ */
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
\section subp_dbg_trace_intro Introduction \section subp_dbg_trace_intro Introduction
The idea of this class and collection of MACROS is to specify The idea of this class and collection of MACROS is to specify
a level for a message, and record the message in a stream according to this level. a level for a message, and record the message in a stream according to this
In addition there are mechanisms allowing that no time level. In addition there are mechanisms allowing that no time is wasted in
is wasted in condition test. You can therefore let the debugging messages condition test. You can therefore let the debugging messages inside the code
inside the code without impact on performances. without impact on performances.
\section subp_dbg_trace_set_on_macros Setting up dgDEBUG macros \section subp_dbg_trace_set_on_macros Setting up dgDEBUG macros
...@@ -31,12 +31,9 @@ are written is specified by: ...@@ -31,12 +31,9 @@ are written is specified by:
\section subp_dbg_trace_using_macros Using dgDEBUG macros \section subp_dbg_trace_using_macros Using dgDEBUG macros
To print that the beginning of a method is being executed use the following macros: To print that the beginning of a method is being executed use the following
\code macros: \code dgDEBUGIN(5); \endcode 5 here specifies the minimum level that you
dgDEBUGIN(5); be specified by VP_DEBUG_MODE for this message to be displayed.
\endcode
5 here specifies the minimum level that you be specified by VP_DEBUG_MODE for this message
to be displayed.
It will generate the following output: It will generate the following output:
\code \code
...@@ -62,8 +59,8 @@ A message inside the code is written through: ...@@ -62,8 +59,8 @@ A message inside the code is written through:
This generates the following output: This generates the following output:
\code \code
/path_to/dynamic-graph/tests/debug-trace.cpp: testDebugTrace(#52) :Here is a test /path_to/dynamic-graph/tests/debug-trace.cpp: testDebugTrace(#52) :Here is a
\endcode test \endcode
\section subp_dbg_trace_wrk_exp Working example \section subp_dbg_trace_wrk_exp Working example
......
...@@ -5,45 +5,57 @@ ...@@ -5,45 +5,57 @@
\subsection entity_definition General definition \subsection entity_definition General definition
\image html entity.png \image html entity.png
Despite the fact that it looks very similar to a ROS node or a CORBA/OpenRTM server, an entity is simply a C++ object. Despite the fact that it looks very similar to a ROS node or a CORBA/OpenRTM
The main idea is that this entity is providing mostly a data-driven functionnality working at very high rate (\f$ 200 server, an entity is simply a C++ object. The main idea is that this entity is
providing mostly a data-driven functionnality working at very high rate (\f$ 200
Hz\f$ or \f$ 1 kHz \f$) and should have a minimal computational time foot-print. Hz\f$ or \f$ 1 kHz \f$) and should have a minimal computational time foot-print.
For this \subpage subp_signals (or ports to use a more classical terminology) are providing a time dependency between For this \subpage subp_signals (or ports to use a more classical terminology)
data. To implement this, an output signal is linked with a method of the entity. The method calls input signals or use are providing a time dependency between data. To implement this, an output
other means to get the needed data. It might be provided by the connection with remote computers through a middleware, signal is linked with a method of the entity. The method calls input signals or
or specific protocols, but in general the external data is based upon the sensor values provided by a "Device" entity. use other means to get the needed data. It might be provided by the connection
For this reason the signal evaluations are realized through the cascade of dependencies and start from the evaluation with remote computers through a middleware, or specific protocols, but in
of an input signal of a periodic node (in general the device). This is realized inside a \b real-time thread. general the external data is based upon the sensor values provided by a "Device"
entity. For this reason the signal evaluations are realized through the cascade
To add flexibility to a node, it is possible to add command with arguments to modify the internal behavior of the of dependencies and start from the evaluation of an input signal of a periodic
entity or get information from the entity. As a command is in general asynchronous and rare with respect to the node (in general the device). This is realized inside a \b real-time thread.
data-flow scheme for the signals the command is in general executed in a \b none-real-time thread.
To add flexibility to a node, it is possible to add command with arguments to
modify the internal behavior of the entity or get information from the entity.
As a command is in general asynchronous and rare with respect to the data-flow
scheme for the signals the command is in general executed in a \b none-real-time
thread.
\subsection entity_classes Entity class \subsection entity_classes Entity class
Entities are implemented as C++ classes and compiled as dynamic libraries. They can be loaded and instancied Entities are implemented as C++ classes and compiled as dynamic libraries. They
dynamically. It is therefore necessary to specify the location of their dynamical libraries. However given the time it can be loaded and instancied dynamically. It is therefore necessary to specify
might take to load the library, it is not advised to do that during a control-law computation. Entity instanciation the location of their dynamical libraries. However given the time it might take
also implies memory allocation which is also time consuming and thus not advised inside a real-time thread. to load the library, it is not advised to do that during a control-law
computation. Entity instanciation also implies memory allocation which is also
time consuming and thus not advised inside a real-time thread.
The entities will be placed in ${PREFIX}/lib/plugin (since this may change, it is advised to The entities will be placed in ${PREFIX}/lib/plugin (since this may change, it
check the install log or the CMakeLists.txt file to check the installation path). is advised to check the install log or the CMakeLists.txt file to check the
installation path).
\subsection entities List of entities in this package \subsection entities List of entities in this package
Since most of the functionality in projects using the dynamic-graph framework Since most of the functionality in projects using the dynamic-graph framework
is exposed from entities, here is a short description of all the entities contained in is exposed from entities, here is a short description of all the entities
this package. Note that most entities are contained in a binary file that closely matches contained in this package. Note that most entities are contained in a binary
the entities' names in the scripts; loading this file with the plugin loader will file that closely matches the entities' names in the scripts; loading this file
enable creation of this entity through the factory. with the plugin loader will enable creation of this entity through the factory.
\li \ref tracerdoc \li \ref tracerdoc
\li \ref tracerrealtimedoc \li \ref tracerrealtimedoc
\subsection specific_semantics Specific semantics with entities \subsection specific_semantics Specific semantics with entities
It is possible to derive classes and apply specific semantic for the entities. In our case we are interested in It is possible to derive classes and apply specific semantic for the entities.
specific control semantics: \li Tasks (more information <a In our case we are interested in specific control semantics: \li Tasks (more
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00089.html">here</a>) \li Features (more information <a information <a
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00030.html">here</a>) \li Solver (more information <a href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00089.html">here</a>)
\li Features (more information <a
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00030.html">here</a>)
\li Solver (more information <a
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00078.html">here</a>) href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00078.html">here</a>)
*/ */
...@@ -5,21 +5,24 @@ ...@@ -5,21 +5,24 @@
\subsection use_programmatically General introduction \subsection use_programmatically General introduction
For control purposes the main use of this package is to create new entities and connect them through signals. For control purposes the main use of this package is to create new entities and
connect them through signals.
Objects, which are derived from Entities (base class dynamicgraph::Entity), can be Objects, which are derived from Entities (base class dynamicgraph::Entity), can
declared within the code and compiled as shared libraries (.so/.dll files). be declared within the code and compiled as shared libraries (.so/.dll files).
These libraries can be loaded at run-time using the PluginLoader methods, These libraries can be loaded at run-time using the PluginLoader methods,
and at the same time register their class names to the Factory (see the and at the same time register their class names to the Factory (see the
examples in the <a href="http://projects.laas.fr/gepetto/doc/stack-of-tasks/sot-core/master/doxygen-html">sot-core examples in the <a
href="http://projects.laas.fr/gepetto/doc/stack-of-tasks/sot-core/master/doxygen-html">sot-core
documentation</a> for advanced control examples). documentation</a> for advanced control examples).
The Factory can then create instances of these objects and subsequently The Factory can then create instances of these objects and subsequently
register them in the Pool. From the pool they can be listed, accessed, and acted upon register them in the Pool. From the pool they can be listed, accessed, and acted
(see PoolStorage documentation). Basic commands defined by entities include upon (see PoolStorage documentation). Basic commands defined by entities include
signal connection graph file generation, help and name print, and signals. signal connection graph file generation, help and name print, and signals.
This is usually done through a scripting language such as python (see This is usually done through a scripting language such as python (see
<a hef="https://github.com/stack-of-tasks/dynamic-graph-python">dynamic-graph-python</a>) <a
hef="https://github.com/stack-of-tasks/dynamic-graph-python">dynamic-graph-python</a>)
The singletons made available by including the corresponding headers in this The singletons made available by including the corresponding headers in this
module are: module are:
...@@ -30,13 +33,15 @@ For an example of a program creating entities in C++, see the unit test ...@@ -30,13 +33,15 @@ For an example of a program creating entities in C++, see the unit test
test_pool.cpp (in your package source directory/tests). test_pool.cpp (in your package source directory/tests).
\subsection Tutorial \subsection Tutorial
A tutorial is available <a href="http://stack-of-tasks.github.io/dynamic-graph-tutorial/">here</a>. A tutorial is available <a
It is providing a step-by-step way of building an entity href="http://stack-of-tasks.github.io/dynamic-graph-tutorial/">here</a>. It is
providing a step-by-step way of building an entity
\section sec_htw_helpers Helpers \section sec_htw_helpers Helpers
When writing entities you might use some macros which are very useful to write your class. When writing entities you might use some macros which are very useful to write
your class.
\subsection subsec_howto_typedef Entity helpers \subsection subsec_howto_typedef Entity helpers
...@@ -48,13 +53,13 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName ...@@ -48,13 +53,13 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName
<ul> <ul>
<li> <b>DYNAMIC_GRAPH_ENTITY_DECL()</b>: <li> <b>DYNAMIC_GRAPH_ENTITY_DECL()</b>:
This macro creates a method <b>getClassName()</b> which returns the class name.</li> This macro creates a method <b>getClassName()</b> which returns the class
This macro <b>should</b> be used in the declaration of the class. name.</li> This macro <b>should</b> be used in the declaration of the class.
</li> </li>
<li> <b>DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(classtype,classname)</b> <li> <b>DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(classtype,classname)</b>
This macros creates the methods necessary to have a factory building the C++ class This macros creates the methods necessary to have a factory building the C++
<b>classtype</b> from the string <b>classname</b>. class <b>classtype</b> from the string <b>classname</b>. This macro
This macro <b>should</b> be used in the implementation of the class. <b>should</b> be used in the implementation of the class.
</li> </li>
</ul> </ul>
...@@ -64,15 +69,12 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName ...@@ -64,15 +69,12 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName
<li> Macro for input signals <li> Macro for input signals
<ul> <ul>
<li> <b>DECLARE_SIGNAL_IN(signal_name,type)</b>: <li> <b>DECLARE_SIGNAL_IN(signal_name,type)</b>:
Declare an input time dependent signal as a field of the class with the following name: Declare an input time dependent signal as a field of the class with the
\code following name: \code m_signal_nameSIN \endcode
m_signal_nameSIN
\endcode
</li> </li>
<li> <b>CONSTRUCT_SIGNAL_IN(signal_name,type)</b>: <li> <b>CONSTRUCT_SIGNAL_IN(signal_name,type)</b>:
This macro is used in the constructor of the entity class handling this signal. This macro is used in the constructor of the entity class handling this
It is calling the signal constructor and set the signal name to: signal. It is calling the signal constructor and set the signal name to: \code
\code
EntityClassName(entity-name)::input(type)::signal_name EntityClassName(entity-name)::input(type)::signal_name
\endcode \endcode
</ul> </ul>
...@@ -80,32 +82,24 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName ...@@ -80,32 +82,24 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName
<li> Macro for output signals <li> Macro for output signals
<ul> <ul>
<li> <b>DECLARE_SIGNAL_OUT(signal_name,type)</b>: <li> <b>DECLARE_SIGNAL_OUT(signal_name,type)</b>:
Declare an output time dependent signal as a field of the class with the following name: Declare an output time dependent signal as a field of the class with the
\code following name: \code m_signal_nameSOUT \endcode It also declares a method with
m_signal_nameSOUT the following pattern: \code type signal_nameSOUT_function(type &,int) \endcode
\endcode
It also declares a method with the following pattern:
\code
type signal_nameSOUT_function(type &,int)
\endcode
The second pattern is the time when calling the output. The second pattern is the time when calling the output.
</li> </li>
<li> <b>CONSTRUCT_SIGNAL_OUT(signal_name,type)</b> <li> <b>CONSTRUCT_SIGNAL_OUT(signal_name,type)</b>
This macro is used in the constructor of the entity class handling this signal. This macro is used in the constructor of the entity class handling this
It creates the binding to the method described previously, and set the signal name to: signal. It creates the binding to the method described previously, and set the
\code signal name to: \code EntityClassName(entity_name)::output(type)::signal_name
EntityClassName(entity_name)::output(type)::signal_name
\endcode \endcode
where entity_name is the name of the entity currently instanciated. where entity_name is the name of the entity currently instanciated.
</li> </li>
<li> <b>DEFINE_SIGNAL_OUT_FUNCTION(signal_name, type)</b>: <li> <b>DEFINE_SIGNAL_OUT_FUNCTION(signal_name, type)</b>:
This macro is used when implementing the method specific to the output signal. This macro is used when implementing the method specific to the output
It is used in the main body of the entity class to declare the header of the method signal. It is used in the main body of the entity class to declare the header of
with the following pattern: the method with the following pattern: \code type
\code EntityClassName::signal_nameSOUT_function(type &, int iter) \endcode
type EntityClassName::signal_nameSOUT_function(type &, int iter)
\endcode
</li> </li>
</ul> </ul>
...@@ -113,8 +107,8 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName ...@@ -113,8 +107,8 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName
</li> Inner signals </li> Inner signals
<ul> <ul>
<li> <b> DECLARE_SIGNAL_INNER(signal_name,type)</b> <li> <b> DECLARE_SIGNAL_INNER(signal_name,type)</b>
Inner signal are signal that depend on a state of the entity and not on input signals. Inner signal are signal that depend on a state of the entity and not on
This macro declares an inner signal with the following pattern: input signals. This macro declares an inner signal with the following pattern:
\code \code
m_signal_nameSINNER m_signal_nameSINNER
\endcode \endcode
...@@ -124,11 +118,13 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName ...@@ -124,11 +118,13 @@ The header <b>entity-helper.h</b> is defining a type called EntityClassName
\endcode \endcode
</li> </li>
<li> <b>DEFINE_SIGNAL_INNER_FUNCTION(signal_name,type)</b> <li> <b>DEFINE_SIGNAL_INNER_FUNCTION(signal_name,type)</b>
This macro is used to implement the method related to signal_name. More precisely This macro is used to implement the method related to signal_name. More
it provides the header of the member function(i.e. method) declaration. precisely it provides the header of the member function(i.e. method)
declaration.
</li> </li>
<li><b>DECLARE_SIGNAL_INNER_FUNCTION(signal_name,type)</b> <li><b>DECLARE_SIGNAL_INNER_FUNCTION(signal_name,type)</b>
This macros declares the member function used to handle the access to this signal. This macros declares the member function used to handle the access to this
signal.
</li> </li>
</ul> </ul>
</ul> </ul>
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
\page subp_factory Factory \page subp_factory Factory
\section sec_factory Factory \section sec_factory Factory
The class \ref dynamicgraph::FactoryStorage is a singleton which register the entity classes and which is allowing the The class \ref dynamicgraph::FactoryStorage is a singleton which register the
instancation of such classes. entity classes and which is allowing the instancation of such classes.
*/ */
...@@ -6,14 +6,16 @@ In this package, the graph considered are directed graphs. ...@@ -6,14 +6,16 @@ In this package, the graph considered are directed graphs.
In dynamic-graph a graph is build with: In dynamic-graph a graph is build with:
- computational nodes which are entities \subpage subpage_entities. - computational nodes which are entities \subpage subpage_entities.
- directed edges which are created by connecting input and output signals \subpage subp_signals. - directed edges which are created by connecting input and output signals
- managing the nodes is done through a factory \subpage subp_factory providing classes and a way to create instances \subpage subp_signals.
from this list of classes. - managing the nodes is done through a factory \subpage subp_factory providing
classes and a way to create instances from this list of classes.
- the instances of node are handled through a pool \subpage subp_pool - the instances of node are handled through a pool \subpage subp_pool
We strongly recommend to use a scripting language such as Python to We strongly recommend to use a scripting language such as Python to
manage the graph. manage the graph.
See <c>dynamic-graph-python</c> for more information on binding dynamic-graph with Python. See <c>dynamic-graph-python</c> for more information on binding dynamic-graph
with Python.
It is possible to display the graph of entities \subpage writegraphdoc It is possible to display the graph of entities \subpage writegraphdoc
......
...@@ -13,7 +13,8 @@ dynamic-graph depends on: ...@@ -13,7 +13,8 @@ dynamic-graph depends on:
\section sec_inst_get_src Getting the source \section sec_inst_get_src Getting the source
The sources are available through github at the following URL: The sources are available through github at the following URL:
<a href="https://github.com/stack-of-tasks/dynamic-graph">https://github.com/stack-of-tasks/dynamic-graph</a> <a
href="https://github.com/stack-of-tasks/dynamic-graph">https://github.com/stack-of-tasks/dynamic-graph</a>
To clone: To clone:
\code \code
......
...@@ -3,63 +3,65 @@ ...@@ -3,63 +3,65 @@
\section intro_dynamicGraph Introduction \section intro_dynamicGraph Introduction
The dynamic-graph package is used to connect computation nodes, "entities" The dynamic-graph package is used to connect computation nodes, "entities"
together using a graph system, akin to what Simulink does. Entities are connected together using a graph system, akin to what Simulink does. Entities are
through input and output signals. connected through input and output signals. With the building blocks this
With the building blocks this package provides, you can easily create a full computation graph package provides, you can easily create a full computation graph for a given
for a given problem. It is the basis for the stack of tasks operation. problem. It is the basis for the stack of tasks operation.
\subsection controlgraph Exemple: Real-time control \subsection controlgraph Exemple: Real-time control
<p>To give a more concrete example, the real-time control used by the Gepetto group for the humanoid robot HRP-2 <p>To give a more concrete example, the real-time control used by the Gepetto
is detailled.</p> group for the humanoid robot HRP-2 is detailled.</p> <p> Real-time control
<p> system are usually driven by a cyclic computational node which needs to send a
Real-time control system are usually driven by a cyclic computational node which control reference value to each motors of a robot. To compute this control
needs to send a control reference value to each motors of a robot. To compute this reference values, sensor values need to be provided. In the Stack-Of-Tasks
control reference values, sensor values need to be provided. special entities called Device are used to provide an abstract interface to the
In the Stack-Of-Tasks special entities called Device are used to hardware.</p> A scheme of the real-time control graph used for the humanoid
provide an abstract interface to the hardware.</p> robot HRP-2 is depicted in the following figure:
A scheme of the real-time control graph used for the humanoid robot HRP-2 is depicted in the following figure:
\image html Concept-Software-Fig.png \image html Concept-Software-Fig.png
You can find an example of a real example of control graph at \ref writegraphdoc. You can find an example of a real example of control graph at \ref
writegraphdoc.
<p>The device therefore has a specific input which should contain the control vector. <p>The device therefore has a specific input which should contain the control
This control vector is the result of a computation solving a control problem. vector. This control vector is the result of a computation solving a control
The entity in charge of solving this control problem is called "Solver" in the previous problem. The entity in charge of solving this control problem is called "Solver"
figure. in the previous figure. In the SoT framework it is often cast as an optimization
In the SoT framework it is often cast as an optimization problem. problem. This optimization problem is build using a control "Task" (not to be
This optimization problem is build using a control "Task" (not to be confused with the confused with the general word task). A control "Task" regulates the difference
general word task). A control "Task" regulates the difference with a "Feature" computed with a "Feature" computed on the current robot state and a "Desired Feature".
on the current robot state and a "Desired Feature". For instance when walking, the regulated For instance when walking, the regulated feature is the robot's Center-Of-Mass
feature is the robot's Center-Of-Mass (CoM) position. The "Feature" is computed using a (CoM) position. The "Feature" is computed using a library using the robot model
library using the robot model and the sensor value. The entity making this computation is "Dyn". and the sensor value. The entity making this computation is "Dyn". A walking
A walking pattern generator using foot-steps position given in advance generates the desired pattern generator using foot-steps position given in advance generates the
value for the CoM. desired value for the CoM. Note that the "Dyn" entity uses the sensor provided
Note that the "Dyn" entity uses the sensor provided by the entity "Robot". </p> by the entity "Robot". </p>
<p> <p>
From a pure computer science viewpoint we wish to avoid recomputing data such as articular Jacobians From a pure computer science viewpoint we wish to avoid recomputing data such as
when this is unnecessary. Therefore the data generated by an entity through signals may have two types of articular Jacobians when this is unnecessary. Therefore the data generated by an
dependencies: one dependency related to time and dependencies on other signals. Internally an entity entity through signals may have two types of dependencies: one dependency
does not recompute the data if no new information is available, it is simply providing the same information related to time and dependencies on other signals. Internally an entity does not
computed before. Please note that this package provides only the computational framework to realize recompute the data if no new information is available, it is simply providing
the data dependency and the entities. Solvers, libraries to compute mechanical quantities are provided the same information computed before. Please note that this package provides
in different packages. only the computational framework to realize the data dependency and the
entities. Solvers, libraries to compute mechanical quantities are provided in
different packages.
</p> </p>
<p> <p>
Finally in order to dynamically create a graph, it is possible \b on-line to load classes of entities and Finally in order to dynamically create a graph, it is possible \b on-line to