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
17#include <catch2/catch_amalgamated.hpp>
18#include <harness.h>
19
20using namespace yarp::os;
21using namespace yarp::dev;
22
23TEST_CASE("dev::robotDescription_nws_yarp_Test", "[yarp::dev]")
24{
25 YARP_REQUIRE_PLUGIN("robotDescription_nws_yarp", "device");
26 YARP_REQUIRE_PLUGIN("robotDescriptionStorage", "device");
27
28 Network::setLocalMode(true);
29
30 SECTION("Test the RobotDescription_nws_yarp device")
31 {
34 pserver_cfg.put("device", "robotDescription_nws_yarp");
35 pserver_cfg.put("local", "/robotDescription_nws_yarp/rpc");
36 REQUIRE(ddserver.open(pserver_cfg)); // robotDescription_nws_yarp open reported successful
38
40
41 // Close devices
42 CHECK(ddserver.close()); // robotDescription_nws_yarp successfully closed
43 }
44
45 SECTION("Test the RobotDescription_nws_yarp device with attach")
46 {
49 p_cfg_stor.put("device", "robotDescriptionStorage");
51
54 pserver_cfg.put("device", "robotDescription_nws_yarp");
55 pserver_cfg.put("local", "/robotDescription_nws_yarp/rpc");
56 REQUIRE(ddnws.open(pserver_cfg)); // robotDescription_nws_yarp open reported successful
57
58 yarp::dev::IWrapper* ww_nws = nullptr; ddnws.view(ww_nws);
60 bool result_att = ww_nws->attach(&dd_stor);
62
64
65 // Close devices
66 CHECK(ddnws.close()); // robotDescription_nws_yarp successfully closed
67 }
68
69 Network::setLocalMode(false);
70}
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
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.
Definition OSTestMsg.cpp:13
TEST_CASE("dev::robotDescription_nws_yarp_Test", "[yarp::dev]")