YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IControlLimitsTest.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 ICONTROLLIMITSTEST_H
7#define ICONTROLLIMITSTEST_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(ilims != nullptr);
25 REQUIRE(iinfo != nullptr);
26
27 bool b;
28 size_t ax=0;
29
30 b = iinfo->getAxes(ax);
31 CHECK(b);
32 REQUIRE(ax > 0);
33
34 double min=0;
35 double max=0;
36 b = ilims->getPosLimits (0, &min, &max);
37 CHECK(b);
38 CHECK(min!=100);
39 CHECK(max!=200);
40
41 b = ilims->getVelLimits(0, &min, &max);
42 CHECK(b);
43 CHECK(min!=1000);
44 CHECK(max!=2000);
45
46 b = ilims->setPosLimits(0, 100, 200);
47 CHECK(b);
48
49 b = ilims->setVelLimits(0, 1000, 2000);
50 CHECK(b);
51
52 b = ilims->getPosLimits (0, &min, &max);
53 CHECK(b);
54 CHECK(min==100);
55 CHECK(max==200);
56
57 b = ilims->getVelLimits(0, &min, &max);
58 CHECK(b);
59 CHECK(min==1000);
60 CHECK(max==2000);
61 }
62}
63
64#endif
define control board standard interfaces
define control board standard interfaces
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:37
Interface for control devices, commands to get/set position and velocity limits.
A mini-server for performing network communication in the background.
void exec_iControlLimits_test1(IControlLimits *ilims, 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.
Definition OSTestMsg.cpp:13