YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ICurrentControlTest.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 ICURRENTCONTROLTEST_H
7#define ICURRENTCONTROLTEST_H
8
11#include <catch2/catch_amalgamated.hpp>
12
13#include <memory>
14#include <numeric>
15#include <vector>
16
17using namespace yarp::dev;
18using namespace yarp::os;
19
20namespace yarp::dev::tests
21{
23 {
24 REQUIRE(icurr != nullptr);
25 REQUIRE(icmd != nullptr);
26
27 bool b = false;
28 int axis = 0;
29 double val = 0;
30 double min = 0;
31 double max = 0;
32
33 b = icurr->getNumberOfMotors(&axis);
34 CHECK (b);
35
36 b = icurr->getCurrent(0, &val);
37 CHECK(b);
38
39 b = icurr->getRefCurrent(0, &val);
40 CHECK(b);
41
42 b = icurr->setRefCurrent(0, 100);
43 CHECK(b);
44
45 b = icurr->getRefCurrent(0, &val);
46 CHECK(b);
47
48 b = icurr->getCurrentRange(0, &min, &max);
49 CHECK(b);
50
51 auto mins = std::vector< double >(axis);
52 auto maxs = std::vector< double >(axis);
53 auto currs = std::vector< double >(axis);
54
55 b = icurr->getCurrentRanges(mins.data(), maxs.data());
56 CHECK(b);
57
58 b = icurr->getCurrents(currs.data());
59 CHECK(b);
60
61 b = icurr->getRefCurrents(currs.data());
62 CHECK(b);
63
64 b = icurr->setRefCurrents(currs.data());
65 CHECK(b);
66 }
67}
68
69#endif
Interface for setting control mode in control board.
Interface for control boards implementing current control.
A mini-server for performing network communication in the background.
void exec_iCurrentControl_test_1(ICurrentControl *icurr, IControlMode *icmd)
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13
An interface to the operating system, including Port based communication.