YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
localization2D_nwc_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
7#include <yarp/os/Network.h>
12
13#include <catch2/catch_amalgamated.hpp>
14#include <harness.h>
15
16using namespace yarp::dev;
17using namespace yarp::os;
18
19TEST_CASE("dev::localization2D_nwc", "[yarp::dev]")
20{
21 YARP_REQUIRE_PLUGIN("fakeLocalizer", "device");
22 YARP_REQUIRE_PLUGIN("localization2D_nws_yarp", "device");
23 YARP_REQUIRE_PLUGIN("localization2D_nwc_yarp", "device");
24
25 Network::setLocalMode(true);
26
27 SECTION("Checking localization2D_nwc device")
28 {
33
35 {
37 pnws_cfg.put("device", "localization2D_nws_yarp");
40
42 pdev_cfg.put("device", "fakeLocalizer");
45
48 bool result_att = ww_nws->attach(&ddfake);
50
52 pnwc_cfg.put("device", "localization2D_nwc_yarp");
53 pnwc_cfg.put("local", "/localization2D_nwc_yarp");
54 pnwc_cfg.put("remote", "/localization2D_nws_yarp");
57 REQUIRE(ddnwc.view(iloc));
58 }
59
61
62 //"Close all polydrivers and check"
63 {
64 CHECK(ddnwc.close());
66 CHECK(ddnws.close());
69 }
70 }
71
72 Network::setLocalMode(false);
73}
ILocalization2D interface.
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
TEST_CASE("dev::localization2D_nwc", "[yarp::dev]")
void exec_iLocalization2D_test_1(yarp::dev::Nav2D::ILocalization2D *iloc)
void exec_params_test(yarp::dev::PolyDriver *pdrv)
For streams capable of holding different kinds of content, check what they actually have.
void delay(double seconds)
Wait for a certain number of seconds.
Definition Time.cpp:111
An interface to the operating system, including Port based communication.