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
13#include <catch2/catch_amalgamated.hpp>
14#include <harness.h>
15
16using namespace yarp::dev;
17using namespace yarp::sig;
18using namespace yarp::os;
19
20TEST_CASE("dev::RGBDSensor_nws_yarpTest", "[yarp::dev]")
21{
22 YARP_REQUIRE_PLUGIN("fakeDepthCamera", "device");
23 YARP_REQUIRE_PLUGIN("RGBDSensor_nws_yarp", "device");
24
25 Network::setLocalMode(true);
26
27 SECTION("Checking RGBDSensor_nws_yarp device")
28 {
30
32 {
34 nws_cfg.put("device", "RGBDSensor_nws_yarp");
35 nws_cfg.put("name", "/rgbd_nws");
37 }
38
39 //Close all polydrivers and check
41 }
42
43 SECTION("Test the RGBDSensor_nws_yarp device with fakeDepthCamera device attached")
44 {
45 std::vector<std::string> fakeSens;
46 fakeSens.push_back("fakeDepthCamera");
47 fakeSens.push_back("fakeDepthCamera_mini");
48
49 for (auto it = fakeSens.begin(); it != fakeSens.end(); it++)
50 {
55
56 // open
57 p_nws.put("device", "RGBDSensor_nws_yarp");
58 p_nws.put("name", "/rgbd_nws");
59 p_fake.put("device", *it);
60 // small values to improve valgrind speed
61 p_fake.put("rgb_w", 32);
62 p_fake.put("rgb_h", 24);
63 p_fake.put("dep_w", 32);
64 p_fake.put("dep_h", 24);
69
71
72 // attach
73 {
75 dd_nws.view(ww_nws);
77 bool result_att = ww_nws->attach(&dd_fake);
79 }
80
81 // Wait some time
83
84 // Close all polydrivers and check
85 {
88 }
89 }
90 }
91
92 Network::setLocalMode(false);
93}
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:32
static void delaySystem(double seconds)
void exec_params_test(yarp::dev::PolyDriver *pdrv)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.