YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeFrameGrabber_RGBVisualParams.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include "FakeFrameGrabber.h"
8
10#include <yarp/os/LogStream.h>
11#include <yarp/sig/ImageDraw.h>
12
13#include <cstdio>
14#include <thread>
15#include <random>
16
17using namespace yarp::os;
18using namespace yarp::dev;
19using namespace yarp::sig;
20using namespace yarp::sig::draw;
21
22//namespace {
23//YARP_LOG_COMPONENT(FAKEFRAMEGRABBER, "yarp.device.fakeFrameGrabber")
24//}
25
27{
28 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
29 return m_height;
30}
31
33{
34 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
35 return m_width;
36}
37
38ReturnValue FakeFrameGrabber::getRgbSupportedConfigurations(std::vector<CameraConfig> &configurations)
39{
40 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
41 configurations=this->configurations;
42 return ReturnValue_ok;
43}
44
46{
47 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
50 return ReturnValue_ok;
51}
52
54{
55 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
58 return ReturnValue_ok;
59}
60
61ReturnValue FakeFrameGrabber::getRgbFOV(double &horizontalFov, double &verticalFov)
62{
63 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
64 horizontalFov=this->m_horizontalFov;
65 verticalFov=this->m_verticalFov;
66 return ReturnValue_ok;
67}
68
69ReturnValue FakeFrameGrabber::setRgbFOV(double horizontalFov, double verticalFov)
70{
71 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
72 this->m_horizontalFov=horizontalFov;
73 this->m_verticalFov=verticalFov;
74 return ReturnValue_ok;
75}
76
78{
79 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
80 intrinsic=this->m_intrinsic;
81 return ReturnValue_ok;
82}
83
85{
86 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
87 mirror=this->m_mirror;
88 return ReturnValue_ok;
89}
90
92{
93 std::lock_guard<std::mutex> lock(rpc_methods_mutex);
94 this->m_mirror =mirror;
95 return ReturnValue_ok;
96}
#define ReturnValue_ok
Definition ReturnValue.h:80
int width() const override
Return the width of each frame.
yarp::dev::ReturnValue getRgbFOV(double &horizontalFov, double &verticalFov) override
Get the field of view (FOV) of the rgb camera.
yarp::dev::ReturnValue getRgbIntrinsicParam(yarp::os::Property &intrinsic) override
Get the intrinsic parameters of the rgb camera.
int getRgbWidth() override
Return the width of each frame.
yarp::dev::ReturnValue setRgbResolution(int width, int height) override
Set the resolution of the rgb image from the camera.
int getRgbHeight() override
Return the height of each frame.
yarp::dev::ReturnValue getRgbSupportedConfigurations(std::vector< yarp::dev::CameraConfig > &configurations) override
Get the possible configurations of the camera.
yarp::dev::ReturnValue getRgbResolution(int &width, int &height) override
Get the resolution of the rgb image from the camera.
yarp::dev::ReturnValue getRgbMirroring(bool &mirror) override
Get the mirroring setting of the sensor.
int height() const override
Return the height of each frame.
yarp::dev::ReturnValue setRgbFOV(double horizontalFov, double verticalFov) override
Set the field of view (FOV) of the rgb camera.
yarp::dev::ReturnValue setRgbMirroring(bool mirror) override
Set the mirroring setting of the sensor.
A class for storing options and configuration information.
Definition Property.h:33
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.