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>
13#include <yarp/dev/IMotor.h>
20#include <yarp/os/Network.h>
21#include <yarp/dev/PolyDriver.h>
39
40#include <catch2/catch_amalgamated.hpp>
41#include <harness.h>
42
43using namespace yarp::dev;
44using namespace yarp::os;
45
46TEST_CASE("dev::fakeMotionControl", "[yarp::dev]")
47{
48 YARP_REQUIRE_PLUGIN("fakeMotionControl", "device");
49
50 Network::setLocalMode(true);
51
52 SECTION("Checking fakeMotionControl device")
53 {
55
56 IPositionControl* ipos=nullptr;
57 IVelocityControl* ivel = nullptr;
58 ITorqueControl* itrq=nullptr;
59 IAxisInfo* iinfo = nullptr;
60 IEncodersTimed* ienc = nullptr;
61 IControlMode* icmd = nullptr;
62 IInteractionMode* iint = nullptr;
63 IMotor* imot = nullptr;
64 IMotorEncoders* imotenc = nullptr;
65 IPidControl* ipid = nullptr;
66 IPWMControl* ipwm = nullptr;
67 ICurrentControl* icurr = nullptr;
68 IJointFault* ifault = nullptr;
69 IControlLimits* ilims = nullptr;
70 //IRemoteCalibrator* icalib = nullptr;
71
73 {
75 p_cfg.put("device", "fakeMotionControl");
76 Property& grp = p_cfg.addGroup("GENERAL");
77 grp.put("Joints", 2);
79 }
80
81 ddmc.view(ipos); REQUIRE(ipos);
82 ddmc.view(ivel); REQUIRE(ivel);
83 ddmc.view(itrq); REQUIRE(itrq);
84 ddmc.view(iinfo); REQUIRE(iinfo);
85 ddmc.view(ienc); REQUIRE(ienc);
86 ddmc.view(icmd); REQUIRE(icmd);
87 ddmc.view(iint); REQUIRE(iint);
88 ddmc.view(imot); REQUIRE(imot);
90 ddmc.view(ipid); REQUIRE(ipid);
91 ddmc.view(ipwm); REQUIRE(ipwm);
92 ddmc.view(icurr); REQUIRE(icurr);
93 ddmc.view(ifault); REQUIRE(ifault);
94 ddmc.view(ilims); REQUIRE(ilims);
95 //ddmc.view(iremotecalib); REQUIRE(iremotecalib);
96
110 //yarp::dev::tests::exec_iRemoteCalibrator_test_1(iremotecalib);
113
114 //"Close all polydrivers and check"
115 {
116 CHECK(ddmc.close());
117 }
118 }
119
120 Network::setLocalMode(false);
121}
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 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_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.