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
20#include <catch2/catch_amalgamated.hpp>
21#include <harness.h>
22
23using namespace yarp::os;
24using namespace yarp::dev;
25using namespace yarp::sig;
26
27
28TEST_CASE("dev::fakeDepthCameraTest", "[yarp::dev]")
29{
30 YARP_REQUIRE_PLUGIN("fakeDepthCamera", "device");
31
32 Network::setLocalMode(true);
33
34 SECTION("Test the IFrameGrabberImage interface")
35 {
36 // Open the device
37 PolyDriver dd;
38 Property p;
39 p.put("device", "fakeDepthCamera");
40 // small values to improve valgrind speed
41 p.put("rgb_w", 32);
42 p.put("rgb_h", 24);
43 p.put("dep_w", 32);
44 p.put("dep_h", 24);
45 REQUIRE(dd.open(p));
46
47 // Get the IFrameGrabberImage interface
48 IRGBDSensor* irgbd = nullptr;
49 REQUIRE(dd.view(irgbd));
50
51 IFrameGrabberControls* ictl = nullptr;
52 REQUIRE(dd.view(ictl));
53
56
57 // Close the device
58 CHECK(dd.close());
59 }
60
61 Network::setLocalMode(false);
62}
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:33
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Definition Property.cpp:987
TEST_CASE("dev::fakeDepthCameraTest", "[yarp::dev]")
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.