vision
RgbDetection.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __RGB_DETECTION_HPP__
4 #define __RGB_DETECTION_HPP__
5 
6 #include <yarp/os/Bottle.h>
7 #include <yarp/os/BufferedPort.h>
8 #include <yarp/os/RFModule.h>
9 
10 #include <yarp/dev/PolyDriver.h>
11 #include <yarp/dev/IFrameGrabberImage.h>
12 
13 #include <yarp/sig/Image.h>
14 
15 #include "IDetector.hpp"
16 #include "YarpCropCallback.hpp"
17 
18 namespace roboticslab
19 {
20 
25 class RgbDetection : public yarp::os::RFModule
26 {
27 public:
28  ~RgbDetection() override
29  { close(); }
30 
31  bool configure(yarp::os::ResourceFinder & rf) override;
32  double getPeriod() override;
33  bool updateModule() override;
34  bool interruptModule() override;
35  bool close() override;
36 
37 private:
38  yarp::dev::PolyDriver sensorDevice;
39  yarp::dev::IFrameGrabberImage * frameGrabber;
40 
41  yarp::dev::PolyDriver detectorDevice;
42  IDetector * iDetector;
43 
44  yarp::os::BufferedPort<yarp::os::Bottle> statePort;
45  yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb>> imagePort;
46 
47  yarp::os::BufferedPort<yarp::os::Bottle> cropPort;
48  YarpCropCallback cropCallback;
49 
50  double period;
51 };
52 
53 } // namespace roboticslab
54 
55 #endif // __RGB_DETECTION_HPP__
Interface for object detection.
Definition: IDetector.hpp:17
2D detection.
Definition: RgbDetection.hpp:26
Definition: YarpCropCallback.hpp:23
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:5