karma
All Modules
utils.h
1 /*
2  * Copyright (C) 2011 Department of Robotics Brain and Cognitive Sciences - Istituto Italiano di Tecnologia
3  * Author: Vadim Tikhanoff Ugo Pattacini
4  * email: vadim.tikhanoff@iit.it
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  * http://www.robotcub.org/icub/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 #ifndef __UTILS_H__
19 #define __UTILS_H__
20 
21 #include <string>
22 
23 #include <yarp/os/Bottle.h>
24 #include <yarp/os/BufferedPort.h>
25 #include <yarp/os/PeriodicThread.h>
26 #include <yarp/os/PortReport.h>
27 
28 #include <opencv2/opencv.hpp>
29 
30 class Manager; //forward declaration
31 
32 /**********************************************************/
33 class ParticleFilter : public yarp::os::BufferedPort<yarp::os::Bottle>
34 {
35 protected:
36  cv::Point loc;
37  void onRead(yarp::os::Bottle &b);
38 public:
39  ParticleFilter();
40  bool getTraker(cv::Point &loc);
41 };
42 /**********************************************************/
43 class SegmentationPoint : public yarp::os::Port
44 {
45 public:
46  void segment(yarp::os::Bottle &b);
47 };
48 /**********************************************************/
49 class PointedLocation : public yarp::os::BufferedPort<yarp::os::Bottle>
50 {
51 protected:
52  cv::Point loc;
53  double rxTime;
54  double timeout;
55 
56  void onRead(yarp::os::Bottle &b);
57 
58 public:
59  PointedLocation();
60  bool getLoc(cv::Point &loc);
61 };
62 
63 #endif