yarp-devices
Loading...
Searching...
No Matches
AravisGigE.hpp
1#ifndef __ARAVIS_GIGE_HPP__
2#define __ARAVIS_GIGE_HPP__
3
4#include <map>
5
6#include <yarp/dev/DeviceDriver.h>
7#include <yarp/dev/IFrameGrabberControls.h>
8#include <yarp/dev/IFrameGrabberImage.h>
9
10#include <arv.h>
11
12
23class AravisGigE : public yarp::dev::DeviceDriver,
24 public yarp::dev::IFrameGrabberImageRaw,
25 public yarp::dev::IFrameGrabberControls
26{
27public:
28
29 // --------- DeviceDriver Declarations. Implementation in DeviceDriverImpl.cpp ---------
30 bool open(yarp::os::Searchable& config) override;
31 bool close() override;
32
33 // --------- IFrameGrabberImageRaw Declarations. Implementation in IFrameGrabberImageRawImpl.cpp ---------
34 bool getImage(yarp::sig::ImageOf<yarp::sig::PixelMono>& image) override;
35 int height() const override;
36 int width() const override;
37
38 // ---------- IFrameGrabberControls Declarations. Implementation in IFrameGrabberControlsImpl.cpp ---------
39 bool getCameraDescription(CameraDescriptor *camera) override;
40 bool hasFeature(int feature, bool *hasFeature) override;
41 bool setFeature(int feature, double value) override;
42 bool getFeature(int feature, double *value) override;
43 bool setFeature(int feature, double value1, double value2) override;
44 bool getFeature(int feature, double *value1, double *value2) override;
45 bool hasOnOff(int feature, bool *HasOnOff) override;
46 bool setActive(int feature, bool onoff) override;
47 bool getActive(int feature, bool *isActive) override;
48 bool hasAuto(int feature, bool *hasAuto) override;
49 bool hasManual(int feature, bool *hasManual) override;
50 bool hasOnePush(int feature, bool *hasOnePush) override;
51 bool setMode(int feature, FeatureMode mode) override;
52 bool getMode(int feature, FeatureMode *mode) override;
53 bool setOnePush(int feature) override;
54
55private:
56 ArvCamera *camera; // Camera to control.
57 ArvStream *stream; // Object for video stream reception.
58 void *framebuffer; //
59
60 unsigned int payload; // Width x height x Pixel width.
61
62 int widthMin; // Camera sensor minium width.
63 int widthMax; // Camera sensor maximum width.
64 int heightMin; // Camera sensor minium height.
65 int heightMax; // Camera sensor maximum height.
66 bool fpsAvailable;
67 double fpsMin; // Camera minium fps.
68 double fpsMax; // Camera maximum fps.
69 bool gainAvailable;
70 double gainMin; // Camera minimum gain.
71 double gainMax; // Camera maximum gain.
72 bool exposureAvailable;
73 double exposureMin; // Camera's minimum exposure time.
74 double exposureMax; // Camera's maximum exposure time.
75
76 bool controlExposure; // Flag if automatic exposure shall be done by this SW
77 bool autoGain;
78 double targetGrey; // Target grey value (mid grey))
79
80 gint64 *pixelFormats;
81 guint pixelFormatsCnt;
82
83
84 int num_buffers; // number of payload transmission buffers
85
86 ArvPixelFormat pixelFormat; // pixel format
87
88 int xoffset; // current frame region x offset
89 int yoffset; // current frame region y offset
90 int _width; // current frame width of frame
91 int _height; // current frame height of image
92
93 double fps; // current value of fps
94 double exposure; // current value of exposure time
95 double gain; // current value of gain
96 double midGrey; // current value of mid grey (brightness)
97
98 unsigned frameID; // current frame id
99 unsigned prevFrameID;
100
101 //-- Lens Controls
102 bool zoomAvailable;
103 gint64 zoomMin; // Camera zoom minimum value
104 gint64 zoomMax; // Camera zoom maximum value
105 bool focusAvailable;
106 gint64 focusMin; // Camera focus minimum value
107 gint64 focusMax; // Camera focus maximum value
108 bool irisAvailable;
109 gint64 irisMin; // Camera iris minimum value
110 gint64 irisMax; // Camera iris maximum value
111
112 //-- IFrameGrabberControls2
113 std::map<cameraFeature_id_t, const char*> yarp_arv_int_feature_map; //-- Map yarp features with aravis feature ids
114 std::map<cameraFeature_id_t, const char*> yarp_arv_float_feat_map;
115};
116
117#endif // __ARAVIS_GIGE_HPP__
Implementation for GigE cameras using Aravis as driver.
Definition AravisGigE.hpp:26