Skip to content

Commit df48199

Browse files
[clang-format] Comply to Google style.
1 parent 48e05f1 commit df48199

File tree

93 files changed

+5233
-5808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+5233
-5808
lines changed

.clang-format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
ColumnLimit: 80
3+
...

doc/additionalDoc/debug-doc.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
/**
22
\page debug Debugging
33
4-
They are several ways to perform debugging in dynamic-graph depending on your needs or situation:
5-
- Programmatically inside the entity in C++ will write inside a buffer in a different thread and output in a stream
6-
(either std::cout or a file). It is detailed in \subpage subp_debug_rt_logger.
7-
- Programmatically inside the entity in C++ using a member of the entities and the previous real-time mechanism.
8-
It provides 4 levels of messags :(DEBUG,INFO, WARNING, ERROR). It is described in details here:
9-
\subpage subp_logger
10-
- Programmatically in C++ to avoid overhead with macros and handling level as an int: \subpage subp_dbg_trace
11-
- If you just need to collect informations from signals (like rosbag). You can use
12-
an entity called Tracer inside the graph:\subpage tracerdoc . <br>
13-
A real time version exists
14-
to write directly inside a memory buffer \subpage tracerrealtimedoc
4+
They are several ways to perform debugging in dynamic-graph depending on your
5+
needs or situation:
6+
- Programmatically inside the entity in C++ will write inside a buffer in a
7+
different thread and output in a stream (either std::cout or a file). It is
8+
detailed in \subpage subp_debug_rt_logger.
9+
- Programmatically inside the entity in C++ using a member of the entities and
10+
the previous real-time mechanism. It provides 4 levels of messags :(DEBUG,INFO,
11+
WARNING, ERROR). It is described in details here: \subpage subp_logger
12+
- Programmatically in C++ to avoid overhead with macros and handling level as an
13+
int: \subpage subp_dbg_trace
14+
- If you just need to collect informations from signals (like rosbag). You can
15+
use an entity called Tracer inside the graph:\subpage tracerdoc . <br> A real
16+
time version exists to write directly inside a memory buffer \subpage
17+
tracerrealtimedoc
1518
**/

doc/additionalDoc/debug-logger.h

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
In order to activate the logger you need to add the following lines:
99
\code
1010
#define ENABLE_RT_LOG
11-
#include <dynamic-graph/real-time-logger.h>
1211
#include <dynamic-graph/logger.h>
12+
#include <dynamic-graph/real-time-logger.h>
1313
\endcode
1414
1515
\subsection subsec_logger_ Initialize the output stream
@@ -39,34 +39,40 @@ The second line specifies at which frequency the STREAM messages should be
3939
printed.<br>
4040
The third line specifies the level of message to accept.<br>
4141
The fourth line returns the level of verbosity.
42-
In this case, all messages are accepted and the STREAM message are displayed on the output streams once on five. <br>
42+
In this case, all messages are accepted and the STREAM message are displayed on
43+
the output streams once on five. <br>
4344
4445
The full list of options are:
4546
<ul>
4647
<li>VERBOSITY_ALL: Accept all messages</li>
47-
<li>VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO, WARNING, ERROR</li>
48-
<li>VERBOSITY_WARNING_ERROR: Accept messages at minimum level : WARNING, ERROR</li>
49-
<li>VERBOSITY_ERROR: Accept messages at minimum level : ERROR</li>
48+
<li>VERBOSITY_INFO_WARNING_ERROR: Accept messages at minimum level : INFO,
49+
WARNING, ERROR</li> <li>VERBOSITY_WARNING_ERROR: Accept messages at minimum
50+
level : WARNING, ERROR</li> <li>VERBOSITY_ERROR: Accept messages at minimum
51+
level : ERROR</li>
5052
</ul>
5153
5254
5355
\section sec_logger_tests Displaying messages
5456
5557
Here is some example on how to display or record some information.
5658
\code
57-
sendMsg("This is a message of level MSG_TYPE_DEBUG",MSG_TYPE_DEBUG, __FILE__,__LINE__);
58-
sendMsg("This is a message of level MSG_TYPE_INFO",MSG_TYPE_INFO, __FILE__,__LINE__);
59-
sendMsg("This is a message of level MSG_TYPE_WARNING",MSG_TYPE_WARNING, __FILE__,__LINE__);
60-
sendMsg("This is a message of level MSG_TYPE_ERROR",MSG_TYPE_ERROR, __FILE__,__LINE__);
61-
sendMsg("This is a message of level MSG_TYPE_DEBUG_STREAM",MSG_TYPE_DEBUG_STREAM, __FILE__,__LINE__);
62-
sendMsg("This is a message of level MSG_TYPE_INFO_STREAM",MSG_TYPE_INFO_STREAM, __FILE__,__LINE__);
63-
sendMsg("This is a message of level MSG_TYPE_WARNING_STREAM",MSG_TYPE_WARNING_STREAM, __FILE__,__LINE__);
64-
sendMsg("This is a message of level MSG_TYPE_ERROR_STREAM",MSG_TYPE_ERROR_STREAM, __FILE__,__LINE__);
59+
sendMsg("This is a message of level MSG_TYPE_DEBUG",MSG_TYPE_DEBUG,
60+
__FILE__,__LINE__); sendMsg("This is a message of level
61+
MSG_TYPE_INFO",MSG_TYPE_INFO, __FILE__,__LINE__); sendMsg("This is a message of
62+
level MSG_TYPE_WARNING",MSG_TYPE_WARNING, __FILE__,__LINE__); sendMsg("This is a
63+
message of level MSG_TYPE_ERROR",MSG_TYPE_ERROR, __FILE__,__LINE__);
64+
sendMsg("This is a message of level
65+
MSG_TYPE_DEBUG_STREAM",MSG_TYPE_DEBUG_STREAM, __FILE__,__LINE__); sendMsg("This
66+
is a message of level MSG_TYPE_INFO_STREAM",MSG_TYPE_INFO_STREAM,
67+
__FILE__,__LINE__); sendMsg("This is a message of level
68+
MSG_TYPE_WARNING_STREAM",MSG_TYPE_WARNING_STREAM, __FILE__,__LINE__);
69+
sendMsg("This is a message of level
70+
MSG_TYPE_ERROR_STREAM",MSG_TYPE_ERROR_STREAM, __FILE__,__LINE__);
6571
6672
logger_.countdown();
6773
\endcode
6874
69-
Specifying the file with __FILE__ and the line inside the file by __LINE__ are necessary for the
70-
STREAM messages. Indeed they are indexed using the two values. As the default value are "" and 0
71-
the counting will be confused.
75+
Specifying the file with __FILE__ and the line inside the file by __LINE__ are
76+
necessary for the STREAM messages. Indeed they are indexed using the two values.
77+
As the default value are "" and 0 the counting will be confused.
7278
*/

doc/additionalDoc/debug-trace-doc.h

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
44
\section subp_dbg_trace_intro Introduction
55
The idea of this class and collection of MACROS is to specify
6-
a level for a message, and record the message in a stream according to this level.
7-
In addition there are mechanisms allowing that no time
8-
is wasted in condition test. You can therefore let the debugging messages
9-
inside the code without impact on performances.
6+
a level for a message, and record the message in a stream according to this
7+
level. In addition there are mechanisms allowing that no time is wasted in
8+
condition test. You can therefore let the debugging messages inside the code
9+
without impact on performances.
1010
1111
\section subp_dbg_trace_set_on_macros Setting up dgDEBUG macros
1212
@@ -31,12 +31,9 @@ are written is specified by:
3131
3232
\section subp_dbg_trace_using_macros Using dgDEBUG macros
3333
34-
To print that the beginning of a method is being executed use the following macros:
35-
\code
36-
dgDEBUGIN(5);
37-
\endcode
38-
5 here specifies the minimum level that you be specified by VP_DEBUG_MODE for this message
39-
to be displayed.
34+
To print that the beginning of a method is being executed use the following
35+
macros: \code dgDEBUGIN(5); \endcode 5 here specifies the minimum level that you
36+
be specified by VP_DEBUG_MODE for this message to be displayed.
4037
4138
It will generate the following output:
4239
\code
@@ -62,8 +59,8 @@ A message inside the code is written through:
6259
6360
This generates the following output:
6461
\code
65-
/path_to/dynamic-graph/tests/debug-trace.cpp: testDebugTrace(#52) :Here is a test
66-
\endcode
62+
/path_to/dynamic-graph/tests/debug-trace.cpp: testDebugTrace(#52) :Here is a
63+
test \endcode
6764
6865
\section subp_dbg_trace_wrk_exp Working example
6966

doc/additionalDoc/entity.h

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,57 @@
55
\subsection entity_definition General definition
66
\image html entity.png
77
8-
Despite the fact that it looks very similar to a ROS node or a CORBA/OpenRTM server, an entity is simply a C++ object.
9-
The main idea is that this entity is providing mostly a data-driven functionnality working at very high rate (\f$ 200
8+
Despite the fact that it looks very similar to a ROS node or a CORBA/OpenRTM
9+
server, an entity is simply a C++ object. The main idea is that this entity is
10+
providing mostly a data-driven functionnality working at very high rate (\f$ 200
1011
Hz\f$ or \f$ 1 kHz \f$) and should have a minimal computational time foot-print.
1112
12-
For this \subpage subp_signals (or ports to use a more classical terminology) are providing a time dependency between
13-
data. To implement this, an output signal is linked with a method of the entity. The method calls input signals or use
14-
other means to get the needed data. It might be provided by the connection with remote computers through a middleware,
15-
or specific protocols, but in general the external data is based upon the sensor values provided by a "Device" entity.
16-
For this reason the signal evaluations are realized through the cascade of dependencies and start from the evaluation
17-
of an input signal of a periodic node (in general the device). This is realized inside a \b real-time thread.
18-
19-
To add flexibility to a node, it is possible to add command with arguments to modify the internal behavior of the
20-
entity or get information from the entity. As a command is in general asynchronous and rare with respect to the
21-
data-flow scheme for the signals the command is in general executed in a \b none-real-time thread.
13+
For this \subpage subp_signals (or ports to use a more classical terminology)
14+
are providing a time dependency between data. To implement this, an output
15+
signal is linked with a method of the entity. The method calls input signals or
16+
use other means to get the needed data. It might be provided by the connection
17+
with remote computers through a middleware, or specific protocols, but in
18+
general the external data is based upon the sensor values provided by a "Device"
19+
entity. For this reason the signal evaluations are realized through the cascade
20+
of dependencies and start from the evaluation of an input signal of a periodic
21+
node (in general the device). This is realized inside a \b real-time thread.
22+
23+
To add flexibility to a node, it is possible to add command with arguments to
24+
modify the internal behavior of the entity or get information from the entity.
25+
As a command is in general asynchronous and rare with respect to the data-flow
26+
scheme for the signals the command is in general executed in a \b none-real-time
27+
thread.
2228
2329
\subsection entity_classes Entity class
24-
Entities are implemented as C++ classes and compiled as dynamic libraries. They can be loaded and instancied
25-
dynamically. It is therefore necessary to specify the location of their dynamical libraries. However given the time it
26-
might take to load the library, it is not advised to do that during a control-law computation. Entity instanciation
27-
also implies memory allocation which is also time consuming and thus not advised inside a real-time thread.
30+
Entities are implemented as C++ classes and compiled as dynamic libraries. They
31+
can be loaded and instancied dynamically. It is therefore necessary to specify
32+
the location of their dynamical libraries. However given the time it might take
33+
to load the library, it is not advised to do that during a control-law
34+
computation. Entity instanciation also implies memory allocation which is also
35+
time consuming and thus not advised inside a real-time thread.
2836
29-
The entities will be placed in ${PREFIX}/lib/plugin (since this may change, it is advised to
30-
check the install log or the CMakeLists.txt file to check the installation path).
37+
The entities will be placed in ${PREFIX}/lib/plugin (since this may change, it
38+
is advised to check the install log or the CMakeLists.txt file to check the
39+
installation path).
3140
3241
\subsection entities List of entities in this package
3342
Since most of the functionality in projects using the dynamic-graph framework
34-
is exposed from entities, here is a short description of all the entities contained in
35-
this package. Note that most entities are contained in a binary file that closely matches
36-
the entities' names in the scripts; loading this file with the plugin loader will
37-
enable creation of this entity through the factory.
43+
is exposed from entities, here is a short description of all the entities
44+
contained in this package. Note that most entities are contained in a binary
45+
file that closely matches the entities' names in the scripts; loading this file
46+
with the plugin loader will enable creation of this entity through the factory.
3847
\li \ref tracerdoc
3948
\li \ref tracerrealtimedoc
4049
4150
\subsection specific_semantics Specific semantics with entities
4251
43-
It is possible to derive classes and apply specific semantic for the entities. In our case we are interested in
44-
specific control semantics: \li Tasks (more information <a
45-
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00089.html">here</a>) \li Features (more information <a
46-
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00030.html">here</a>) \li Solver (more information <a
52+
It is possible to derive classes and apply specific semantic for the entities.
53+
In our case we are interested in specific control semantics: \li Tasks (more
54+
information <a
55+
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00089.html">here</a>)
56+
\li Features (more information <a
57+
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00030.html">here</a>)
58+
\li Solver (more information <a
4759
href="http://stack-of-tasks.github.io/sot-core/doxygen/HEAD/a00078.html">here</a>)
4860
4961
*/

0 commit comments

Comments
 (0)