YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FrameTransformClient_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#include <yarp/os/Property.h>
10#include <yarp/os/Network.h>
11#include <iostream>
12
14
15#include <catch2/catch_amalgamated.hpp>
16#include <harness.h>
17
18TEST_CASE("dev::FrameTransformClientTest", "[yarp::dev]")
19{
20 #if defined(DISABLE_FAILING_TESTS)
21 YARP_SKIP_TEST("Skipping failing tests")
22 #endif
23
24 YARP_REQUIRE_PLUGIN("frameTransformClient", "device");
25
27 const bool verboseDebug = true;
28
29 SECTION("test the frameTransformClient/Server open/close, case 0")
30 {
33
34 p.put("device", "frameTransformClient");
35 p.put("filexml_option", "ftc_local_only.xml");
36 REQUIRE(pd.open(p));
38 REQUIRE(pd.close());
39
40 p.put("device", "frameTransformServer");
41 p.put("filexml_option", "fts_yarp_only.xml");
42 REQUIRE(pd.open(p));
44 REQUIRE(pd.close());
45 }
46
47 SECTION("test the frameTransformClient local only mode, case 1")
48 {
52 p.put("device","frameTransformClient");
53 p.put("filexml_option","ftc_local_only.xml");
54 if(verboseDebug) {p.put("FrameTransform_verbose_debug","1"); }
55 REQUIRE(pd.open(p));
56 REQUIRE(pd.view(ift));
57
59
60 REQUIRE(pd.close());
61 }
62
63 SECTION("test the frameTransformClient local only mode, case 2")
64 {
68 p.put("device", "frameTransformClient");
69 p.put("filexml_option", "ftc_local_only.xml");
70 if (verboseDebug) { p.put("FrameTransform_verbose_debug", "1"); }
71 REQUIRE(pd.open(p));
72 REQUIRE(pd.view(ift));
73
75
76 REQUIRE(pd.close());
77 }
78
79 SECTION("test the frameTransformClient/Server, case 3")
80 {
83 server_prop.put("device", "frameTransformServer");
84 server_prop.put("filexml_option", "fts_yarp_only.xml");
85 if (verboseDebug) { server_prop.put("FrameTransform_verbose_debug", "1"); }
87
91 client_prop.put("device", "frameTransformClient");
92 client_prop.put("filexml_option", "ftc_yarp_only.xml");
93 if (verboseDebug) { client_prop.put("FrameTransform_verbose_debug", "1"); }
95 REQUIRE(client_pd.view(ift));
96
98
101 }
102
103 SECTION("test the frameTransformClient/Server, case 4")
104 {
107 server_prop.put("device", "frameTransformServer");
108 server_prop.put("filexml_option", "fts_yarp_only.xml");
109 if (verboseDebug) { server_prop.put("FrameTransform_verbose_debug", "1"); }
111
115 client_prop.put("device", "frameTransformClient");
116 client_prop.put("filexml_option", "ftc_yarp_only.xml");
117 if (verboseDebug) { client_prop.put("FrameTransform_verbose_debug", "1"); }
119 REQUIRE(client_pd.view(ift));
120
122
125 }
126
128}
TEST_CASE("dev::FrameTransformClientTest", "[yarp::dev]")
Transform Interface.
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.
static bool setLocalMode(bool flag)
Chooses whether communication is process-local.
Definition Network.cpp:1049
A class for storing options and configuration information.
Definition Property.h:33
void exec_frameTransform_test_2(IFrameTransform *itf)
void exec_frameTransform_test_1(IFrameTransform *itf)
void delay(double seconds)
Wait for a certain number of seconds.
Definition Time.cpp:111