YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
odometry2D_nws_yarp_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7#include <yarp/os/Network.h>
10
11#include <catch2/catch_amalgamated.hpp>
12#include <harness.h>
13
14using namespace yarp::dev;
15using namespace yarp::os;
16
17TEST_CASE("dev::odometry2d_nws_yarpTest", "[yarp::dev]")
18{
19 YARP_REQUIRE_PLUGIN("fakeOdometry2D", "device");
20 YARP_REQUIRE_PLUGIN("odometry2D_nws_yarp", "device");
21
22 Network::setLocalMode(true);
23
24 SECTION("Checking odometry2D_nws_yarp device alone")
25 {
28
30 {
32 nws_cfg.put("device", "odometry2D_nws_yarp");
33 nws_cfg.put("period", 0.010);
34 nws_cfg.put("name", "/odom");
36 }
37
38 //Close all polydrivers and check
40 }
41
42 SECTION("Checking odometry2D_nws_yarp device attached to fakeOdometry2D")
43 {
46
48 {
50 pnws_cfg.put("device", "odometry2D_nws_yarp");
51 pnws_cfg.put("period", 0.010);
52 pnws_cfg.put("name", "/odom");
54
56 pdev_cfg.put("device", "fakeOdometry2D");
58
61 bool result_att = ww_nws->attach(&ddfake);
63 }
64
66
67 //"Close all polydrivers and check"
68 {
69 CHECK(ddnws.close());
71 }
72 }
73
74 Network::setLocalMode(false);
75}
IOdometry2D interface.
Definition IOdometry2D.h:23
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.
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::odometry2d_nws_yarpTest", "[yarp::dev]")