icub-client
utils.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 WYSIWYD Consortium, European Commission FP7 Project ICT-612139
3  * Authors: Ugo Pattacini, Tobias Fischer
4  * email: ugo.pattacini@iit.it, t.fischer@imperial.ac.uk
5  * Permission is granted to copy, distribute, and/or modify this program
6  * under the terms of the GNU General Public License, version 2 or any
7  * later version published by the Free Software Foundation.
8  *
9  * A copy of the license can be found at
10  * icub-client/license/gpl.txt
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15  * Public License for more details
16 */
17 
18 #include <yarp/os/Time.h>
19 
20 #include "utils.h"
21 #include "module.h"
22 
23 
24 /**********************************************************/
26 {
27  bridge=nullptr;
28 }
29 
30 
31 /**********************************************************/
33 {
34  this->bridge=bridge;
35 }
36 
37 
38 /**********************************************************/
40 {
41  return ((bridge!=nullptr) && (getRate()!=0.0));
42 }
43 
44 
45 /**********************************************************/
47 {
49 }
50 
51 
52 /**********************************************************/
53 OpcUpdater::OpcUpdater() : RateThread(100)
54 {
55  bridge=nullptr;
56 }
57 
58 
59 /**********************************************************/
61 {
62  this->bridge=bridge;
63 }
64 
65 
66 /**********************************************************/
68 {
69  return ((bridge!=nullptr) && (getRate()!=0.0));
70 }
71 
72 
73 /**********************************************************/
75 {
76  bridge->updateOPC();
77 }
78 
79 
80 /**********************************************************/
82 {
83  bridge=nullptr;
84 }
85 
86 
87 /**********************************************************/
89 {
90  this->bridge=bridge;
91 }
92 
93 
94 /**********************************************************/
95 void ClassifierReporter::report(const PortInfo &info)
96 {
97  if ((bridge!=nullptr) && info.created && !info.incoming)
98  {
100  {
101  yInfo("Connected to the classifier");
103  }
104  }
105 }
106 
void run()
Definition: utils.cpp:46
void run()
Definition: utils.cpp:74
void setBridge(IOL2OPCBridge *bridge)
Definition: utils.cpp:32
void report(const PortInfo &info)
Definition: utils.cpp:95
bool threadInit()
Definition: utils.cpp:67
bool threadInit()
Definition: utils.cpp:39
void updateOPC()
updateOPC The whole procedure to update OPC, including naming known and unknown objects, drawing bounding boxes around objects
Definition: module.cpp:808
void setBridge(IOL2OPCBridge *bridge)
Definition: utils.cpp:88
OpcUpdater()
Definition: utils.cpp:53
RtLocalization()
Definition: utils.cpp:25
void doLocalization()
doLocalization The whole procedure to classify objects, from getting image to draw bounding boxes arr...
Definition: module.cpp:757
IOL2OPCBridge * bridge
Definition: utils.h:54
Bridge::State state
Definition: module.h:276
void setBridge(IOL2OPCBridge *bridge)
Definition: utils.cpp:60
IOL2OPCBridge * bridge
Definition: utils.h:39