YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
IMotorEncodersTest.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 IMOTORENCODERSTEST_H
7
#define IMOTORENCODERSTEST_H
8
9
#include <
yarp/dev/IMotorEncoders.h
>
10
#include <
yarp/dev/IControlMode.h
>
11
#include <catch2/catch_amalgamated.hpp>
12
13
using namespace
yarp::dev
;
14
using namespace
yarp::os
;
15
16
namespace
yarp::dev::tests
17
{
18
inline
void
exec_iMotorEncoders_test_1
(
IMotorEncoders
*
imotenc
)
19
{
20
REQUIRE
(
imotenc
!=
nullptr
);
21
22
bool
b =
false
;
23
double
value = 0;
24
double
time = 0;
25
int
axis
=0;
26
b =
imotenc
->getNumberOfMotorEncoders(&
axis
);
27
CHECK
(b);
28
CHECK
(
axis
!=0);
29
30
b =
imotenc
->getMotorEncoder(0, &value);
31
CHECK
(b);
32
b =
imotenc
->getMotorEncoderAcceleration(0, &value);
33
CHECK
(b);
34
b =
imotenc
->getMotorEncoderSpeed(0, &value);
35
CHECK
(b);
36
b =
imotenc
->getMotorEncoderTimed(0,&value,&time);
37
}
38
}
39
40
#endif
IControlMode.h
IMotorEncoders.h
yarp::dev::IMotorEncoders
Control board, encoder interface.
Definition
IMotorEncoders.h:150
yarp::os::BufferedPort
A mini-server for performing network communication in the background.
Definition
BufferedPort.h:60
yarp::dev::tests
Definition
IAxisInfoTest.h:16
yarp::dev::tests::exec_iMotorEncoders_test_1
void exec_iMotorEncoders_test_1(IMotorEncoders *imotenc)
Definition
IMotorEncodersTest.h:18
yarp::dev
For streams capable of holding different kinds of content, check what they actually have.
Definition
jointData.cpp:13
yarp::os
An interface to the operating system, including Port based communication.
Definition
AbstractCarrier.h:13
YARP
3.10.1+35-20241205.6+git6b4bb23ab
src
libYARP_dev
src
yarp
dev
tests
IMotorEncodersTest.h
Generated on Thu Dec 12 2024 02:37:46 for YARP by
1.9.8