YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
frameGrabber_nws_ros2_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
8
11
12#include <yarp/os/Network.h>
13#include <yarp/sig/Image.h>
14#include <yarp/sig/Vector.h>
15#include <yarp/dev/PolyDriver.h>
16#include <yarp/os/Time.h>
18
19#include <string>
20
21#include <catch2/catch_amalgamated.hpp>
22#include <harness.h>
23
24using namespace yarp::os;
25using namespace yarp::dev;
26using namespace yarp::sig;
27
28
29TEST_CASE("dev::frameGrabber_nws_ros2_test", "[yarp::dev]")
30{
31 YARP_REQUIRE_PLUGIN("fakeFrameGrabber", "device");
32 YARP_REQUIRE_PLUGIN("frameGrabber_nws_ros2", "device");
33
34 Network::setLocalMode(true);
35
36 SECTION("Checking the nws alone")
37 {
39
41 {
43 pcfg.put("device", "frameGrabber_nws_ros2");
44 pcfg.put("node_name", "frameGrabber_node");
45 pcfg.put("topic_name","/controlBoard_nws_ros2/robot_part");
46 pcfg.put("frame_id","test_frame");
48 }
49
50 //"Close all polydrivers and check"
51 {
52 CHECK(ddnws.close());
53 }
54 }
55
56 SECTION("Checking the nws attached to device")
57 {
62
63 p_nws.put("device", "frameGrabber_nws_ros2");
64 p_nws.put("node_name", "frameGrabber_node");
65 p_nws.put("topic_name","/controlBoard_nws_ros2/robot_part");
66 p_nws.put("frame_id","test_frame");
67
68 p_fake.put("device", "fakeFrameGrabber");
69
73
76 bool result_att = ww_nws->attach(&dd_fake);
78
80
83 }
84
85 Network::setLocalMode(false);
86}
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:33
static void delaySystem(double seconds)
TEST_CASE("dev::frameGrabber_nws_ros2_test", "[yarp::dev]")
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13
An interface to the operating system, including Port based communication.