Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
sot-core
Commits
33597c50
Commit
33597c50
authored
Mar 15, 2019
by
Olivier Stasse
Browse files
Fix Index issue on parameter-server.cpp + fix warnings.
parent
6d6a2d9d
Pipeline
#3520
passed with stage
in 31 minutes and 46 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/sot/flags.cpp
View file @
33597c50
...
...
@@ -29,7 +29,7 @@ using namespace dynamicgraph::sot;
static
void
displaybool
(
ostream
&
os
,
const
char
c
,
const
bool
reverse
=
false
)
{
for
(
unsigned
in
t
j
=
sizeof
(
char
)
*
8
;
j
-->
0
;
)
for
(
std
::
size_
t
j
=
sizeof
(
char
)
*
8
;
j
-->
0
;
)
{
//os<<i<<","<<j<<": "<<c+0<<std::endl;
if
(
reverse
)
os
<<
(
!
((
c
>>
j
)
&
0x1
));
else
os
<<
(((
c
>>
j
)
&
0x1
));
//?"1":"0");
...
...
@@ -38,7 +38,7 @@ static void displaybool( ostream& os, const char c, const bool reverse=false )
static
string
displaybool
(
const
char
c
,
const
bool
reverse
=
false
)
{
stringstream
oss
;
for
(
unsigned
in
t
j
=
sizeof
(
char
)
*
8
;
j
-->
0
;
)
for
(
std
::
size_
t
j
=
sizeof
(
char
)
*
8
;
j
-->
0
;
)
{
//os<<i<<","<<j<<": "<<c+0<<std::endl;
if
(
reverse
)
oss
<<
(
!
((
c
>>
j
)
&
0x1
));
else
oss
<<
(((
c
>>
j
)
&
0x1
));
//?"1":"0");
...
...
src/tools/exp-moving-avg.cpp
View file @
33597c50
...
...
@@ -35,13 +35,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(ExpMovingAvg,"ExpMovingAvg");
ExpMovingAvg
::
ExpMovingAvg
(
const
std
::
string
&
n
)
:
Entity
(
n
)
,
updateSIN
(
NULL
,
"ExpMovingAvg("
+
n
+
")::input(vector)::update"
)
,
alpha
(
0.
)
,
init
(
false
)
,
refresherSINTERN
(
"ExpMovingAvg("
+
n
+
")::intern(dummy)::refresher"
)
,
average
SOUT
(
boost
::
bind
(
&
ExpMovingAvg
::
update
,
this
,
_1
,
_2
),
updateSIN
<<
refresherSINTERN
,
"ExpMovingAvg("
+
n
+
")::output(vector)::average"
)
,
updateSIN
(
NULL
,
"ExpMovingAvg("
+
n
+
")::input(vector)::update"
)
,
refresherSINTERN
(
"ExpMovingAvg("
+
n
+
")::intern(dummy)::refresher"
)
,
averageSOUT
(
boost
::
bind
(
&
ExpMovingAvg
::
update
,
this
,
_1
,
_2
),
updateSIN
<<
refresherSINTERN
,
"ExpMovingAvg("
+
n
+
")::output(vector)::
average
"
)
,
alpha
(
0.
)
,
init
(
false
)
{
// Register signals into the entity.
signalRegistration
(
updateSIN
<<
averageSOUT
);
...
...
src/tools/gradient-ascent.cpp
View file @
33597c50
...
...
@@ -35,13 +35,13 @@ DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(GradientAscent,"GradientAscent");
GradientAscent
::
GradientAscent
(
const
std
::
string
&
n
)
:
Entity
(
n
)
,
gradientSIN
(
NULL
,
"GradientAscent("
+
n
+
")::input(vector)::gradient"
)
,
learningRateSIN
(
NULL
,
"GradientAscent("
+
n
+
")::input(double)::learningRate"
)
,
init
(
false
)
,
refresherSINTERN
(
"GradientAscent("
+
n
+
")::intern(dummy)::refresher"
)
,
valueSOUT
(
boost
::
bind
(
&
GradientAscent
::
update
,
this
,
_1
,
_2
),
gradientSIN
<<
refresherSINTERN
,
"GradientAscent("
+
n
+
")::output(vector)::value"
)
,
gradientSIN
(
NULL
,
"GradientAscent("
+
n
+
")::input(vector)::gradient"
)
,
learningRateSIN
(
NULL
,
"GradientAscent("
+
n
+
")::input(double)::learningRate"
)
,
refresherSINTERN
(
"GradientAscent("
+
n
+
")::intern(dummy)::refresher"
)
,
valueSOUT
(
boost
::
bind
(
&
GradientAscent
::
update
,
this
,
_1
,
_2
),
gradientSIN
<<
refresherSINTERN
,
"GradientAscent("
+
n
+
")::output(vector)::value"
)
,
init
(
false
)
{
// Register signals into the entity.
signalRegistration
(
gradientSIN
<<
learningRateSIN
<<
valueSOUT
);
...
...
src/tools/parameter-server.cpp
View file @
33597c50
...
...
@@ -282,12 +282,12 @@ namespace dynamicgraph
bool
ParameterServer
::
convertJointNameToJointId
(
const
std
::
string
&
name
,
unsigned
int
&
id
)
{
// Check if the joint name exists
Eigen
::
Index
jid
=
m_robot_util
->
get_id_from_name
(
name
);
sot
::
Index
jid
=
m_robot_util
->
get_id_from_name
(
name
);
if
(
jid
<
0
)
{
SEND_MSG
(
"The specified joint name does not exist: "
+
name
,
MSG_TYPE_ERROR
);
std
::
stringstream
ss
;
for
(
Eigen
::
Index
it
=
0
;
it
<
m_robot_util
->
m_nbJoints
;
it
++
)
for
(
long
unsigned
int
it
=
0
;
it
<
m_robot_util
->
m_nbJoints
;
it
++
)
ss
<<
m_robot_util
->
get_name_from_id
(
it
)
<<
", "
;
SEND_MSG
(
"Possible joint names are: "
+
ss
.
str
(),
MSG_TYPE_INFO
);
return
false
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment