16#include <catch2/catch_amalgamated.hpp>
26 "AxisName (\"axisA1\" \"axisA2\") \n";
32 "AxisName (\"axisB1\" \"axisB2\" \"axisB3\") \n";
38 "AxisName (\"axisC1\" \"axisC2\" \"axisC3\" \"axisC4\") \n";
44 "AxisName (\"axisA1\" \"axisA2\") \n";
50 "AxisName (\"axisB1\" \"axisB2\" \"axisB3\") \n";
56 "AxisName (\"axisC1\" \"axisC2\" \"axisC3\" \"axisC4\") \n";
67# define REMAPPER_TEST_NWS_PERIOD "0.1"
69# define REMAPPER_TEST_NWS_PERIOD "0.01"
73 "name /testRemapperRobot/a\n"
77 "name /testRemapperRobot/b\n"
81 "name /testRemapperRobot/c\n"
115 setPosition[i] = i*100.0+50.0 +
rand;
116 setTrajSpeeds[i] = i*10.0+5 +
rand;
135 for(
int wait=0; wait < 300; wait++)
142 if (match) {
break; }
180 for(
int wait=0; wait < 300; wait++)
226 setPosition[i] = i*100.0+50.0 +
rand;
227 setTrajSpeeds[i] = i*10.0+5 +
rand;
268TEST_CASE(
"dev::remotecontrolboardremapperTest",
"[yarp::dev]")
275 Network::setLocalMode(
true);
277 SECTION(
"Test the remotecontrolboardremapper with fakeMotionControl")
281 std::vector<std::unique_ptr<PolyDriver>>
fmcbs;
282 std::vector<std::unique_ptr<PolyDriver>>
wrappers;
302 for(
int i=0; i < 3; i++)
304 fmcbs[i] = std::make_unique<PolyDriver>();
323 wrappers[i] = std::make_unique<PolyDriver>();
344 for(
int i=0; i < 3; i++)
370 pRemoteRemapper.put(
"localPortPrefix",
"/test/remoteControlBoardRemapper");
373 opts.put(
"writeStrict",
"on");
383 for(
int i=0; i < 3; i++)
387 for(
int i=0; i < 3; i++)
393 SECTION(
"Test the remotecontrolboardremapper with fakeMotionControlMicro")
397 std::vector<std::unique_ptr<PolyDriver>>
fmcbs;
398 std::vector<std::unique_ptr<PolyDriver>>
wrappers;
408 fmcbsNames.push_back(
"fakeControlBoardAMicro");
409 fmcbsNames.push_back(
"fakeControlBoardBMicro");
410 fmcbsNames.push_back(
"fakeControlBoardCMicro");
418 for(
int i=0; i < 3; i++)
420 fmcbs[i] = std::make_unique<PolyDriver>();
443 wrappers[i] = std::make_unique<PolyDriver>();
464 for(
int i=0; i < 3; i++)
490 pRemoteRemapper.put(
"localPortPrefix",
"/test/remoteControlBoardRemapper");
493 opts.put(
"writeStrict",
"on");
503 for(
int i=0; i < 3; i++)
507 for(
int i=0; i < 3; i++)
513 Network::setLocalMode(
false);
define control board standard interfaces
Interface for getting information about specific axes, if available.
Interface for setting control mode in control board.
Control board, encoder interface.
virtual yarp::dev::ReturnValue getEncoders(double *encs)=0
Read the position of all axes.
Interface for an object that can wrap/attach to to another.
Interface for a generic control board device implementing position control.
virtual yarp::dev::ReturnValue setTrajSpeeds(const double *spds)=0
Set reference speed on all joints.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
Interface for a generic control board device implementing position control.
A container for a device driver.
A simple collection of objects that can be described and transmitted in a portable way.
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.
void fromConfig(const char *txt, bool wipe=true)
Parses text in the configuration format described in fromConfigFile().
void wait_safe(const double seconds)
For streams capable of holding different kinds of content, check what they actually have.
SelectableControlModeEnum
@ VOCAB_CM_POSITION_DIRECT
void delay(double seconds)
Wait for a certain number of seconds.
An interface to the operating system, including Port based communication.
const char * wrapperC_file_content
static void checkRemapperMicro(yarp::dev::PolyDriver &ddRemapper, int rand, size_t nrOfRemappedAxes)
const char * fmcA_file_content_micro
const char * fmcA_file_content
TEST_CASE("dev::remotecontrolboardremapperTest", "[yarp::dev]")
#define REMAPPER_TEST_NWS_PERIOD
const char * fmcB_file_content_micro
const char * fmcB_file_content
const char * fmcC_file_content_micro
const char * fmcC_file_content
static void checkRemapper(yarp::dev::PolyDriver &ddRemapper, int rand, size_t nrOfRemappedAxes)
const char * wrapperA_file_content
const char * wrapperB_file_content