Loading [MathJax]/extensions/tex2jax.js
iCub-main
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace 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
y
z
Functions
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
u
v
w
y
Variables
a
b
c
d
e
h
i
j
l
m
n
p
r
s
t
w
z
Typedefs
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
q
r
s
t
u
v
w
Classes
Class List
Class Index
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
y
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
y
z
~
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
y
z
Typedefs
Enumerations
a
b
c
e
g
i
l
n
p
r
s
t
u
Enumerator
a
b
c
d
e
f
g
i
l
m
p
r
s
t
u
Properties
Related Symbols
a
b
c
g
i
l
o
q
r
s
t
w
Files
File List
File 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
y
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
x
y
z
Typedefs
Enumerations
Enumerator
_
a
c
d
e
g
j
m
n
p
s
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
icub-main
src
libraries
icubmod
embObjLib
tools
statExt.h
Go to the documentation of this file.
1
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3
/* Copyright (C) 2012 iCub Facility, Istituto Italiano di Tecnologia
4
* Author: Valentina Gaggero
5
* email: valentina.gaggero@iit.it
6
* Permission is granted to copy, distribute, and/or modify this program
7
* under the terms of the GNU General Public License, version 2 or any
8
* later version published by the Free Software Foundation.
9
*
10
* A copy of the license can be found at
11
* http://www.robotcub.org/icub/license/gpl.txt
12
*
13
* This program is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
16
* Public License for more details
17
*/
18
19
20
#ifndef __statExt__
21
#define __statExt__
22
23
// System includes
24
#include <yarp/os/Ping.h>
25
#include <float.h>
26
27
28
29
//this class contains all info about pkts received from pc104
30
class
StatExt
:
public
yarp::os::Stat
31
{
32
private
:
33
double
min;
34
double
max;
35
public
:
36
37
StatExt
() {
38
clear
();
39
}
37
StatExt
() {
…
}
40
41
void
clear
() {
42
min = DBL_MAX;
43
max = 0;
44
yarp::os::Stat::clear();
45
}
41
void
clear
() {
…
}
46
47
void
add
(
double
val) {
48
if
(val < min)
49
min = val;
50
51
if
(val > max)
52
max = val;
53
54
yarp::os::Stat::add(val);
55
}
47
void
add
(
double
val) {
…
}
56
57
bool
addAndCheckLimits
(
double
val) {
58
bool
updatedLimits=
false
;
59
if
(val < min)
60
{
61
min = val;
62
updatedLimits=
true
;
63
}
64
65
if
(val > max)
66
{
67
max = val;
68
updatedLimits=
true
;
69
}
70
71
yarp::os::Stat::add(val);
72
return
updatedLimits;
73
}
57
bool
addAndCheckLimits
(
double
val) {
…
}
74
75
// void add(const StatExt& alt) {
76
//
77
// if( alt.min < min)
78
// min = alt.min;
79
//
80
// if(alt.max > max)
81
// max = alt.max;
82
//
83
// Stat::add((Stat*)alt);
84
// }
85
86
87
88
// double mean();
89
//
90
// double deviation();
91
//
92
// double count();
93
94
95
using
yarp::os::Stat::mean;
96
using
yarp::os::Stat::deviation;
97
using
yarp::os::Stat::count;
98
99
100
101
double
getMin
(
void
){
102
return
min;
103
}
101
double
getMin
(
void
) {
…
}
104
105
106
double
getMax
(
void
){
107
return
max;
108
}
106
double
getMax
(
void
) {
…
}
109
};
30
class
StatExt
:
public
yarp::os::Stat {
…
};
110
111
112
113
114
115
#endif
116
117
// eof
118
119
StatExt
Definition
statExt.h:31
StatExt::clear
void clear()
Definition
statExt.h:41
StatExt::add
void add(double val)
Definition
statExt.h:47
StatExt::getMax
double getMax(void)
Definition
statExt.h:106
StatExt::getMin
double getMin(void)
Definition
statExt.h:101
StatExt::StatExt
StatExt()
Definition
statExt.h:37
StatExt::addAndCheckLimits
bool addAndCheckLimits(double val)
Definition
statExt.h:57
Generated on Tue May 6 2025 15:42:05 for iCub-main by
1.9.8