YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IInteractionModeTest.h
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#ifndef IINTERACTIONMODETEST_H
7#define IINTERACTIONMODETEST_H
8
9#include <memory>
10#include <numeric>
11#include <vector>
12
13#include <yarp/dev/IAxisInfo.h>
15#include <catch2/catch_amalgamated.hpp>
16
17using namespace yarp::dev;
18using namespace yarp::os;
19
20namespace yarp::dev::tests
21{
23 {
24 REQUIRE(iint != nullptr);
25 REQUIRE(iinfo != nullptr);
26
27 int ax;
28 bool b = iinfo->getAxes(&ax);
29 CHECK(b);
30 REQUIRE(ax > 0);
31
34
35 b = iint->getInteractionMode(0,&ret);
36 CHECK(b);
37
39 b = iint->setInteractionMode(0,val);
40 CHECK(b);
41
42 b = iint->getInteractionMode(0, &ret);
43 CHECK(b);
44
46 b = iint->setInteractionMode(0, val);
47 CHECK(b);
48
49 b = iint->getInteractionMode(0, &ret);
50 CHECK(b);
51
52 auto modes = std::vector< yarp::dev::InteractionModeEnum>(ax);
53 b = iint->getInteractionModes(modes.data());
54 CHECK(b);
55
56 auto joints = std::vector<int>(ax);
57 std::iota(joints.begin(), joints.end(), 0);
58 b = iint->getInteractionModes(ax, joints.data(), modes.data());
59 CHECK(b);
60
61 for (size_t j = 0; j < ax; j++)
62 {
64 }
65 b = iint->setInteractionModes(modes.data());
66 CHECK(b);
67 b = iint->setInteractionModes(ax, joints.data(), modes.data());
68 CHECK(b);
69
70 }
71}
72#endif
define control board standard interfaces
bool ret
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:36
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
A mini-server for performing network communication in the background.
void exec_iInteractionMode_test_1(IInteractionMode *iint, IAxisInfo *iinfo)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.