YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeCalibrator_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026-2026 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7#include <yarp/os/Network.h>
13
15#include <catch2/catch_amalgamated.hpp>
16#include <harness.h>
17
18using namespace yarp::dev;
19using namespace yarp::os;
20
21TEST_CASE("dev::fakeCalibrator", "[yarp::dev]")
22{
23 YARP_REQUIRE_PLUGIN("fakeCalibrator", "device");
24 YARP_REQUIRE_PLUGIN("controlBoard_nwc_yarp", "device");
25
26 //Opened by yarprotobotinterface, but we need it here to be sure it is available for the test
27 YARP_REQUIRE_PLUGIN("fakeMotionControl", "device");
28 YARP_REQUIRE_PLUGIN("controlBoard_nws_yarp", "device");
29 YARP_REQUIRE_PLUGIN("controlBoard_remapper", "device");
30
31 Network::setLocalMode(true);
32
33 SECTION("Checking fakeCalibrator device with XML configuration")
34 {
35 // Find file from disk
37 res.setDefaultContext("tests/libYARP_robotinterface");
38 std::string filepath = res.findFileByName("RobotinterfaceWithFakeCalibrator.xml");
39 // Load empty XML configuration file
40 std::string XMLString = "";
41
44 REQUIRE(readerresult.parsingIsSuccessful);
45 size_t device_num = readerresult.robot.devices().size();
46 CHECK(device_num != 0);
47
50
51 //----------------------------------------------------
52 //open a client nwc
53 {
56 {
58 p_cfg.put("device", "controlBoard_nwc_yarp");
59 p_cfg.put("local", "/local_controlboard");
60 p_cfg.put("remote", "/robot_test/part_test");
62 }
64 //test
65 ddnwc.view(icalib); REQUIRE(icalib);
68 ddnwc.close();
70 }
71
72 //----------------------------------------------------
73
76 }
77
78 Network::setLocalMode(false);
79}
IRemoteCalibrator interface is meant to remotize the access of the calibration device in order to all...
A container for a device driver.
Definition PolyDriver.h:23
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
Helper class for finding config files and other external resources.
bool setDefaultContext(const std::string &contextName)
Sets the context for the current ResourceFinder object.
std::string findFileByName(const std::string &name)
Find the full path to a file.
Result of the parsing of yarp::robotinterface::XMLReader.
Definition XMLReader.h:26
Class to read an XML file.
Definition XMLReader.h:52
XMLReaderResult getRobotFromFile(const std::string &filename, const yarp::os::Searchable &config=yarp::os::Property())
Parse the XML description of a robotinterface from a file.
Definition XMLReader.cpp:78
TEST_CASE("dev::fakeCalibrator", "[yarp::dev]")
void exec_iRemoteCalibrator_test_1(IRemoteCalibrator *icalib)
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.