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";
59 "name /testRemapperRobot/a\n"
63 "name /testRemapperRobot/b\n"
67 "name /testRemapperRobot/c\n"
101 setPosition[i] = i*100.0+50.0 +
rand;
102 setTrajSpeeds[i] = i*10.0+5 +
rand;
194 setPosition[i] = i*100.0+50.0 +
rand;
195 setTrajSpeeds[i] = i*10.0+5 +
rand;
236TEST_CASE(
"dev::ControlBoardRemapperTest",
"[yarp::dev]")
243 Network::setLocalMode(
true);
245 SECTION(
"Test the controlboard remapper")
249 std::vector<std::unique_ptr<PolyDriver>>
fmcbs;
250 std::vector<std::unique_ptr<PolyDriver>>
wrappers;
270 for(
int i=0; i < 3; i++)
272 fmcbs[i] = std::make_unique<PolyDriver>();
291 wrappers[i] = std::make_unique<PolyDriver>();
312 for(
int i=0; i < 3; i++)
330 axesListWN.addString(
"thisIsAnAxisNameThatDoNotExist");
347 pRemapper.put(
"device",
"controlboardremapper");
374 for(
int i=0; i < 3; i++)
378 for(
int i=0; i < 3; i++)
384 SECTION(
"Test the controlboard remapper micro")
388 std::vector<std::unique_ptr<PolyDriver>>
fmcbs;
389 std::vector<std::unique_ptr<PolyDriver>>
wrappers;
399 fmcbsNames.push_back(
"fakeControlBoardAMicro");
400 fmcbsNames.push_back(
"fakeControlBoardBMicro");
401 fmcbsNames.push_back(
"fakeControlBoardCMicro");
409 for(
int i=0; i < 3; i++)
411 fmcbs[i] = std::make_unique<PolyDriver>();
434 wrappers[i] = std::make_unique<PolyDriver>();
455 for(
int i=0; i < 3; i++)
473 axesListWN.addString(
"thisIsAnAxisNameThatDoNotExist");
490 pRemapper.put(
"device",
"controlboardremapper");
517 for(
int i=0; i < 3; i++)
521 for(
int i=0; i < 3; i++)
527 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().
const char * wrapperC_file_content
static void checkRemapperMicro(yarp::dev::PolyDriver &ddRemapper, int rand, size_t nrOfRemappedAxes)
TEST_CASE("dev::ControlBoardRemapperTest", "[yarp::dev]")
const char * fmcA_file_content_micro
const char * fmcA_file_content
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
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.