YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
fakeMotionControl_test.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
10#include <yarp/dev/IAxisInfo.h>
14#include <yarp/dev/IMotor.h>
21#include <yarp/os/Network.h>
22#include <yarp/dev/PolyDriver.h>
41
42#include <catch2/catch_amalgamated.hpp>
43#include <harness.h>
44
45using namespace yarp::dev;
46using namespace yarp::os;
47
48TEST_CASE("dev::fakeMotionControl", "[yarp::dev]")
49{
50 YARP_REQUIRE_PLUGIN("fakeMotionControl", "device");
51
52 Network::setLocalMode(true);
53
54 SECTION("Checking fakeMotionControl device")
55 {
57
58 IPositionControl* ipos=nullptr;
59 IVelocityControl* ivel = nullptr;
60 ITorqueControl* itrq=nullptr;
61 IAxisInfo* iinfo = nullptr;
62 IEncodersTimed* ienc = nullptr;
63 IControlMode* icmd = nullptr;
64 IInteractionMode* iint = nullptr;
65 IMotor* imot = nullptr;
66 IMotorEncoders* imotenc = nullptr;
67 IPidControl* ipid = nullptr;
68 IPWMControl* ipwm = nullptr;
69 ICurrentControl* icurr = nullptr;
70 IJointFault* ifault = nullptr;
71 IControlLimits* ilims = nullptr;
72 IImpedanceControl* iimp = nullptr;
73 //IRemoteCalibrator* icalib = nullptr;
74
76 {
78 p_cfg.put("device", "fakeMotionControl");
79 Property& grp = p_cfg.addGroup("GENERAL");
80 grp.put("Joints", 2);
82 }
83
84 ddmc.view(ipos); REQUIRE(ipos);
85 ddmc.view(ivel); REQUIRE(ivel);
86 ddmc.view(itrq); REQUIRE(itrq);
87 ddmc.view(iinfo); REQUIRE(iinfo);
88 ddmc.view(ienc); REQUIRE(ienc);
89 ddmc.view(icmd); REQUIRE(icmd);
90 ddmc.view(iint); REQUIRE(iint);
91 ddmc.view(imot); REQUIRE(imot);
93 ddmc.view(ipid); REQUIRE(ipid);
94 ddmc.view(ipwm); REQUIRE(ipwm);
95 ddmc.view(icurr); REQUIRE(icurr);
96 ddmc.view(ifault); REQUIRE(ifault);
97 ddmc.view(ilims); REQUIRE(ilims);
98 ddmc.view(iimp); REQUIRE(iimp);
99 //ddmc.view(iremotecalib); REQUIRE(iremotecalib);
100
114 //yarp::dev::tests::exec_iRemoteCalibrator_test_1(iremotecalib);
118
119 //"Close all polydrivers and check"
120 {
121 CHECK(ddmc.close());
122 }
123 }
124
125 Network::setLocalMode(false);
126}
define control board standard interfaces
define control board standard interfaces
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:36
Interface for control devices, commands to get/set position and veloity limits.
Interface for setting control mode in control board.
Interface for control boards implementing current control.
Control board, extend encoder interface with timestamps.
Interface for control boards implementing impedance control.
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
Interface for getting info about the fault which may occur on a robot.
Definition IJointFault.h:23
Control board, encoder interface.
Control board, encoder interface.
Definition IMotor.h:94
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:23
Interface for a generic control board device implementing a PID controller, with scaled arguments.
Interface for a generic control board device implementing position control.
Interface for control boards implementing torque control.
Interface for control boards implementing velocity control.
A container for a device driver.
Definition PolyDriver.h:23
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
A class for storing options and configuration information.
Definition Property.h:33
TEST_CASE("dev::fakeMotionControl", "[yarp::dev]")
void exec_iMotorEncoders_test_1(IMotorEncoders *imotenc)
void exec_iAxisInfo_test_1(IAxisInfo *iinfo)
void exec_iControlLimits_test1(IControlLimits *ilims, IAxisInfo *iinfo)
void exec_iMotor_test_1(IMotor *imot)
Definition IMotorTest.h:17
void exec_iCurrentControl_test_1(ICurrentControl *icurr, IControlMode *icmd)
void exec_iTorqueControl_test_1(ITorqueControl *itrq, IControlMode *icmd)
void exec_iInteractionMode_test_1(IInteractionMode *iint, IAxisInfo *iinfo)
void exec_iPidControl_test_1(IPidControl *ipid, IAxisInfo *iaxis)
void exec_iImpedanceControl_test_1(IImpedanceControl *iimp)
void exec_iPositionControl_test_1(IPositionControl *ipos, IControlMode *icmd)
void exec_iPwmControl_test_1(IPWMControl *ipwm, IControlMode *icmd)
void exec_iJointFault_test_1(IJointFault *ifault)
void exec_iEncodersTimed_test_1(IEncodersTimed *ienc)
void exec_iControlMode_test_1(IControlMode *icmd, IAxisInfo *iinfo)
void exec_iVelocityControl_test_1(IVelocityControl *ivel, IControlMode *icmd)
void exec_iPidControl_test_2(IPidControl *ipid)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.