YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
joypadControl_nwc_yarp_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
9
10#include <yarp/os/Network.h>
11#include <yarp/sig/Image.h>
12#include <yarp/sig/Vector.h>
13#include <yarp/dev/PolyDriver.h>
15#include <yarp/os/Time.h>
16
17#include <string>
18
19#include <catch2/catch_amalgamated.hpp>
20#include <harness.h>
21
22using namespace yarp::os;
23using namespace yarp::dev;
24using namespace yarp::sig;
25
26
27TEST_CASE("dev::JoypadControl_nwc_yarp", "[yarp::dev]")
28{
29 YARP_REQUIRE_PLUGIN("fakeJoypad", "device");
30 YARP_REQUIRE_PLUGIN("JoypadControl_nwc_yarp", "device");
31 YARP_REQUIRE_PLUGIN("JoypadControl_nws_yarp", "device");
32
33 Network::setLocalMode(true);
34
36 bool(true),
37 bool(false)
38 );
39
41 bool(true),
42 bool(false)
43 );
44
46 bool(true),
47 bool(false)
48 );
49
50 SECTION("Test the frameGrabber_nwc_yarp device with a frameGrabber_nws_yarp device")
51 {
58
59 p_nws.put("device","JoypadControl_nws_yarp");
60 p_nws.put("name", "/joy_nws_yarp");
61 p_nws.put("publish_on_event",publish_on_event_config);
62 p_fake.put("device","fakeJoypad");
65
68
70
73 bool result_att = ww_nws->attach(&dd_fake);
75
76 p_nwc.put("device", "JoypadControl_nwc_yarp");
77 p_nwc.put("remote", "/joy_nws_yarp");
78 p_nwc.put("local", "/joy_nwc_yarp");
79 p_nwc.put("use_streaming", use_streaming_config);
80 p_nwc.put("use_all_port", use_all_port);
83
84 IJoypadController* ijoy = nullptr;
85 REQUIRE(dd_nwc.view(ijoy));
86
88
90
92
96 }
97
98 Network::setLocalMode(false);
99}
contains the definition of a Vector type
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:32
static void delaySystem(double seconds)
TEST_CASE("dev::JoypadControl_nwc_yarp", "[yarp::dev]")
void exec_params_test(yarp::dev::PolyDriver *pdrv)
void exec_iJoypadController_test_1(yarp::dev::IJoypadController *iJoy)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.