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
15
16#include <catch2/catch_amalgamated.hpp>
17#include <harness.h>
18
19TEST_CASE("dev::FrameTransformClientTest", "[yarp::dev]")
20{
21 #if defined(DISABLE_FAILING_TESTS)
22 YARP_SKIP_TEST("Skipping failing tests")
23 #endif
24
25 YARP_REQUIRE_PLUGIN("frameTransformClient", "device");
26
28 const bool verboseDebug = true;
29
30 SECTION("test the frameTransformClient/Server open/close, case 0")
31 {
34
35 p.put("device", "frameTransformClient");
36 p.put("config_name", "ftc_local_only.xml");
37 REQUIRE(pd.open(p));
39 REQUIRE(pd.close());
40
41 p.put("device", "frameTransformServer");
42 p.put("config_name", "fts_yarp_only.xml");
43 REQUIRE(pd.open(p));
45 REQUIRE(pd.close());
46 }
47
48 SECTION("test the frameTransformClient local only mode, case 1")
49 {
53 p.put("device","frameTransformClient");
54 p.put("config_name","ftc_local_only.xml");
55 if(verboseDebug) {p.put("FrameTransform_verbose_debug","1"); }
56 REQUIRE(pd.open(p));
57 REQUIRE(pd.view(ift));
58
60
61 REQUIRE(pd.close());
62 }
63
64 SECTION("test the frameTransformClient local only mode, case 2")
65 {
69 p.put("device", "frameTransformClient");
70 p.put("config_name", "ftc_local_only.xml");
71 if (verboseDebug) { p.put("FrameTransform_verbose_debug", "1"); }
72 REQUIRE(pd.open(p));
73 REQUIRE(pd.view(ift));
74
76
77 REQUIRE(pd.close());
78 }
79
80 SECTION("test the frameTransformClient/Server, case 3")
81 {
84 server_prop.put("device", "frameTransformServer");
85 server_prop.put("config_name", "fts_yarp_only.xml");
86 if (verboseDebug) { server_prop.put("FrameTransform_verbose_debug", "1"); }
88
92 client_prop.put("device", "frameTransformClient");
93 client_prop.put("config_name", "ftc_yarp_only.xml");
94 if (verboseDebug) { client_prop.put("FrameTransform_verbose_debug", "1"); }
96 REQUIRE(client_pd.view(ift));
97
99
102 }
103
104 SECTION("test the frameTransformClient/Server, case 4")
105 {
108 server_prop.put("device", "frameTransformServer");
109 server_prop.put("config_name", "fts_yarp_only.xml");
110 if (verboseDebug) { server_prop.put("FrameTransform_verbose_debug", "1"); }
112
116 client_prop.put("device", "frameTransformClient");
117 client_prop.put("config_name", "ftc_yarp_only.xml");
118 if (verboseDebug) { client_prop.put("FrameTransform_verbose_debug", "1"); }
120 REQUIRE(client_pd.view(ift));
121
123
126 }
127
129}
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:1118
A class for storing options and configuration information.
Definition Property.h:33
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Definition Property.cpp:987
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