YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
robotDescription_nws_yarp_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
7#include <yarp/dev/IWrapper.h>
8
10#include <yarp/os/Time.h>
11#include <yarp/os/Network.h>
12
13#include <algorithm>
14#include <vector>
15
16#include <catch2/catch_amalgamated.hpp>
17#include <harness.h>
18
19using namespace yarp::os;
20using namespace yarp::dev;
21
22TEST_CASE("dev::robotDescription_nws_yarp_Test", "[yarp::dev]")
23{
24 YARP_REQUIRE_PLUGIN("robotDescription_nws_yarp", "device");
25 YARP_REQUIRE_PLUGIN("robotDescriptionStorage", "device");
26
27 Network::setLocalMode(true);
28
29 SECTION("Test the RobotDescription_nws_yarp device")
30 {
33 pserver_cfg.put("device", "robotDescription_nws_yarp");
34 pserver_cfg.put("local", "/robotDescription_nws_yarp/rpc");
35 REQUIRE(ddserver.open(pserver_cfg)); // robotDescription_nws_yarp open reported successful
36
38
39 // Close devices
40 CHECK(ddserver.close()); // robotDescription_nws_yarp successfully closed
41 }
42
43 SECTION("Test the RobotDescription_nws_yarp device with attach")
44 {
47 p_cfg_stor.put("device", "robotDescriptionStorage");
49
52 pserver_cfg.put("device", "robotDescription_nws_yarp");
53 pserver_cfg.put("local", "/robotDescription_nws_yarp/rpc");
54 REQUIRE(ddnws.open(pserver_cfg)); // robotDescription_nws_yarp open reported successful
55
56 yarp::dev::IWrapper* ww_nws = nullptr; ddnws.view(ww_nws);
58 bool result_att = ww_nws->attach(&dd_stor);
60
62
63 // Close devices
64 CHECK(ddnws.close()); // robotDescription_nws_yarp successfully closed
65 }
66
67 Network::setLocalMode(false);
68}
Interface for an object that can wrap/or "attach" to another.
Definition IWrapper.h:25
A container for a device driver.
Definition PolyDriver.h:23
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
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.
TEST_CASE("dev::robotDescription_nws_yarp_Test", "[yarp::dev]")