YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
multipleanalogsensorsremapper_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include <yarp/os/Time.h>
11
15
16#include <catch2/catch_amalgamated.hpp>
17#include <harness.h>
18
19using namespace yarp::os;
20using namespace yarp::dev;
21
22
23TEST_CASE("dev::multipleanalogsensorsremapperTest", "[yarp::dev]")
24{
25 YARP_REQUIRE_PLUGIN("multipleanalogsensorsremapper", "device");
26 YARP_REQUIRE_PLUGIN("fakeIMU", "device");
27
28 Network::setLocalMode(true);
29
30 SECTION("Test the multipleanalogsensorsremapper device alone")
31 {
32 Property options;
33 options.put("device", "multipleanalogsensorsremapper");
35 Bottle& gyrosList = gyrosNames.addList();
36 gyrosList.addString("head");
37 gyrosList.addString("torso");
38 options.put("OrientationSensorsNames", gyrosNames.get(0));
39
41 REQUIRE(ddRemapper.open(options));
43
46 }
47
48 SECTION("Test the multipleanalogsensorsremapper device attached")
49 {
50
55
56 {
58 p_cfg.put("device", "fakeIMU");
59 p_cfg.put("sensorName", "fakeIMU1");
61 }
62
63 {
65 p_cfg.put("device", "fakeIMU");
66 p_cfg.put("sensorName", "fakeIMU2");
68 }
69
70 Property options;
71 options.put("device", "multipleanalogsensorsremapper");
73 Bottle& gyrosList = gyrosNames.addList();
74 gyrosList.addString("fakeIMU1");
75 gyrosList.addString("fakeIMU2");
76 options.put("OrientationSensorsNames", gyrosNames.get(0));
77
78 REQUIRE(ddRemapper.open(options));
79
83 pdList.push(&dd_imu1, "fakeIMU1_key");
84 pdList.push(&dd_imu2, "fakeIMU2_key");
85 REQUIRE(iwrap->attachAll(pdList));
86
87 REQUIRE(ddRemapper.view(iimu));
89
91
93 }
94
95 Network::setLocalMode(false);
96}
define control board standard interfaces
Interface for an object that can wrap/attach to to another.
Device interface to one or multiple orientation sensors, such as IMUs with on board estimation algori...
A container for a device driver.
Definition PolyDriver.h:23
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:65
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
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Definition Property.cpp:987
TEST_CASE("dev::multipleanalogsensorsremapperTest", "[yarp::dev]")
void exec_IOrientationSensors_test_1(IOrientationSensors *ios)
void exec_params_test(yarp::dev::PolyDriver *pdrv)
For streams capable of holding different kinds of content, check what they actually have.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
Definition Time.cpp:121
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.
Definition OSTestMsg.cpp:13