YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SimulatedWorld_nws_ros2_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include <yarp/os/Network.h>
9
10#include <catch2/catch_amalgamated.hpp>
11#include <harness.h>
12
13using namespace yarp::os;
14using namespace yarp::dev;
15
16TEST_CASE("dev::SimulatedWorld_nws_ros2_test", "[yarp::dev]")
17{
18 YARP_REQUIRE_PLUGIN("simulatedWorld_nws_ros2", "device");
19 YARP_REQUIRE_PLUGIN("fakeSimulatedWorld", "device");
20
21 Network::setLocalMode(true);
22
23 SECTION("Checking simulatedWorld_nws_ros2 device")
24 {
26
27 {
29 p_nws.put("device", "simulatedWorld_nws_ros2");
31 }
32
33 {
35 }
36 }
37
38 SECTION("Checking simulatedWorld_nws_ros2 attached to fakeSimulatedWorld")
39 {
43
44 {
46 p_nws.put("device", "simulatedWorld_nws_ros2");
47 p_nws.put("node_name", "simulatedworld_nws_ros2_test");
49 }
50
51 {
53 p_fake.put("device", "fakeSimulatedWorld");
54 p_fake.put("period", 10);
56 }
57
58 // Attach the nws to the fake device
59 {
60 dd_nws.view(ww_nws);
61 REQUIRE(ww_nws != nullptr);
62 bool result_att = ww_nws->attach(&dd_fake);
64 }
65
66 {
69 }
70 }
71
72 Network::setLocalMode(false);
73}
TEST_CASE("dev::SimulatedWorld_nws_ros2_test", "[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:33
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.
Definition OSTestMsg.cpp:13