YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
navigation2D_nwc_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/dev/IMap2D.h>
8#include <yarp/os/Network.h>
9#include <yarp/os/LogStream.h>
10#include <yarp/dev/PolyDriver.h>
13
14#include <catch2/catch_amalgamated.hpp>
15#include <harness.h>
16
17using namespace yarp::dev;
18using namespace yarp::dev::Nav2D;
19using namespace yarp::sig;
20using namespace yarp::os;
21
22TEST_CASE("dev::Navigation2DNwcTest", "[yarp::dev]")
23{
24 YARP_REQUIRE_PLUGIN("map2D_nws_yarp", "device");
25 YARP_REQUIRE_PLUGIN("map2D_nwc_yarp", "device");
26 YARP_REQUIRE_PLUGIN("map2DStorage", "device");
27 YARP_REQUIRE_PLUGIN("localization2D_nws_yarp", "device");
28 YARP_REQUIRE_PLUGIN("fakeLocalizer", "device");
29 YARP_REQUIRE_PLUGIN("navigation2D_nws_yarp", "device");
30 YARP_REQUIRE_PLUGIN("fakeNavigation", "device");
31 YARP_REQUIRE_PLUGIN("navigation2D_nwc_yarp", "device");
32
33 Network::setLocalMode(true);
34
35 SECTION("Checking navigation2D_nwc_yarp < -> navigation2D_nws_yarp communication and yarp::dev::Nav2D::INavigation2D methods")
36 {
45 INavigation2D* inav = nullptr;
46 IMap2D* imap = nullptr;
47
49 {
51 pmapserver_cfg.put("device", "map2D_nws_yarp");
54 pmapstorage_cfg.put("device", "map2DStorage");
58 bool result_att = ww_nws->attach(&ddmapstorage); }
59
61 pmapclient_cfg.put("device", "map2D_nwc_yarp");
62 pmapclient_cfg.put("local", "/mapClientTest");
63 pmapclient_cfg.put("remote", "/map2D_nws_yarp");
66
68 plocserver_cfg.put("device", "localization2D_nws_yarp");
71 pfakeLocalizer_cfg.put("device", "fakeLocalizer");
75 bool result_att = ww_nws->attach(&ddfakeLocalizer); }
76
78 pnavserver_cfg.put("device", "navigation2D_nws_yarp");
81 pfakeNavigation.put("device", "fakeNavigation");
85 bool result_att = ww_nws->attach(&ddfakeNavigation); }
86
88 pnavclient_cfg.put("device", "navigation2D_nwc_yarp");
89 pnavclient_cfg.put("local", "/navigationClientTest");
90 pnavclient_cfg.put("navigation_server", "/navigation2D_nws_yarp");
91 pnavclient_cfg.put("map_locations_server", "/map2D_nws_yarp");
92 pnavclient_cfg.put("localization_server", "/localization2D_nws_yarp");
95 }
96
97 // Do tests
100
101 //"Close all polydrivers and check"
102 {
111 }
112 }
113
114 Network::setLocalMode(false);
115}
IMap2D Interface.
Definition IMap2D.h:30
An interface to control the navigation of a mobile robot in a 2D environment.
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
void exec_iNav2D_test_1(INavigation2D *inav, IMap2D *imap)
void exec_iNav2D_test_2(INavigation2D *inav, IMap2D *imap)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.
TEST_CASE("dev::Navigation2DNwcTest", "[yarp::dev]")