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
learningMachine
src
Prediction.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2007-2011 RobotCub Consortium, European Commission FP6 Project IST-004370
3
* author: Arjan Gijsberts
4
* email: arjan.gijsberts@iit.it
5
* website: www.robotcub.org
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
#include <cassert>
20
21
//#include "iCub/learningMachine/Prediction.h"
22
23
namespace
iCub
{
24
namespace
learningmachine {
25
// whole implementation is moved to header
26
// move back here in case of problems
27
/*
28
void Prediction::setVariance(const yarp::sig::Vector& variance) {
29
assert(prediction.size() == variance.size() || variance.size() == 0);
30
this->variance = variance;
31
this->varianceSet = (variance.size() > 0);
32
}
33
34
std::string Prediction::toString() {
35
std::string out = this->prediction.toString().c_str();
36
if(this->hasVariance()) {
37
out += std::string(" +/- ") + this->variance.toString().c_str();
38
}
39
return out;
40
}
41
42
bool Prediction::write(yarp::os::ConnectionWriter& connection) {
43
// follows PortablePair implementation
44
connection.appendInt32(BOTTLE_TAG_LIST);
45
connection.appendInt32(2);
46
47
bool ok = this->prediction.write(connection);
48
if (ok) {
49
ok = this->variance.write(connection);
50
}
51
52
if (ok) {
53
connection.convertTextMode();
54
}
55
56
return ok;
57
}
58
59
bool Prediction::read(yarp::os::ConnectionReader& connection) {
60
// follows PortablePair implementation
61
connection.convertTextMode();
62
63
int header = connection.expectInt32();
64
if(header != BOTTLE_TAG_LIST) {
65
return false;
66
}
67
68
int len = connection.expectInt32();
69
if(len != 2) {
70
return false;
71
}
72
73
bool ok = this->prediction.read(connection);
74
if (ok) {
75
ok = this->variance.read(connection);
76
}
77
this->varianceSet = (this->variance.size() > 0);
78
return ok;
79
}
80
81
void Prediction::onCompletion() {
82
this->prediction.onCompletion();
83
this->variance.onCompletion();
84
}
85
*/
86
87
}
// learningmachine
88
}
// iCub
iCub
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.
Definition
emotionInterface.h:17
Generated on Tue May 6 2025 15:42:05 for iCub-main by
1.9.8