YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
rangefinder2D_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>
11
12#include <catch2/catch_amalgamated.hpp>
13#include <harness.h>
14
15using namespace yarp::dev;
16using namespace yarp::sig;
17using namespace yarp::os;
18
19TEST_CASE("dev::Rangefinder2D_nws_yarpTest", "[yarp::dev]")
20{
21 YARP_REQUIRE_PLUGIN("fakeLaser", "device");
22 YARP_REQUIRE_PLUGIN("rangefinder2D_nws_yarp", "device");
23
24 Network::setLocalMode(true);
25
26 SECTION("Checking Rangefinder2D_nws_yarp device alone")
27 {
29 IRangefinder2D* irng = nullptr;
30
32 {
34 nws_cfg.put("device", "rangefinder2D_nws_yarp");
35 nws_cfg.put("period", "0.010");
36 nws_cfg.put("name", "/laser");
38 }
39
40 //Close all polydrivers and check
42 }
43
44 SECTION("Checking Rangefinder2D_nws_yarp device attached to fakeLidar")
45 {
48
50 {
52 pnws_cfg.put("device", "rangefinder2D_nws_yarp");
53 pnws_cfg.put("period", 0.010);
54 pnws_cfg.put("name", "/laser");
56
58 pdev_cfg.put("device", "fakeLaser");
59 pdev_cfg.put("test", "use_constant");
60 Property& cm_cfg = pdev_cfg.addGroup("CONSTANT_MODE");
61 cm_cfg.put("const_distance", 0.5);
63
66 bool result_att = ww_nws->attach(&ddfake);
68 }
69
71
72 //"Close all polydrivers and check"
73 {
74 CHECK(ddnws.close());
76 }
77 }
78
79 Network::setLocalMode(false);
80}
A generic interface for planar laser range finders.
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::Rangefinder2D_nws_yarpTest", "[yarp::dev]")