YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeDepthCamera_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
10
11#include <yarp/os/Network.h>
12#include <yarp/sig/Image.h>
13#include <yarp/sig/Vector.h>
14#include <yarp/dev/PolyDriver.h>
15#include <yarp/os/Time.h>
16
17#include <array>
18#include <string>
19
21#include <catch2/catch_amalgamated.hpp>
22#include <harness.h>
23
24using namespace yarp::os;
25using namespace yarp::dev;
26using namespace yarp::sig;
27
28
29TEST_CASE("dev::fakeDepthCameraTest", "[yarp::dev]")
30{
31 YARP_REQUIRE_PLUGIN("fakeDepthCamera", "device");
32
33 Network::setLocalMode(true);
34
35 SECTION("Test the IFrameGrabberImage interface")
36 {
37 // Open the device
38 PolyDriver dd;
39 Property p;
40 p.put("device", "fakeDepthCamera");
41 // small values to improve valgrind speed
42 p.put("rgb_w", 32);
43 p.put("rgb_h", 24);
44 p.put("dep_w", 32);
45 p.put("dep_h", 24);
46 REQUIRE(dd.open(p));
48
49 // Get the IFrameGrabberImage interface
50 IRGBDSensor* irgbd = nullptr;
51 REQUIRE(dd.view(irgbd));
52
53 IFrameGrabberControls* ictl = nullptr;
54 REQUIRE(dd.view(ictl));
55
58
59 // Close the device
60 CHECK(dd.close());
61 }
62
63 Network::setLocalMode(false);
64}
contains the definition of a Vector type
bool view(T *&x)
Get an interface to the device driver.
Control interface for frame grabber devices.
A generic interface for cameras that have both color camera as well as depth camera sensor,...
Definition IRGBDSensor.h:39
A container for a device driver.
Definition PolyDriver.h:23
bool close() override
Close the DeviceDriver.
bool open(const std::string &txt)
Construct and configure a device by its common name.
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
Definition Property.h:32
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Definition Property.cpp:980
TEST_CASE("dev::fakeDepthCameraTest", "[yarp::dev]")
void exec_params_test(yarp::dev::PolyDriver *pdrv)
void exec_IFrameGrabberControls_test_1(IFrameGrabberControls *ictl)
void exec_iRGBDSensor_test_1(IRGBDSensor *irgbd)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.