openrave-yarp-plugins
Loading...
Searching...
No Matches
YarpOpenraveGrabber.hpp
1// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3#ifndef __YARP_OPENRAVE_GRABBER_HPP__
4#define __YARP_OPENRAVE_GRABBER_HPP__
5
6#include <yarp/dev/DeviceDriver.h>
7
8#include <yarp/dev/IFrameGrabberImage.h>
9#include <yarp/dev/IFrameGrabberControls.h>
10
11#include <yarp/dev/IFrameGrabberImage.h>
12#include <yarp/dev/IFrameGrabberControls.h>
13#include <yarp/dev/IRgbVisualParams.h>
14
15#include <openrave/openrave.h>
16
17#include <boost/smart_ptr/shared_ptr.hpp>
18
19#include "YarpOpenraveBase.hpp"
20
21namespace roboticslab
22{
23
37 public yarp::dev::DeviceDriver,
38 public yarp::dev::IFrameGrabberControls,
39 public yarp::dev::IFrameGrabberImage,
40 public yarp::dev::IRgbVisualParams
41{
42public:
43 // ------- DeviceDriver declarations. Implementation in DeviceDriverImageImpl.cpp -------
44 bool open(yarp::os::Searchable& config) override;
45 bool close() override;
46
47 // ------- IFrameGrabberControls declarations. Implementation in IFrameGrabberControlsImpl.cpp -------
48 bool getCameraDescription(CameraDescriptor *camera) override;
49 bool hasFeature(int feature, bool *hasFeature) override;
50 bool setFeature(int feature, double value) override;
51 bool getFeature(int feature, double *value) override;
52 bool setFeature(int feature, double value1, double value2) override;
53 bool getFeature(int feature, double *value1, double *value2) override;
54 bool hasOnOff(int feature, bool *HasOnOff) override;
55 bool setActive(int feature, bool onoff) override;
56 bool getActive(int feature, bool *isActive) override;
57 bool hasAuto(int feature, bool *hasAuto) override;
58 bool hasManual(int feature, bool *hasManual) override;
59 bool hasOnePush(int feature, bool *hasOnePush) override;
60 bool setMode(int feature, FeatureMode mode) override;
61 bool getMode(int feature, FeatureMode *mode) override;
62 bool setOnePush(int feature) override;
63
64 // ------- IFrameGrabberImage declarations. Implementation in IFrameGrabberImageImpl.cpp -------
65 bool getImage(yarp::sig::ImageOf<yarp::sig::PixelRgb>& image) override;
66 int height() const override;
67 int width() const override;
68
69 // ------- IRgbVisualParams declarations. Look at IVisualParams.h for documentation. Implementation in IFrameGrabberImageImpl.cpp -------
70 int getRgbHeight() override;
71 int getRgbWidth() override;
72 bool getRgbSupportedConfigurations(yarp::sig::VectorOf<yarp::dev::CameraConfig> &configurations) override { return true; }
73 bool getRgbResolution(int &width, int &height) override { return true; }
74 bool setRgbResolution(int width, int height) override { return true; }
75 bool getRgbFOV(double &horizontalFov, double &verticalFov) override { return true; }
76 bool setRgbFOV(double horizontalFov, double verticalFov) override { return true; }
77 bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override { return true; }
78 bool getRgbMirroring(bool &mirror) override { return true; }
79 bool setRgbMirroring(bool mirror) override { return true; }
80
81private:
82 // General Grabber parameters
83 int _height, _width;
84
85 // OpenRAVE
86 OpenRAVE::SensorBasePtr sensorBasePtr;
87 boost::shared_ptr<OpenRAVE::SensorBase::CameraSensorData> sensorDataPtr;
88 boost::shared_ptr<OpenRAVE::SensorBase::CameraGeomData> modGeomDataPtr;
89
90 // YARP
91 CameraDescriptor cameraDescriptor;
92};
93
94} // namespace roboticslab
95
96#endif // __YARP_OPENRAVE_GRABBER_HPP__
Implements shared configuration functions.
Definition YarpOpenraveBase.hpp:32
Implements the YARP_dev IFrameGrabberImage, etc. interface class member functions.
Definition YarpOpenraveGrabber.hpp:41
The main, catch-all namespace for Robotics Lab UC3M.
Definition groups.dox:5