YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
RGBDSensor_nws_yarp_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
6#include <yarp/os/Network.h>
11
12#include <catch2/catch_amalgamated.hpp>
13#include <harness.h>
14
15using namespace yarp::dev;
16using namespace yarp::sig;
17using namespace yarp::os;
18
19TEST_CASE("dev::RGBDSensor_nws_yarpTest", "[yarp::dev]")
20{
21 YARP_REQUIRE_PLUGIN("fakeDepthCamera", "device");
22 YARP_REQUIRE_PLUGIN("RGBDSensor_nws_yarp", "device");
23
24 Network::setLocalMode(true);
25
26 SECTION("Checking RGBDSensor_nws_yarp device")
27 {
29
31 {
33 nws_cfg.put("device", "RGBDSensor_nws_yarp");
34 nws_cfg.put("name", "/rgbd_nws");
36 }
37
38 //Close all polydrivers and check
40 }
41
42 SECTION("Test the RGBDSensor_nws_yarp device with fakeDepthCamera device attached")
43 {
44 std::vector<std::string> fakeSens;
45 fakeSens.push_back("fakeDepthCamera");
46 fakeSens.push_back("fakeDepthCamera_mini");
47
48 for (auto it = fakeSens.begin(); it != fakeSens.end(); it++)
49 {
54
55 // open
56 p_nws.put("device", "RGBDSensor_nws_yarp");
57 p_nws.put("name", "/rgbd_nws");
58 p_fake.put("device", *it);
59 // small values to improve valgrind speed
60 p_fake.put("rgb_w", 32);
61 p_fake.put("rgb_h", 24);
62 p_fake.put("dep_w", 32);
63 p_fake.put("dep_h", 24);
66
68
69 // attach
70 {
72 dd_nws.view(ww_nws);
74 bool result_att = ww_nws->attach(&dd_fake);
76 }
77
78 // Wait some time
80
81 // Close all polydrivers and check
82 {
85 }
86 }
87 }
88
89 Network::setLocalMode(false);
90}
TEST_CASE("dev::RGBDSensor_nws_yarpTest", "[yarp::dev]")
A container for a device driver.
Definition PolyDriver.h:23
Helper interface for an object that can wrap/or "attach" to a single other device.
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A class for storing options and configuration information.
Definition Property.h:33
static void delaySystem(double seconds)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.