YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeDepthCamera_mini_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025-2025 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
8
9#include <yarp/os/Network.h>
10#include <yarp/sig/Image.h>
11#include <yarp/sig/Vector.h>
12#include <yarp/dev/PolyDriver.h>
13#include <yarp/os/Time.h>
14
15#include <array>
16#include <string>
17
19#include <catch2/catch_amalgamated.hpp>
20#include <harness.h>
21
22using namespace yarp::os;
23using namespace yarp::dev;
24using namespace yarp::sig;
25
26
27TEST_CASE("dev::fakeDepthCamera_miniTest", "[yarp::dev]")
28{
29 YARP_REQUIRE_PLUGIN("fakeDepthCamera_mini", "device");
30
31 Network::setLocalMode(true);
32
33 SECTION("Test the IFrameGrabberImage interface")
34 {
35 // Open the device
36 PolyDriver dd;
37 Property p;
38 p.put("device", "fakeDepthCamera_mini");
39 // small values to improve valgrind speed
40 p.put("rgb_w", 32);
41 p.put("rgb_h", 24);
42 p.put("dep_w", 32);
43 p.put("dep_h", 24);
44 REQUIRE(dd.open(p));
46
47 // Get the IFrameGrabberImage interface
48 IRGBDSensor* irgbd = nullptr;
49 REQUIRE(dd.view(irgbd));
50
52
53 // Close the device
54 CHECK(dd.close());
55 }
56
57 Network::setLocalMode(false);
58}
contains the definition of a Vector type
bool view(T *&x)
Get an interface to the device driver.
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::fakeDepthCamera_miniTest", "[yarp::dev]")
void exec_params_test(yarp::dev::PolyDriver *pdrv)
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.