YARP
Yet Another Robot Platform
IVisualParamsImpl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_IVISUALPARAMSIMPL_H
10 #define YARP_DEV_IVISUALPARAMSIMPL_H
11 
12 #include <yarp/dev/api.h>
13 #include <yarp/os/Port.h>
14 #include <yarp/os/Bottle.h>
15 #include <yarp/dev/DeviceDriver.h>
16 #include <yarp/dev/IVisualParams.h>
17 
18 // use namespace impl??
19 namespace yarp {
20  namespace dev {
21  class Implement_RgbVisualParams_Parser;
22  class Implement_RgbVisualParams_Sender;
23  class Implement_DepthVisualParams_Parser;
24  class Implement_DepthVisualParams_Sender;
25  }
26 }
27 
28 //
29 // RGB helpers
30 //
32 {
33 protected:
35 
36 public:
39 
40  int getRgbHeight() override;
41  int getRgbWidth() override;
43  bool getRgbResolution(int &width, int &height) override;
44  bool setRgbResolution(int width, int height) override;
45  bool getRgbFOV(double &horizontalFov, double &verticalFov) override;
46  bool setRgbFOV(double horizontalFov, double verticalFov) override;
47  bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override;
48  bool getRgbMirroring(bool &mirror) override;
49  bool setRgbMirroring(bool mirror) override;
50 };
51 
52 
54 {
55 private:
56  IRgbVisualParams *iRgbVisual;
57 
58 public:
61 
62  bool configure(IRgbVisualParams *interface);
63  bool respond(const yarp::os::Bottle& cmd, yarp::os::Bottle& response) override;
64 };
65 
66 
67 //
68 // Depth helpers
69 //
71 {
72 private:
73  yarp::os::Port & _port;
74 
75 public:
78 
79  int getDepthHeight() override;
80  int getDepthWidth() override;
81  bool setDepthResolution(int width, int height) override;
82  bool getDepthFOV(double &horizontalFov, double &verticalFov) override;
83  bool setDepthFOV(double horizontalFov, double verticalFov) override;
84  double getDepthAccuracy() override;
85  bool setDepthAccuracy(double accuracy) override;
86  bool getDepthClipPlanes(double &nearPlane, double &farPlane) override;
87  bool setDepthClipPlanes(double nearPlane, double farPlane) override;
88  bool getDepthIntrinsicParam(yarp::os::Property &intrinsic) override;
89  bool getDepthMirroring(bool &mirror) override;
90  bool setDepthMirroring(bool mirror) override;
91 };
92 
93 
95 {
96 private:
97  IDepthVisualParams *iDepthVisual;
98 
99 public:
102 
103  bool configure(IDepthVisualParams *interface);
104  bool respond(const yarp::os::Bottle& cmd, yarp::os::Bottle& response) override;
105 };
106 
107 #endif // YARP_DEV_IVISUALPARAMSIMPL_H
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
yarp::dev::Implement_RgbVisualParams_Sender::Implement_RgbVisualParams_Sender
Implement_RgbVisualParams_Sender(yarp::os::Port &port)
Definition: IVisualParamsImpl.cpp:22
yarp::dev::Implement_RgbVisualParams_Sender::setRgbMirroring
bool setRgbMirroring(bool mirror) override
Set the mirroring setting of the sensor.
Definition: IVisualParamsImpl.cpp:169
yarp::dev::IDepthVisualParams::getDepthClipPlanes
virtual bool getDepthClipPlanes(double &nearPlane, double &farPlane)=0
Get the clipping planes of the sensor.
yarp::dev::Implement_DepthVisualParams_Sender::~Implement_DepthVisualParams_Sender
virtual ~Implement_DepthVisualParams_Sender()
Definition: IVisualParamsImpl.h:77
Port.h
yarp::dev::IDepthVisualParams::getDepthMirroring
virtual bool getDepthMirroring(bool &mirror)=0
Get the mirroring setting of the sensor.
yarp::dev::IDepthVisualParams::getDepthFOV
virtual bool getDepthFOV(double &horizontalFov, double &verticalFov)=0
Get the field of view (FOV) of the depth camera.
yarp::dev::Implement_RgbVisualParams_Sender::setRgbFOV
bool setRgbFOV(double horizontalFov, double verticalFov) override
Set the field of view (FOV) of the rgb camera.
Definition: IVisualParamsImpl.cpp:116
yarp::dev::Implement_DepthVisualParams_Sender
Definition: IVisualParamsImpl.h:71
yarp::dev::IDepthVisualParams::setDepthClipPlanes
virtual bool setDepthClipPlanes(double nearPlane, double farPlane)=0
Set the clipping planes of the sensor.
yarp::dev::Implement_RgbVisualParams_Sender::getRgbHeight
int getRgbHeight() override
Return the height of each frame.
Definition: IVisualParamsImpl.cpp:24
yarp::sig::VectorOf
Provides:
Definition: Vector.h:122
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
yarp::dev::Implement_RgbVisualParams_Parser::respond
bool respond(const yarp::os::Bottle &cmd, yarp::os::Bottle &response) override
Respond to a message.
Definition: IVisualParamsImpl.cpp:201
yarp::dev::Implement_RgbVisualParams_Sender
Definition: IVisualParamsImpl.h:32
yarp::dev::Implement_RgbVisualParams_Sender::~Implement_RgbVisualParams_Sender
virtual ~Implement_RgbVisualParams_Sender()
Definition: IVisualParamsImpl.h:38
yarp::dev::IDepthVisualParams::getDepthHeight
virtual int getDepthHeight()=0
Return the height of each frame.
yarp::dev::Implement_RgbVisualParams_Sender::getRgbIntrinsicParam
bool getRgbIntrinsicParam(yarp::os::Property &intrinsic) override
Get the intrinsic parameters of the rgb camera.
Definition: IVisualParamsImpl.cpp:128
yarp::dev::IDepthVisualParams::getDepthIntrinsicParam
virtual bool getDepthIntrinsicParam(yarp::os::Property &intrinsic)=0
Get the intrinsic parameters of the depth camera.
yarp::dev::Implement_RgbVisualParams_Parser::~Implement_RgbVisualParams_Parser
virtual ~Implement_RgbVisualParams_Parser()
Definition: IVisualParamsImpl.h:60
yarp::dev::Implement_RgbVisualParams_Sender::_port
yarp::os::Port & _port
Definition: IVisualParamsImpl.h:34
yarp::dev::Implement_DepthVisualParams_Parser::Implement_DepthVisualParams_Parser
Implement_DepthVisualParams_Parser()
Definition: IVisualParamsImpl.cpp:563
yarp::dev::Implement_RgbVisualParams_Sender::setRgbResolution
bool setRgbResolution(int width, int height) override
Set the resolution of the rgb image from the camera.
Definition: IVisualParamsImpl.cpp:84
yarp::dev::IDepthVisualParams::setDepthResolution
virtual bool setDepthResolution(int width, int height)=0
Set the resolution of the depth image from the camera.
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::Implement_RgbVisualParams_Parser
Definition: IVisualParamsImpl.h:54
yarp::dev::Implement_RgbVisualParams_Parser::configure
bool configure(IRgbVisualParams *interface)
Definition: IVisualParamsImpl.cpp:185
yarp::dev::Implement_RgbVisualParams_Sender::getRgbSupportedConfigurations
bool getRgbSupportedConfigurations(yarp::sig::VectorOf< CameraConfig > &configurations) override
Get the possible configurations of the camera.
Definition: IVisualParamsImpl.cpp:43
yarp::dev::IDepthVisualParams::setDepthFOV
virtual bool setDepthFOV(double horizontalFov, double verticalFov)=0
Set the field of view (FOV) of the depth camera.
yarp::dev::DeviceResponder
A cheap and cheerful framework for human readable/writable forms of messages to devices.
Definition: DeviceDriver.h:134
yarp::dev::Implement_RgbVisualParams_Sender::getRgbFOV
bool getRgbFOV(double &horizontalFov, double &verticalFov) override
Get the field of view (FOV) of the rgb camera.
Definition: IVisualParamsImpl.cpp:96
yarp::dev::Implement_RgbVisualParams_Sender::getRgbResolution
bool getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
Definition: IVisualParamsImpl.cpp:64
yarp::dev::IRgbVisualParams
An interface for retrieving intrinsic parameter from a rgb camera.
Definition: IVisualParams.h:73
yarp::dev::IDepthVisualParams::getDepthAccuracy
virtual double getDepthAccuracy()=0
Get the minimum detectable variation in distance [meter].
yarp::dev::Implement_RgbVisualParams_Parser::Implement_RgbVisualParams_Parser
Implement_RgbVisualParams_Parser()
Definition: IVisualParamsImpl.cpp:181
yarp::dev::IDepthVisualParams::setDepthMirroring
virtual bool setDepthMirroring(bool mirror)=0
Set the mirroring setting of the sensor.
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::Implement_RgbVisualParams_Sender::getRgbMirroring
bool getRgbMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
Definition: IVisualParamsImpl.cpp:154
yarp::dev::Implement_RgbVisualParams_Sender::getRgbWidth
int getRgbWidth() override
Return the width of each frame.
Definition: IVisualParamsImpl.cpp:34
yarp::dev::Implement_DepthVisualParams_Parser::respond
bool respond(const yarp::os::Bottle &cmd, yarp::os::Bottle &response) override
Respond to a message.
Definition: IVisualParamsImpl.cpp:582
IVisualParams.h
yarp::dev::IDepthVisualParams
An interface for retrieving intrinsic parameter from a depth camera.
Definition: IVisualParams.h:183
api.h
yarp::dev::Implement_DepthVisualParams_Parser
Definition: IVisualParamsImpl.h:95
yarp::dev::IDepthVisualParams::setDepthAccuracy
virtual bool setDepthAccuracy(double accuracy)=0
Set the minimum detectable variation in distance [meter] when possible.
Bottle.h
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37
yarp::dev::Implement_DepthVisualParams_Sender::Implement_DepthVisualParams_Sender
Implement_DepthVisualParams_Sender(os::Port &port)
Definition: IVisualParamsImpl.cpp:397
DeviceDriver.h
yarp::dev::IDepthVisualParams::getDepthWidth
virtual int getDepthWidth()=0
Return the height of each frame.
yarp::dev::Implement_DepthVisualParams_Parser::~Implement_DepthVisualParams_Parser
virtual ~Implement_DepthVisualParams_Parser()
Definition: IVisualParamsImpl.h:101
yarp::dev::Implement_DepthVisualParams_Parser::configure
bool configure(IDepthVisualParams *interface)
Definition: IVisualParamsImpl.cpp:566