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
14
15#include <catch2/catch_amalgamated.hpp>
16#include <harness.h>
17
18using namespace yarp::os;
19using namespace yarp::dev;
20
21
22TEST_CASE("dev::multipleanalogsensorsremapperTest", "[yarp::dev]")
23{
24 YARP_REQUIRE_PLUGIN("multipleanalogsensorsremapper", "device");
25 YARP_REQUIRE_PLUGIN("fakeIMU", "device");
26
27 Network::setLocalMode(true);
28
29 SECTION("Test the multipleanalogsensorsremapper device alone")
30 {
31 Property options;
32 options.put("device", "multipleanalogsensorsremapper");
34 Bottle& gyrosList = gyrosNames.addList();
35 gyrosList.addString("head");
36 gyrosList.addString("torso");
37 options.put("OrientationSensorsNames", gyrosNames.get(0));
38
40 REQUIRE(ddRemapper.open(options));
41
44 }
45
46 SECTION("Test the multipleanalogsensorsremapper device attached")
47 {
48
53
54 {
56 p_cfg.put("device", "fakeIMU");
57 p_cfg.put("sensorName", "fakeIMU1");
59 }
60
61 {
63 p_cfg.put("device", "fakeIMU");
64 p_cfg.put("sensorName", "fakeIMU2");
66 }
67
68 Property options;
69 options.put("device", "multipleanalogsensorsremapper");
71 Bottle& gyrosList = gyrosNames.addList();
72 gyrosList.addString("fakeIMU1");
73 gyrosList.addString("fakeIMU2");
74 options.put("OrientationSensorsNames", gyrosNames.get(0));
75
76 REQUIRE(ddRemapper.open(options));
77
81 pdList.push(&dd_imu1, "fakeIMU1_key");
82 pdList.push(&dd_imu2, "fakeIMU2_key");
83 REQUIRE(iwrap->attachAll(pdList));
84
85 REQUIRE(ddRemapper.view(iimu));
87
89
91 }
92
93 Network::setLocalMode(false);
94}
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:64
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)
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.