YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
rangefinder2DTransformer_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 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::Rangefinder2DTransformerTest", "[yarp::dev]")
20{
21 YARP_REQUIRE_PLUGIN("fakeLaser", "device");
22 YARP_REQUIRE_PLUGIN("rangefinder2DTransformer", "device");
23
24 Network::setLocalMode(true);
25
26 SECTION("Checking rangefinder2DTransformer device")
27 {
30 IRangefinder2D* irng = nullptr;
31
33 {
35 plas_cfg.put("device", "fakeLaser");
36 plas_cfg.put("test", "use_constant");
37 Property& cm_cfg = plas_cfg.addGroup("CONSTANT_MODE");
38 cm_cfg.put("const_distance", 0.5);
40 }
41 {
43 ptrf_cfg.put("device", "rangefinder2DTransformer");
45 }
46
47 //attach the nws to the fakelaser device
50 bool result_att = ww_trf->attach(&ddlas);
52
53 REQUIRE(ddtrf.view(irng));
54
55 //execute tests
57
58 //Close all polydrivers and check
59 CHECK(ddtrf.close());
61 INFO("rangefinder2DTransformer closed");
62
63 CHECK(ddlas.close());
65 INFO("fakeLaser closed");
66
67 INFO("Test complete");
68 }
69
70 Network::setLocalMode(false);
71}
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_iRangefinder2D_test_1(IRangefinder2D *irf)
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::Rangefinder2DTransformerTest", "[yarp::dev]")
std::string INFO
Definition ymanager.cpp:51