Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
i
j
l
m
n
o
p
q
r
s
t
u
v
w
+
Functions
_
a
b
c
d
f
g
i
j
l
m
o
p
q
r
s
t
u
v
+
Variables
_
a
b
c
d
e
f
g
i
j
l
m
n
p
r
s
u
v
w
+
Typedefs
c
e
f
i
m
q
r
s
v
Enumerations
Enumerator
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Typedefs
b
d
e
f
k
l
m
s
t
v
Enumerations
+
Enumerator
a
b
c
d
e
f
g
i
j
k
m
n
o
p
r
s
t
u
Related Functions
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
+
Functions
b
c
d
e
f
g
i
l
m
o
p
r
s
t
u
Variables
+
Typedefs
c
d
e
f
k
r
s
t
Enumerations
Enumerator
+
Macros
_
a
b
c
d
e
f
i
l
m
n
o
p
r
s
t
v
src
tools
event.cpp
Go to the documentation of this file.
1
// Copyright (c) 2017, Joseph Mirabel
2
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3
4
#include <dynamic-graph/factory.h>
5
6
#include <
sot/core/event.hh
>
7
8
namespace
dynamicgraph
{
9
namespace
sot {
10
11
bool
&
Event::check
(
bool
&ret,
const
int
&time) {
12
const
bool
&val =
conditionSIN
(time);
13
ret = (val !=
lastVal_
);
14
bool
up = (!
lastVal_
&& val);
15
if
(up) {
16
timeSinceUp_
= 0;
17
}
else
if
(val) {
18
++
timeSinceUp_
;
19
}
20
// If repetition is activated, trigger again after given number of iterations
21
bool
trigger = up || (
repeatAfterNIterations_
> 0 &&
22
timeSinceUp_
>=
repeatAfterNIterations_
);
23
if
(ret) {
24
lastVal_
= val;
25
}
26
if
(trigger) {
27
for
(Triggers_t::const_iterator _s =
triggers
.begin(); _s !=
triggers
.end();
28
++_s)
29
(*_s)->recompute(time);
30
timeSinceUp_ = 0;
31
}
32
return
ret;
33
}
34
35
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
(
Event
,
"Event"
);
36
}
// namespace sot
37
}
// namespace dynamicgraph
event.hh
dynamicgraph::sot::DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(FeaturePosture, "FeaturePosture")
dynamicgraph::sot::Event::timeSinceUp_
int timeSinceUp_
Definition:
event.hh:121
dynamicgraph::sot::Event::triggers
Triggers_t triggers
Definition:
event.hh:117
dynamicgraph::sot::Event
Definition:
event.hh:44
dynamicgraph::sot::Event::repeatAfterNIterations_
int repeatAfterNIterations_
Definition:
event.hh:121
dynamicgraph::sot::Event::conditionSIN
SignalPtr< bool, int > conditionSIN
Definition:
event.hh:118
dynamicgraph::sot::Event::lastVal_
bool lastVal_
Definition:
event.hh:120
dynamicgraph::sot::Event::check
bool & check(bool &ret, const int &time)
Definition:
event.cpp:11
dynamicgraph
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26