Skip to content

Commit

Permalink
Improved vector handling in paramParserGenerator, tests and devices
Browse files Browse the repository at this point in the history
  • Loading branch information
randaz81 committed Feb 26, 2024
1 parent 96a245c commit 252d593
Show file tree
Hide file tree
Showing 70 changed files with 1,432 additions and 419 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,31 @@ const char *fmcA_file_content = "device fakeMotionControl\n"
"[GENERAL]\n"
"Joints 2\n"
"\n"
"AxisName \"axisA1\" \"axisA2\" \n";
"AxisName (\"axisA1\" \"axisA2\") \n";

const char *fmcB_file_content = "device fakeMotionControl\n"
"[GENERAL]\n"
"Joints 3\n"
"\n"
"AxisName \"axisB1\" \"axisB2\" \"axisB3\"\n";
"AxisName (\"axisB1\" \"axisB2\" \"axisB3\") \n";

const char *fmcC_file_content = "device fakeMotionControl\n"
"[GENERAL]\n"
"Joints 4\n"
"\n"
"AxisName \"axisC1\" \"axisC2\" \"axisC3\" \"axisC4\" \n";
"AxisName (\"axisC1\" \"axisC2\" \"axisC3\" \"axisC4\") \n";

const char *wrapperA_file_content = "device controlBoard_nws_yarp\n"
"name /testRemapperRobot/a\n"
"period 0.01\n"
"networks (net_a)\n"
"joints 2\n"
"net_a 0 1 0 1\n";
"period 0.01\n";

const char *wrapperB_file_content = "device controlBoard_nws_yarp\n"
"name /testRemapperRobot/b\n"
"period 0.01\n"
"networks (net_b)\n"
"joints 3\n"
"net_b 0 2 0 2\n";
"period 0.01\n";

const char *wrapperC_file_content = "device controlBoard_nws_yarp\n"
"name /testRemapperRobot/c\n"
"period 0.01\n"
"networks (net_c)\n"
"joints 4\n"
"net_c 0 3 0 3\n";
"period 0.01\n";


static void checkRemapper(yarp::dev::PolyDriver & ddRemapper, int rand, size_t nrOfRemappedAxes)
Expand Down Expand Up @@ -220,7 +211,7 @@ TEST_CASE("dev::ControlBoardRemapperTest", "[yarp::dev]")
PolyDriverList pdList;
pdList.push(fmcbs[i],wrapperNetworks[i].c_str());

CHECK(iwrap->attachAll(pdList)); // controlBoard_nws_yarp attached successfully to the device
REQUIRE(iwrap->attachAll(pdList)); // controlBoard_nws_yarp attached successfully to the device
}

// Create a list containing all the fake controlboards
Expand Down Expand Up @@ -252,7 +243,7 @@ TEST_CASE("dev::ControlBoardRemapperTest", "[yarp::dev]")
REQUIRE(ddRemapperWN.view(imultwrapWN)); // interface for multiple wrapper with wrong names correctly opened
REQUIRE(imultwrapWN);

CHECK_FALSE(imultwrapWN->attachAll(fmcList)); // attachAll for controlboardremapper with wrong names successful
REQUIRE_FALSE(imultwrapWN->attachAll(fmcList)); // attachAll for controlboardremapper with wrong names successful

// Make sure that a controlboard in which attachAll is not successfull
// closes correctly
Expand All @@ -278,7 +269,7 @@ TEST_CASE("dev::ControlBoardRemapperTest", "[yarp::dev]")
REQUIRE(ddRemapper.view(imultwrap)); // interface for multiple wrapper correctly opened
REQUIRE(imultwrap);

CHECK(imultwrap->attachAll(fmcList)); // attachAll for controlboardremapper successful
REQUIRE(imultwrap->attachAll(fmcList)); // attachAll for controlboardremapper successful


// Test the controlboardremapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:27:58 2024
// Generated on: Mon Feb 26 23:24:44 2024


#include "FakeAnalogSensor_ParamsParser.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:27:58 2024
// Generated on: Mon Feb 26 23:24:44 2024


#ifndef FAKEANALOGSENSOR_PARAMSPARSER_H
Expand Down
2 changes: 1 addition & 1 deletion src/devices/fake/fakeBattery/FakeBattery_ParamsParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:27:58 2024
// Generated on: Mon Feb 26 23:24:44 2024


#include "FakeBattery_ParamsParser.h"
Expand Down
2 changes: 1 addition & 1 deletion src/devices/fake/fakeBattery/FakeBattery_ParamsParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:27:58 2024
// Generated on: Mon Feb 26 23:24:44 2024


#ifndef FAKEBATTERY_PARAMSPARSER_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:27:58 2024
// Generated on: Mon Feb 26 23:24:43 2024


#include "FakeChatBotDevice_ParamsParser.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:27:58 2024
// Generated on: Mon Feb 26 23:24:43 2024


#ifndef FAKECHATBOTDEVICE_PARAMSPARSER_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:27:58 2024
// Generated on: Mon Feb 26 23:24:43 2024


#include "FakeDepthCameraDriver_ParamsParser.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:27:58 2024
// Generated on: Mon Feb 26 23:24:43 2024


#ifndef FAKEDEPTHCAMERADRIVER_PARAMSPARSER_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// This is an automatically generated file. Please do not edit it.
// It will be re-generated if the cmake flag ALLOW_DEVICE_PARAM_PARSER_GERNERATION is ON.

// Generated on: Mon Feb 19 16:28:00 2024
// Generated on: Mon Feb 26 23:24:46 2024


#include "FakeFrameGrabber_ParamsParser.h"
Expand Down Expand Up @@ -576,7 +576,7 @@ std::string FakeFrameGrabber_ParamsParser::getDocumentationOfDeviceParams()
doc = doc + std::string("'rectificationMatrix': Matrix that describes the lens' distortion\n");
doc = doc + std::string("\n");
doc = doc + std::string("Here are some examples of invocation command with yarpdev, with all params:\n");
doc = doc + " yarpdev --device fakeFrameGrabber --width 320 --height 240 --horizontalFov 1.0 --verticalFov 2.0 --fakeFrameGrabber_rpc_port /fakeFrameGrabber/rpc --mirror false --syncro false --topIsLow true --physFocalLength 3.0 --focalLengthX 4.0 --focalLengthY 5.0 --principalPointX 6.0 --principalPointY 7.0 --distortionModel FishEye --k1 8.0 --k2 9.0 --k3 10.0 --t1 11.0 --t2 12.0 --freq 0 --period 0 --mode [line] --src <optional_value> --add_timestamp false --add_noise false --bayer false --mono false --snr 0.5 --rectificationMatrix \" 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 \"\n";
doc = doc + " yarpdev --device fakeFrameGrabber --width 320 --height 240 --horizontalFov 1.0 --verticalFov 2.0 --fakeFrameGrabber_rpc_port /fakeFrameGrabber/rpc --mirror false --syncro false --topIsLow true --physFocalLength 3.0 --focalLengthX 4.0 --focalLengthY 5.0 --principalPointX 6.0 --principalPointY 7.0 --distortionModel FishEye --k1 8.0 --k2 9.0 --k3 10.0 --t1 11.0 --t2 12.0 --freq 0 --period 0 --mode [line] --src <optional_value> --add_timestamp false --add_noise false --bayer false --mono false --snr 0.5 --rectificationMatrix \" (1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0) \"\n";
doc = doc + std::string("Using only mandatory params:\n");
doc = doc + " yarpdev --device fakeFrameGrabber\n";
doc = doc + std::string("=============================================\n\n"); return doc;
Expand Down
Loading

0 comments on commit 252d593

Please sign in to comment.