YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IMotorTest.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 IMOTORCONTROLTEST_H
7#define IMOTORCONTROLTEST_H
8
9#include <yarp/dev/IMotor.h>
10#include <catch2/catch_amalgamated.hpp>
11
12using namespace yarp::dev;
13using namespace yarp::os;
14
15namespace yarp::dev::tests
16{
18 {
19 REQUIRE(imot != nullptr);
20
21 int axis=0;
22 bool b = false;
23 double val=0;
24
25 b = imot->getNumberOfMotors(&axis);
26 CHECK(b);
27 REQUIRE(axis > 0);
28 auto vals = std::vector<double>(axis);
29
30 b = imot->getGearboxRatio(0, &val);
31 CHECK(b);
32
33 b = imot->setGearboxRatio(0,100);
34 CHECK(b);
35
36 b = imot->getGearboxRatio(0, &val);
37 CHECK(b);
38
39 b = imot->getTemperature(0, &val);
40 CHECK(b);
41
42 b = imot->getTemperatureLimit(0, &val);
43 CHECK(b);
44
45 b = imot->setTemperatureLimit(0, 80);
46 CHECK(b);
47
48 b = imot->getTemperatureLimit(0, &val);
49 CHECK(b);
50
51 b = imot->getTemperatures(vals.data());
52 CHECK(b);
53 }
54}
55
56#endif
Control board, encoder interface.
Definition IMotor.h:94
A mini-server for performing network communication in the background.
void exec_iMotor_test_1(IMotor *imot)
Definition IMotorTest.h:17
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.