Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-talos-balance
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
sot-talos-balance
Commits
17517cc4
Commit
17517cc4
authored
6 years ago
by
François Bailly
Browse files
Options
Downloads
Patches
Plain Diff
added compatiblilty with signal-helper of dynamic-graph and added test of logger inside example.cpp
parent
e0d3d8d0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/sot/talos_balance/example.hh
+11
-7
11 additions, 7 deletions
include/sot/talos_balance/example.hh
src/example.cpp
+15
-7
15 additions, 7 deletions
src/example.cpp
with
26 additions
and
14 deletions
include/sot/talos_balance/example.hh
+
11
−
7
View file @
17517cc4
...
...
@@ -36,11 +36,15 @@
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */
#include
"utils/signal-helper.hh"
#include
"utils/logger.hh"
// #include "utils/signal-helper.hh"
#include
<dynamic-graph/signal-helper.h>
// #include "utils/logger.hh"
#include
<dynamic-graph/logger.h>
#include
<map>
#include
"boost/assign.hpp"
#include
<sot/
talos_balanc
e/robot-utils.hh>
#include
<sot/
cor
e/robot-utils.hh>
namespace
dynamicgraph
{
namespace
sot
{
...
...
@@ -74,10 +78,10 @@ namespace dynamicgraph {
/* --- ENTITY INHERITANCE --- */
virtual
void
display
(
std
::
ostream
&
os
)
const
;
void
sendMsg
(
const
std
::
string
&
msg
,
MsgType
t
=
MSG_TYPE_INFO
,
const
char
*
file
=
""
,
int
line
=
0
)
{
getLogger
().
sendMsg
(
"[Example-"
+
name
+
"] "
+
msg
,
t
,
file
,
line
);
}
//
void sendMsg(const std::string& msg, MsgType t=MSG_TYPE_INFO, const char* file="", int line=0)
//
{
//
getLogger().sendMsg("[Example-"+name+"] "+msg, t, file, line);
//
}
protected:
bool
m_initSucceeded
;
/// true if the entity has been successfully initialized
...
...
This diff is collapsed.
Click to expand it.
src/example.cpp
+
15
−
7
View file @
17517cc4
...
...
@@ -38,9 +38,9 @@ namespace dynamicgraph
#define PROFILE_EXAMPLE_SUM_COMPUTATION "Example: sum computation "
#define PROFILE_EXAMPLE_NBJOINTS_COMPUTATION "Example: nbJoints extraction "
#define INPUT_SIGNALS
m_
firstAddendSIN <<
m_
secondAddendSIN
#define INPUT_SIGNALS firstAddendSIN << secondAddendSIN
#define OUTPUT_SIGNALS
m_
sumSOUT <<
m_
nbJointsSOUT
#define OUTPUT_SIGNALS sumSOUT << nbJointsSOUT
/// Define EntityClassName here rather than in the header file
/// so that it can be used by the macros DEFINE_SIGNAL_**_FUNCTION.
...
...
@@ -69,9 +69,9 @@ namespace dynamicgraph
void
Example
::
init
(
const
std
::
string
&
robotName
)
{
if
(
!
m_
firstAddendSIN
.
isPlugged
())
if
(
!
firstAddendSIN
.
isPlugged
())
return
SEND_MSG
(
"Init failed: signal firstAddend is not plugged"
,
MSG_TYPE_ERROR
);
if
(
!
m_
secondAddendSIN
.
isPlugged
())
if
(
!
secondAddendSIN
.
isPlugged
())
return
SEND_MSG
(
"Init failed: signal secondAddend is not plugged"
,
MSG_TYPE_ERROR
);
/*std::string & robotName_nonconst = const_cast<std::string &>(robotName);*/
...
...
@@ -86,7 +86,15 @@ namespace dynamicgraph
m_robot_util
=
getRobotUtil
(
robotName_nonconst
);
std
::
cerr
<<
"m_robot_util:"
<<
m_robot_util
<<
std
::
endl
;
}
for
(
unsigned
int
i
=
0
;
i
<
4
;
i
++
)
{
std
::
cout
<<
"Verbosity Level :"
<<
i
<<
std
::
endl
;
Example
::
setLoggerVerbosityLevel
((
dynamicgraph
::
LoggerVerbosity
)
i
);
Example
::
sendMsg
(
"TEST MSG ERROR"
,
dynamicgraph
::
MSG_TYPE_ERROR
);
Example
::
sendMsg
(
"TEST MSG DEBUG"
,
dynamicgraph
::
MSG_TYPE_DEBUG
);
Example
::
sendMsg
(
"TEST MSG INFO"
,
dynamicgraph
::
MSG_TYPE_INFO
);
Example
::
sendMsg
(
"TEST MSG WARNING"
,
dynamicgraph
::
MSG_TYPE_WARNING
);
}
m_initSucceeded
=
true
;
}
...
...
@@ -104,8 +112,8 @@ namespace dynamicgraph
getProfiler
().
start
(
PROFILE_EXAMPLE_SUM_COMPUTATION
);
double
firstAddend
=
m_
firstAddendSIN
(
iter
);
double
secondAddend
=
m_
secondAddendSIN
(
iter
);
double
firstAddend
=
firstAddendSIN
(
iter
);
double
secondAddend
=
secondAddendSIN
(
iter
);
s
=
firstAddend
+
secondAddend
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment