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
13#include <catch2/catch_amalgamated.hpp>
14#include <harness.h>
15
16using namespace yarp::dev;
17using namespace yarp::sig;
18using namespace yarp::os;
19
20TEST_CASE("dev::Rangefinder2D_nws_yarpTest", "[yarp::dev]")
21{
22 YARP_REQUIRE_PLUGIN("fakeLaser", "device");
23 YARP_REQUIRE_PLUGIN("rangefinder2D_nws_yarp", "device");
24
25 Network::setLocalMode(true);
26
27 SECTION("Checking Rangefinder2D_nws_yarp device alone")
28 {
30 IRangefinder2D* irng = nullptr;
31
33 {
35 nws_cfg.put("device", "rangefinder2D_nws_yarp");
36 nws_cfg.put("period", "0.010");
37 nws_cfg.put("name", "/laser");
40 }
41
42 //Close all polydrivers and check
44 }
45
46 SECTION("Checking Rangefinder2D_nws_yarp device attached to fakeLidar")
47 {
50
52 {
54 pnws_cfg.put("device", "rangefinder2D_nws_yarp");
55 pnws_cfg.put("period", 0.010);
56 pnws_cfg.put("name", "/laser");
58
60 pdev_cfg.put("device", "fakeLaser");
61 pdev_cfg.put("test", "use_constant");
62 Property& cm_cfg = pdev_cfg.addGroup("CONSTANT_MODE");
63 cm_cfg.put("const_distance", 0.5);
65
68 bool result_att = ww_nws->attach(&ddfake);
70 }
71
73
74 //"Close all polydrivers and check"
75 {
76 CHECK(ddnws.close());
78 }
79 }
80
81 Network::setLocalMode(false);
82}
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
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::Rangefinder2D_nws_yarpTest", "[yarp::dev]")