From 343fa88871bea72e0119de346cfe5695a5bc3a99 Mon Sep 17 00:00:00 2001 From: Ugo Pattacini Date: Mon, 22 Nov 2021 15:22:57 +0100 Subject: [PATCH] upgrade to yarp-3.5.1 --- CMakeLists.txt | 2 +- example/cpp/ExampleFixture/CMakeLists.txt | 2 +- example/cpp/ExampleFixture/ExampleFixture.cpp | 2 +- example/cpp/ExampleTest/CMakeLists.txt | 2 +- src/camera/CameraTest.cpp | 6 +- src/controlModes/ControlModes.cpp | 18 +++--- src/demoRedBall/DemoRedBallTest.cpp | 22 ++++---- src/jointLimits/jointLimits.cpp | 14 ++--- src/motor-stiction/MotorStiction.cpp | 26 ++++----- src/motor-tests/MotorTest.cpp | 14 ++--- .../motorEncodersConsistency.cpp | 18 +++--- .../motorEncodersSignCheck.cpp | 14 ++--- .../movementReferencesTest.cpp | 14 ++--- .../OpenloopConsistency.cpp | 8 +-- .../opticalEncodersDrift.cpp | 14 ++--- src/ports-frequency/PortsFrequency.cpp | 6 +- .../PositionControlAccuracyExternalPid.cpp | 56 +++++++++---------- .../PositionControlAccuracy.cpp | 46 +++++++-------- src/positionDirect/PositionDirect.cpp | 16 +++--- .../SensorsDuplicateReadings.cpp | 4 +- src/system-status/SystemStatus.cpp | 2 +- .../TorqueControlAccuracy.cpp | 34 +++++------ .../TorqueControlConsistency.cpp | 4 +- .../TorqueControlStiffDampCheck.cpp | 52 ++++++++--------- 24 files changed, 198 insertions(+), 198 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73f8d327..cba21d5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ cmake_minimum_required(VERSION 3.5) project(iCub-Tests) find_package(RobotTestingFramework 2 COMPONENTS DLL REQUIRED) -find_package(YARP 3.3.2 COMPONENTS os math robottestingframework REQUIRED) +find_package(YARP 3.5.1 COMPONENTS os math robottestingframework REQUIRED) # set the output plugin directory to collect all the shared libraries set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins) diff --git a/example/cpp/ExampleFixture/CMakeLists.txt b/example/cpp/ExampleFixture/CMakeLists.txt index db85e6d4..6a6e3b33 100644 --- a/example/cpp/ExampleFixture/CMakeLists.txt +++ b/example/cpp/ExampleFixture/CMakeLists.txt @@ -25,7 +25,7 @@ project(ExampleFixture) # add the required cmake packages find_package(RobotTestingFramework 2 COMPONENTS DLL) -find_package(YARP 3.3.0 COMPONENTS os robottestingframework) +find_package(YARP 3.5.1 COMPONENTS os robottestingframework) # add the source codes to build the plugin library add_library(${PROJECT_NAME} MODULE ExampleFixture.h diff --git a/example/cpp/ExampleFixture/ExampleFixture.cpp b/example/cpp/ExampleFixture/ExampleFixture.cpp index e76817e3..a7c636c8 100644 --- a/example/cpp/ExampleFixture/ExampleFixture.cpp +++ b/example/cpp/ExampleFixture/ExampleFixture.cpp @@ -40,7 +40,7 @@ bool ExampleFixture::setup(int argc, char** argv) { printf("ExampleFixture: missing 'probability' param.\n"); return false; } - probability = prop.find("probability").asDouble(); + probability = prop.find("probability").asFloat64(); Random::seed(time(NULL)); return true; } diff --git a/example/cpp/ExampleTest/CMakeLists.txt b/example/cpp/ExampleTest/CMakeLists.txt index 4b72ca5f..94600210 100644 --- a/example/cpp/ExampleTest/CMakeLists.txt +++ b/example/cpp/ExampleTest/CMakeLists.txt @@ -25,7 +25,7 @@ project(ExampleTest) # add the required cmake packages find_package(RobotTestingFramework 2 COMPONENTS DLL) -find_package(YARP 3.3.0 COMPONENTS os robottestingframework) +find_package(YARP 3.5.1 COMPONENTS os robottestingframework) # add the source codes to build the plugin library add_library(${PROJECT_NAME} MODULE ExampleTest.h diff --git a/src/camera/CameraTest.cpp b/src/camera/CameraTest.cpp index 3fc35e2f..d14bc85a 100644 --- a/src/camera/CameraTest.cpp +++ b/src/camera/CameraTest.cpp @@ -55,9 +55,9 @@ bool CameraTest::setup(yarp::os::Property& property) { ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(property.check("portname"), "The portname must be given as the test paramter!"); cameraPortName = property.find("portname").asString(); - measure_time = property.check("measure_time") ? property.find("measure_time").asInt() : TIMES; - expected_frequency = property.check("expected_frequency") ? property.find("expected_frequency").asInt() : FREQUENCY; - tolerance = property.check("tolerance") ? property.find("tolerance").asInt() : TOLERANCE; + measure_time = property.check("measure_time") ? property.find("measure_time").asInt32() : TIMES; + expected_frequency = property.check("expected_frequency") ? property.find("expected_frequency").asInt32() : FREQUENCY; + tolerance = property.check("tolerance") ? property.find("tolerance").asInt32() : TOLERANCE; // opening port ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(port.open("/CameraTest/image:i"), diff --git a/src/controlModes/ControlModes.cpp b/src/controlModes/ControlModes.cpp index bd6920bf..8b5082e5 100644 --- a/src/controlModes/ControlModes.cpp +++ b/src/controlModes/ControlModes.cpp @@ -68,7 +68,7 @@ bool ControlModes::setup(yarp::os::Property& property) { robotName = property.find("robot").asString(); partName = property.find("part").asString(); if(property.check("tolerance")) - tolerance = property.find("tolerance").asDouble(); + tolerance = property.find("tolerance").asFloat64(); else tolerance = 0.5; @@ -121,10 +121,10 @@ bool ControlModes::setup(yarp::os::Property& property) { jointTorqueCtrlEnabled = new int[n_part_joints]; home_pos = new double[n_cmd_joints]; - for (int i=0; i get(i).asInt(); + for (int i=0; i get(i).asInt32(); Bottle* homePosBottle = property.find("home").asList(); - for (int i=0; i get(i).asDouble(); + for (int i=0; i get(i).asFloat64(); checkJointWithTorqueMode(); return true; @@ -222,14 +222,14 @@ void ControlModes::verifyMode(int desired_control_mode, yarp::dev::InteractionMo if (timeout>100) { char sbuf[500]; - sprintf(sbuf,"Test (%s) failed: current mode is (%s,%s), it should be (%s,%s)",title.c_str(), Vocab::decode((NetInt32)cmode).c_str(), Vocab::decode((NetInt32)imode).c_str(), Vocab::decode((NetInt32)desired_control_mode).c_str(),Vocab::decode((NetInt32)desired_interaction_mode).c_str()); + sprintf(sbuf,"Test (%s) failed: current mode is (%s,%s), it should be (%s,%s)",title.c_str(), Vocab32::decode((NetInt32)cmode).c_str(), Vocab32::decode((NetInt32)imode).c_str(), Vocab32::decode((NetInt32)desired_control_mode).c_str(),Vocab32::decode((NetInt32)desired_interaction_mode).c_str()); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR(sbuf); } yarp::os::Time::delay(0.2); timeout++; } char sbuf[500]; - sprintf(sbuf,"Test (%s) passed: current mode is (%s,%s)",title.c_str(),Vocab::decode((NetInt32)desired_control_mode).c_str(), Vocab::decode((NetInt32)desired_interaction_mode).c_str()); + sprintf(sbuf,"Test (%s) passed: current mode is (%s,%s)",title.c_str(),Vocab32::decode((NetInt32)desired_control_mode).c_str(), Vocab32::decode((NetInt32)desired_interaction_mode).c_str()); ROBOTTESTINGFRAMEWORK_TEST_REPORT(sbuf); } @@ -250,14 +250,14 @@ void ControlModes::verifyModeSingle(int joint, int desired_control_mode, yarp::d if (timeout>100) { char sbuf[500]; - sprintf(sbuf,"Test (%s) failed: current mode is (%s,%s), it should be (%s,%s)",title.c_str(), Vocab::decode((NetInt32)cmode).c_str(), Vocab::decode((NetInt32)imode).c_str(), Vocab::decode((NetInt32)desired_control_mode).c_str(),Vocab::decode((NetInt32)desired_interaction_mode).c_str()); + sprintf(sbuf,"Test (%s) failed: current mode is (%s,%s), it should be (%s,%s)",title.c_str(), Vocab32::decode((NetInt32)cmode).c_str(), Vocab32::decode((NetInt32)imode).c_str(), Vocab32::decode((NetInt32)desired_control_mode).c_str(),Vocab32::decode((NetInt32)desired_interaction_mode).c_str()); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR(sbuf); } yarp::os::Time::delay(0.2); timeout++; } char sbuf[500]; - sprintf(sbuf,"Test (%s) passed: current mode is (%s,%s)",title.c_str(),Vocab::decode((NetInt32)desired_control_mode).c_str(), Vocab::decode((NetInt32)desired_interaction_mode).c_str()); + sprintf(sbuf,"Test (%s) passed: current mode is (%s,%s)",title.c_str(),Vocab32::decode((NetInt32)desired_control_mode).c_str(), Vocab32::decode((NetInt32)desired_interaction_mode).c_str()); ROBOTTESTINGFRAMEWORK_TEST_REPORT(sbuf); } @@ -274,7 +274,7 @@ void ControlModes::checkJointWithTorqueMode() yarp::os::Bottle *baux = b.get(i).asList(); for(int k=0; ksize()&& jget(k).asInt(); + jointTorqueCtrlEnabled[j] = baux->get(k).asInt32(); j++; } } @@ -377,7 +377,7 @@ void ControlModes::checkControlModeWithImCompliant(int desired_control_mode, std { if(jointTorqueCtrlEnabled[jointsList[i]]) { - sprintf(buff, "joint %d has torque enabled. try to set %s and im_comp", jointsList[i], Vocab::decode((NetInt32)desired_control_mode).c_str()); + sprintf(buff, "joint %d has torque enabled. try to set %s and im_comp", jointsList[i], Vocab32::decode((NetInt32)desired_control_mode).c_str()); ROBOTTESTINGFRAMEWORK_TEST_REPORT(buff); setModeSingle(jointsList[i],desired_control_mode,VOCAB_IM_COMPLIANT); verifyModeSingle(jointsList[i], desired_control_mode,VOCAB_IM_COMPLIANT,title); diff --git a/src/demoRedBall/DemoRedBallTest.cpp b/src/demoRedBall/DemoRedBallTest.cpp index cffcf2a0..f4b473d8 100644 --- a/src/demoRedBall/DemoRedBallTest.cpp +++ b/src/demoRedBall/DemoRedBallTest.cpp @@ -86,7 +86,7 @@ bool DemoRedBallTest::setup(Property &property) { params.robot=general.check("robot",Value(params.robot)).asString(); params.eye=general.check("eye",Value(params.eye)).asString(); - params.reach_tol=general.check("reach_tol",Value(params.reach_tol)).asDouble(); + params.reach_tol=general.check("reach_tol",Value(params.reach_tol)).asFloat64(); params.use_torso=(general.check("torso",Value(params.use_torso?"on":"off")).asString()=="on"); params.use_left=(general.check("left_arm",Value(params.use_left?"on":"off")).asString()=="on"); params.use_right=(general.check("right_arm",Value(params.use_right?"on":"off")).asString()=="on"); @@ -99,7 +99,7 @@ bool DemoRedBallTest::setup(Property &property) { Bottle &poss=home_arm.findGroup("poss"); for (size_t i=0; iget(0).isString() && (b->get(0).asString()=="object")) { pos.resize(3); - pos[0]=b->get(5).asDouble()/1000.; - pos[1]=b->get(6).asDouble()/1000.; - pos[2]=b->get(7).asDouble()/1000.; + pos[0]=b->get(5).asFloat64()/1000.; + pos[1]=b->get(6).asFloat64()/1000.; + pos[2]=b->get(7).asFloat64()/1000.; return true; } } @@ -229,18 +229,18 @@ void DemoRedBallTest::testBallPosition(const Vector &dpos) Bottle cmd,rep; cmd.addString("update_pose"); - cmd.addDouble(dpos[0]); - cmd.addDouble(dpos[1]); - cmd.addDouble(dpos[2]); + cmd.addFloat64(dpos[0]); + cmd.addFloat64(dpos[1]); + cmd.addFloat64(dpos[2]); rpcPort.write(cmd,rep); Time::delay(3.0); cmd.clear(); cmd.addString("start"); - cmd.addDouble(0.); - cmd.addDouble(-50.); - cmd.addDouble(10.); + cmd.addFloat64(0.); + cmd.addFloat64(-50.); + cmd.addFloat64(10.); rpcPort.write(cmd,rep); auto filt = make_unique(5, Vector{0., 0., 0.}); diff --git a/src/jointLimits/jointLimits.cpp b/src/jointLimits/jointLimits.cpp index 30e29994..c9488942 100644 --- a/src/jointLimits/jointLimits.cpp +++ b/src/jointLimits/jointLimits.cpp @@ -90,7 +90,7 @@ bool JointLimits::setup(yarp::os::Property& property) { Bottle* outputLimitBottle = property.find("outputLimitPercent").asList(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(outputLimitBottle!=0,"unable to parse speed parameter"); - tolerance = property.find("tolerance").asDouble(); + tolerance = property.find("tolerance").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(tolerance>=0,"invalid tolerance"); Bottle* toleranceListBottle = property.find("toleranceList").asList(); //optional param @@ -116,22 +116,22 @@ bool JointLimits::setup(yarp::os::Property& property) { int n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(n_cmd_joints>0 && n_cmd_joints<=n_part_joints,"invalid number of joints, it must be >0 & <= number of part joints"); - for (int i=0; i get(i).asInt()); + for (int i=0; i get(i).asInt32()); enc_jnt.resize(n_part_joints); max_lims.resize(n_cmd_joints); min_lims.resize(n_cmd_joints); - home.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asDouble(); - speed.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) speed[i]=speedBottle->get(i).asDouble(); - outputLimit.resize(n_cmd_joints);for (int i=0; i< n_cmd_joints; i++) outputLimit[i]=outputLimitBottle->get(i).asDouble(); - outOfBoundPos.resize(n_cmd_joints); for (int i = 0; i < n_cmd_joints; i++) { outOfBoundPos[i] = outOfBoundPosition->get(i).asDouble(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(outOfBoundPos[i] > 0 , "outOfBoundPosition must be > 0"); } + home.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asFloat64(); + speed.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) speed[i]=speedBottle->get(i).asFloat64(); + outputLimit.resize(n_cmd_joints);for (int i=0; i< n_cmd_joints; i++) outputLimit[i]=outputLimitBottle->get(i).asFloat64(); + outOfBoundPos.resize(n_cmd_joints); for (int i = 0; i < n_cmd_joints; i++) { outOfBoundPos[i] = outOfBoundPosition->get(i).asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(outOfBoundPos[i] > 0 , "outOfBoundPosition must be > 0"); } toleranceList.resize(n_cmd_joints); for (int i = 0; i < n_cmd_joints; i++) { if(toleranceListBottle) { - toleranceList[i] = toleranceListBottle->get(i).asDouble(); + toleranceList[i] = toleranceListBottle->get(i).asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(toleranceList[i] >= 0 , "toleranceList must be > 0"); } else diff --git a/src/motor-stiction/MotorStiction.cpp b/src/motor-stiction/MotorStiction.cpp index cc9fe850..51e8d878 100644 --- a/src/motor-stiction/MotorStiction.cpp +++ b/src/motor-stiction/MotorStiction.cpp @@ -70,7 +70,7 @@ bool MotorStiction::setup(yarp::os::Property& property) { robotName = property.find("robot").asString(); partName = property.find("part").asString(); - repeat = property.find("repeat").asInt(); + repeat = property.find("repeat").asInt32(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(repeat>=0,"repeat must be greater than zero"); Bottle* homeBottle = property.find("home").asList(); @@ -113,13 +113,13 @@ bool MotorStiction::setup(yarp::os::Property& property) { int n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(n_cmd_joints>0 && n_cmd_joints<=n_part_joints,"invalid number of joints, it must be >0 & <= number of part joints"); - for (int i=0; i get(i).asInt()); + for (int i=0; i get(i).asInt32()); - home.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asDouble(); - opl_step.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_step[i]=output_step_Bottle->get(i).asDouble(); - opl_delay.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_delay[i]=output_delay_Bottle->get(i).asDouble(); - opl_max.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_max[i]=output_max_Bottle->get(i).asDouble(); - movement_threshold.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) movement_threshold[i]=threshold_Bottle->get(i).asDouble(); + home.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asFloat64(); + opl_step.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_step[i]=output_step_Bottle->get(i).asFloat64(); + opl_delay.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_delay[i]=output_delay_Bottle->get(i).asFloat64(); + opl_max.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_max[i]=output_max_Bottle->get(i).asFloat64(); + movement_threshold.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) movement_threshold[i]=threshold_Bottle->get(i).asFloat64(); max_lims.resize(n_cmd_joints); min_lims.resize(n_cmd_joints); @@ -299,9 +299,9 @@ void MotorStiction::OplExecute(int i, std::vector& dataToPlotL } time = yarp::os::Time::now(); - v1.addDouble(time); - v2.addDouble(enc); - v2.addDouble(opl); + v1.addFloat64(time); + v2.addFloat64(enc); + v2.addFloat64(opl); yarp::os::Time::delay(0.010); if (time-time_old>5.0 && not_moving==true) @@ -369,9 +369,9 @@ void MotorStiction::OplExecute2(int i, std::vector& dataToPlot } time = yarp::os::Time::now(); - v1.addDouble(time); - v2.addDouble(enc); - v2.addDouble(opl); + v1.addFloat64(time); + v2.addFloat64(enc); + v2.addFloat64(opl); yarp::os::Time::delay(0.010); if (time-time_old>5.0 && not_moving==true) diff --git a/src/motor-tests/MotorTest.cpp b/src/motor-tests/MotorTest.cpp index 28f52859..f45a00d1 100644 --- a/src/motor-tests/MotorTest.cpp +++ b/src/motor-tests/MotorTest.cpp @@ -63,7 +63,7 @@ bool MotorTest::setup(yarp::os::Property &configuration) { ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(configuration.check("joints"), "Missing 'joints' parameter, cannot open device"); - m_NumJoints=configuration.find("joints").asInt(); + m_NumJoints=configuration.find("joints").asInt32(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(configuration.check("target"), "Missing 'target' parameter, cannot open device"); @@ -72,7 +72,7 @@ bool MotorTest::setup(yarp::os::Property &configuration) { m_aTargetVal=new double[m_NumJoints]; m_aHome=new double [m_NumJoints]; for (int i=0; i=0,"invalid tolerance"); - int matrix_size=property.find("matrix_size").asInt(); + int matrix_size=property.find("matrix_size").asInt32(); if (matrix_size>0) { matrix.resize(matrix_size,matrix_size); @@ -129,7 +129,7 @@ bool OpticalEncodersConsistency::setup(yarp::os::Property& property) { { for (int i=0; i< (matrix_size*matrix_size); i++) { - matrix.data()[i]=matrixBottle->get(i).asDouble(); + matrix.data()[i]=matrixBottle->get(i).asFloat64(); } } else @@ -146,7 +146,7 @@ bool OpticalEncodersConsistency::setup(yarp::os::Property& property) { //optional parameters if (property.check("cycles")) - {cycles = property.find("cycles").asInt();} + {cycles = property.find("cycles").asInt32();} Property options; options.put("device", "remote_controlboard"); @@ -170,7 +170,7 @@ bool OpticalEncodersConsistency::setup(yarp::os::Property& property) { int n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(n_cmd_joints>0 && n_cmd_joints<=n_part_joints,"invalid number of joints, it must be >0 & <= number of part joints"); jointsList.clear(); - for (int i=0; i get(i).asInt()); + for (int i=0; i get(i).asInt32()); enc_jnt.resize(n_cmd_joints); enc_jnt.zero(); enc_mot.resize(n_cmd_joints); enc_mot.zero(); @@ -190,10 +190,10 @@ bool OpticalEncodersConsistency::setup(yarp::os::Property& property) { zero_vector.resize(n_cmd_joints); zero_vector.zero(); - max.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) max[i]=maxBottle->get(i).asDouble(); - min.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) min[i]=minBottle->get(i).asDouble(); - home.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asDouble(); - speed.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) speed[i]=speedBottle->get(i).asDouble(); + max.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) max[i]=maxBottle->get(i).asFloat64(); + min.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) min[i]=minBottle->get(i).asFloat64(); + home.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asFloat64(); + speed.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) speed[i]=speedBottle->get(i).asFloat64(); gearbox.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) { diff --git a/src/motorEncodersSignCheck/motorEncodersSignCheck.cpp b/src/motorEncodersSignCheck/motorEncodersSignCheck.cpp index 2c57873e..7f610402 100644 --- a/src/motorEncodersSignCheck/motorEncodersSignCheck.cpp +++ b/src/motorEncodersSignCheck/motorEncodersSignCheck.cpp @@ -112,17 +112,17 @@ bool MotorEncodersSignCheck::setup(yarp::os::Property& property) { int n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(n_cmd_joints>0 && n_cmd_joints<=n_part_joints,"invalid number of joints, it must be >0 & <= number of part joints"); jointsList.clear(); - for (int i=0; i get(i).asInt()); + for (int i=0; i get(i).asInt32()); - home.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asDouble(); - opl_step.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_step[i]=pwm_step_Bottle->get(i).asDouble(); - opl_max.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_max[i]=pwm_max_Bottle->get(i).asDouble(); - opl_start.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_start[i]=pwm_start_Bottle->get(i).asDouble(); + home.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asFloat64(); + opl_step.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_step[i]=pwm_step_Bottle->get(i).asFloat64(); + opl_max.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_max[i]=pwm_max_Bottle->get(i).asFloat64(); + opl_start.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) opl_start[i]=pwm_start_Bottle->get(i).asFloat64(); pos_threshold.resize (n_cmd_joints); if(threshold_Bottle!=0) { for (int i=0; i< n_cmd_joints; i++) - pos_threshold[i]=threshold_Bottle->get(i).asDouble(); + pos_threshold[i]=threshold_Bottle->get(i).asFloat64(); } else { @@ -134,7 +134,7 @@ bool MotorEncodersSignCheck::setup(yarp::os::Property& property) { if(command_delay_Bottle!=0) { for (int i=0; i< n_cmd_joints; i++) - opl_delay[i]=command_delay_Bottle->get(i).asDouble(); + opl_delay[i]=command_delay_Bottle->get(i).asFloat64(); } else { diff --git a/src/movementReferencesTest/movementReferencesTest.cpp b/src/movementReferencesTest/movementReferencesTest.cpp index 279ac8f3..5a9dc496 100644 --- a/src/movementReferencesTest/movementReferencesTest.cpp +++ b/src/movementReferencesTest/movementReferencesTest.cpp @@ -137,26 +137,26 @@ bool MovementReferencesTest::setup(yarp::os::Property &config) jointsList.resize(numJoints); for (int i=0; i< numJoints; i++) { - jointsList[i]=jointsBottle->get(i).asInt(); + jointsList[i]=jointsBottle->get(i).asInt32(); } jList = new int[numJoints]; for (int i=0; i< numJoints; i++) { - jList[i]=jointsBottle->get(i).asInt(); + jList[i]=jointsBottle->get(i).asInt32(); } - //for (int i=0; i get(i).asInt()); + //for (int i=0; i get(i).asInt32()); - homePos.resize (numJoints); for (int i=0; i< numJoints; i++) homePos[i]=homeBottle->get(i).asDouble(); - targetPos.resize (numJoints); for (int i=0; i< numJoints; i++) targetPos[i]=targetBottle->get(i).asDouble(); - refVel.resize (numJoints); for (int i=0; i< numJoints; i++) refVel[i]=refVelBottle->get(i).asDouble(); + homePos.resize (numJoints); for (int i=0; i< numJoints; i++) homePos[i]=homeBottle->get(i).asFloat64(); + targetPos.resize (numJoints); for (int i=0; i< numJoints; i++) targetPos[i]=targetBottle->get(i).asFloat64(); + refVel.resize (numJoints); for (int i=0; i< numJoints; i++) refVel[i]=refVelBottle->get(i).asFloat64(); if(refAccBottle != NULL) { refAcc.resize (numJoints); - for (int i=0; i< numJoints; i++) refAcc[i]=refAccBottle->get(i).asDouble(); + for (int i=0; i< numJoints; i++) refAcc[i]=refAccBottle->get(i).asFloat64(); } else { diff --git a/src/openloop-consistency/OpenloopConsistency.cpp b/src/openloop-consistency/OpenloopConsistency.cpp index 6b734bbc..6d9ff486 100644 --- a/src/openloop-consistency/OpenloopConsistency.cpp +++ b/src/openloop-consistency/OpenloopConsistency.cpp @@ -115,8 +115,8 @@ bool OpenLoopConsistency::setup(yarp::os::Property& property) { prevcurr_tot=new double[n_part_joints]; prevcurr_some=new double[n_cmd_joints]; home=new double[n_cmd_joints]; - for (int i=0; i get(i).asInt(); - for (int i=0; i get(i).asDouble(); + for (int i=0; i get(i).asInt32(); + for (int i=0; i get(i).asFloat64(); return true; } @@ -161,14 +161,14 @@ void OpenLoopConsistency::verifyMode(int desired_control_mode, yarp::dev::Intera if (timeout>100) { char sbuf[500]; - sprintf(sbuf,"Test (%s) failed: current mode is (%s,%s), it should be (%s,%s)",title.c_str(), Vocab::decode((NetInt32)desired_control_mode).c_str(),Vocab::decode((NetInt32)desired_interaction_mode).c_str(), Vocab::decode((NetInt32)cmode).c_str(),Vocab::decode((NetInt32)imode).c_str()); + sprintf(sbuf,"Test (%s) failed: current mode is (%s,%s), it should be (%s,%s)",title.c_str(), Vocab32::decode((NetInt32)desired_control_mode).c_str(),Vocab32::decode((NetInt32)desired_interaction_mode).c_str(), Vocab32::decode((NetInt32)cmode).c_str(),Vocab32::decode((NetInt32)imode).c_str()); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR(sbuf); } yarp::os::Time::delay(0.2); timeout++; } char sbuf[500]; - sprintf(sbuf,"Test (%s) passed: current mode is (%s,%s)",title.c_str(), Vocab::decode((NetInt32)desired_control_mode).c_str(),Vocab::decode((NetInt32)desired_interaction_mode).c_str()); + sprintf(sbuf,"Test (%s) passed: current mode is (%s,%s)",title.c_str(), Vocab32::decode((NetInt32)desired_control_mode).c_str(),Vocab32::decode((NetInt32)desired_interaction_mode).c_str()); ROBOTTESTINGFRAMEWORK_TEST_REPORT(sbuf); } diff --git a/src/opticalEncoders-drift/opticalEncodersDrift.cpp b/src/opticalEncoders-drift/opticalEncodersDrift.cpp index a393dd7c..08c73251 100644 --- a/src/opticalEncoders-drift/opticalEncodersDrift.cpp +++ b/src/opticalEncoders-drift/opticalEncodersDrift.cpp @@ -93,10 +93,10 @@ bool OpticalEncodersDrift::setup(yarp::os::Property& property) { Bottle* speedBottle = property.find("speed").asList(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(speedBottle!=0,"unable to parse speed parameter"); - tolerance = property.find("tolerance").asDouble(); + tolerance = property.find("tolerance").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(tolerance>=0,"invalid tolerance"); - cycles = property.find("cycles").asInt(); + cycles = property.find("cycles").asInt32(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(cycles>=0,"invalid cycles"); if(property.check("plot_enabled")) @@ -131,7 +131,7 @@ bool OpticalEncodersDrift::setup(yarp::os::Property& property) { int n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(n_cmd_joints>0 && n_cmd_joints<=n_part_joints,"invalid number of joints, it must be >0 & <= number of part joints"); - for (int i=0; i get(i).asInt()); + for (int i=0; i get(i).asInt32()); enc_jnt.resize(n_part_joints); enc_mot.resize(n_part_joints); @@ -139,10 +139,10 @@ bool OpticalEncodersDrift::setup(yarp::os::Property& property) { end_enc_mot.resize(n_part_joints); err_enc_mot.resize(n_part_joints); - max.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) max[i]=maxBottle->get(i).asDouble(); - min.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) min[i]=minBottle->get(i).asDouble(); - home.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asDouble(); - speed.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) speed[i]=speedBottle->get(i).asDouble(); + max.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) max[i]=maxBottle->get(i).asFloat64(); + min.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) min[i]=minBottle->get(i).asFloat64(); + home.resize (n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) home[i]=homeBottle->get(i).asFloat64(); + speed.resize(n_cmd_joints); for (int i=0; i< n_cmd_joints; i++) speed[i]=speedBottle->get(i).asFloat64(); return true; } diff --git a/src/ports-frequency/PortsFrequency.cpp b/src/ports-frequency/PortsFrequency.cpp index a7c0b6ae..05271a18 100644 --- a/src/ports-frequency/PortsFrequency.cpp +++ b/src/ports-frequency/PortsFrequency.cpp @@ -46,7 +46,7 @@ bool PortsFrequency::setup(yarp::os::Property &property) { setName(property.find("name").asString()); // updating parameters - testTime = (property.check("time")) ? property.find("time").asDouble() : 2; + testTime = (property.check("time")) ? property.find("time").asFloat64() : 2; ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(property.check("PORTS"), "A list of the ports must be given"); @@ -57,8 +57,8 @@ bool PortsFrequency::setup(yarp::os::Property &property) { ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(btport && btport->size()>=3, "The ports must be given as lists of "); MyPortInfo info; info.name = btport->get(0).asString(); - info.frequency = btport->get(1).asInt(); - info.tolerance = btport->get(2).asInt(); + info.frequency = btport->get(1).asInt32(); + info.tolerance = btport->get(2).asInt32(); ports.push_back(info); } diff --git a/src/positionControl-accuracy-ExternalPid/PositionControlAccuracyExternalPid.cpp b/src/positionControl-accuracy-ExternalPid/PositionControlAccuracyExternalPid.cpp index a0d872f0..227cb581 100644 --- a/src/positionControl-accuracy-ExternalPid/PositionControlAccuracyExternalPid.cpp +++ b/src/positionControl-accuracy-ExternalPid/PositionControlAccuracyExternalPid.cpp @@ -74,13 +74,13 @@ bool PositionControlAccuracyExernalPid::setup(yarp::os::Property& property) { if(property.check("filename")) {m_requested_filename = property.find("filename").asString();} if(property.check("home_tolerance")) - {m_home_tolerance = property.find("home_tolerance").asDouble();} + {m_home_tolerance = property.find("home_tolerance").asFloat64();} if(property.check("step_duration")) - {m_step_duration = property.find("step_duration").asDouble();} + {m_step_duration = property.find("step_duration").asFloat64();} if(property.check("pid_vup")) - {m_pospid_vup = property.find("pid_vup").asDouble();} + {m_pospid_vup = property.find("pid_vup").asFloat64();} if(property.check("pid_vdown")) - {m_pospid_vdown = property.find("pid_vdown").asDouble();} + {m_pospid_vdown = property.find("pid_vdown").asFloat64();} m_robotName = property.find("robot").asString(); m_partName = property.find("part").asString(); @@ -92,12 +92,12 @@ bool PositionControlAccuracyExernalPid::setup(yarp::os::Property& property) { m_n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(m_n_cmd_joints>0, "invalid number of joints, it must be >0"); - m_step = property.find("step").asDouble(); + m_step = property.find("step").asFloat64(); - m_cycles = property.find("cycles").asInt(); + m_cycles = property.find("cycles").asInt32(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(m_cycles>0, "invalid cycles"); - m_sampleTime = property.find("sampleTime").asDouble(); + m_sampleTime = property.find("sampleTime").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(m_sampleTime>0, "invalid sampleTime"); Property options; @@ -122,22 +122,22 @@ bool PositionControlAccuracyExernalPid::setup(yarp::os::Property& property) { m_zeros = new double[m_n_part_joints]; m_encoders = new double[m_n_part_joints]; m_jointsList = new int[m_n_cmd_joints]; - for (int i = 0; i get(i).asInt(); - for (int i = 0; i get(i).asDouble(); + for (int i = 0; i get(i).asInt32(); + for (int i = 0; i get(i).asFloat64(); double p_Ts = m_sampleTime; yarp::sig::Vector p_Kp(1,0.0); yarp::sig::Vector p_Ki(1,0.0); yarp::sig::Vector p_Kd(1,0.0); if(property.check("Kp")) - {p_Kp = property.find("Kp").asDouble();} + {p_Kp = property.find("Kp").asFloat64();} if(property.check("Ki")) - {p_Ki = property.find("Ki").asDouble();} + {p_Ki = property.find("Ki").asFloat64();} if(property.check("Kd")) - {p_Kd = property.find("Kd").asDouble();} + {p_Kd = property.find("Kd").asFloat64();} double p_Max=100; if(property.check("MaxValue")) - {p_Max = property.find("MaxValue").asDouble();} + {p_Max = property.find("MaxValue").asFloat64();} yarp::sig::Vector p_Wp(1,1); yarp::sig::Vector p_Wi(1,1); yarp::sig::Vector p_Wd(1,1); @@ -309,28 +309,28 @@ void PositionControlAccuracyExernalPid::run() ipwm->setRefDutyCycle(m_jointsList[i], m_cmd_single); Bottle& b1 = dataToPlotRaw.addList(); - b1.addInt(cycle); - b1.addDouble(elapsed); - b1.addDouble(m_encoders[m_jointsList[i]]); - b1.addDouble(ref); - b1.addDouble(m_cmd_single); + b1.addInt32(cycle); + b1.addFloat64(elapsed); + b1.addFloat64(m_encoders[m_jointsList[i]]); + b1.addFloat64(ref); + b1.addFloat64(m_cmd_single); yarp::os::Time::delay(m_sampleTime); } //reorder data for (int t = 0; t < dataToPlotRaw.size(); t++) { - int cycle = dataToPlotRaw.get(t).asList()->get(0).asInt(); - double time = dataToPlotRaw.get(t).asList()->get(1).asDouble(); - double val = dataToPlotRaw.get(t).asList()->get(2).asDouble(); - double cmd = dataToPlotRaw.get(t).asList()->get(3).asDouble(); - double duty = dataToPlotRaw.get(t).asList()->get(4).asDouble(); + int cycle = dataToPlotRaw.get(t).asList()->get(0).asInt32(); + double time = dataToPlotRaw.get(t).asList()->get(1).asFloat64(); + double val = dataToPlotRaw.get(t).asList()->get(2).asFloat64(); + double cmd = dataToPlotRaw.get(t).asList()->get(3).asFloat64(); + double duty = dataToPlotRaw.get(t).asList()->get(4).asFloat64(); Bottle& b1 = dataToPlotSync.addList(); - b1.addInt(cycle); - b1.addDouble(time - time_zero); - b1.addDouble(val); - b1.addDouble(cmd); - b1.addDouble(duty); + b1.addInt32(cycle); + b1.addFloat64(time - time_zero); + b1.addFloat64(val); + b1.addFloat64(cmd); + b1.addFloat64(duty); } m_dataToSave.append(dataToPlotSync); diff --git a/src/positionControl-accuracy/PositionControlAccuracy.cpp b/src/positionControl-accuracy/PositionControlAccuracy.cpp index a7265871..954270ef 100644 --- a/src/positionControl-accuracy/PositionControlAccuracy.cpp +++ b/src/positionControl-accuracy/PositionControlAccuracy.cpp @@ -71,9 +71,9 @@ bool PositionControlAccuracy::setup(yarp::os::Property& property) { if(property.check("filename")) {m_requested_filename = property.find("filename").asString();} if(property.check("home_tolerance")) - {m_home_tolerance = property.find("home_tolerance").asDouble();} + {m_home_tolerance = property.find("home_tolerance").asFloat64();} if(property.check("step_duration")) - {m_step_duration = property.find("step_duration").asDouble();} + {m_step_duration = property.find("step_duration").asFloat64();} m_robotName = property.find("robot").asString(); m_partName = property.find("part").asString(); @@ -85,12 +85,12 @@ bool PositionControlAccuracy::setup(yarp::os::Property& property) { m_n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(m_n_cmd_joints>0, "invalid number of joints, it must be >0"); - m_step = property.find("step").asDouble(); + m_step = property.find("step").asFloat64(); - m_cycles = property.find("cycles").asInt(); + m_cycles = property.find("cycles").asInt32(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(m_cycles>0, "invalid cycles"); - m_sampleTime = property.find("sampleTime").asDouble(); + m_sampleTime = property.find("sampleTime").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(m_sampleTime>0, "invalid sampleTime"); Property options; @@ -115,8 +115,8 @@ bool PositionControlAccuracy::setup(yarp::os::Property& property) { m_zeros = new double[m_n_part_joints]; m_encoders = new double[m_n_part_joints]; m_jointsList = new int[m_n_cmd_joints]; - for (int i = 0; i get(i).asInt(); - for (int i = 0; i get(i).asDouble(); + for (int i = 0; i get(i).asInt32(); + for (int i = 0; i get(i).asFloat64(); double p_Kp=std::nanf(""); double p_Ki=std::nanf(""); @@ -128,13 +128,13 @@ bool PositionControlAccuracy::setup(yarp::os::Property& property) { m_new_pid=m_orig_pid; if(property.check("Kp")) - {p_Kp = property.find("Kp").asDouble();} + {p_Kp = property.find("Kp").asFloat64();} if(property.check("Ki")) - {p_Ki = property.find("Ki").asDouble();} + {p_Ki = property.find("Ki").asFloat64();} if(property.check("Kd")) - {p_Kd = property.find("Kd").asDouble();} + {p_Kd = property.find("Kd").asFloat64();} //if(property.check("MaxValue")) - // {p_Max = property.find("MaxValue").asDouble();} + // {p_Max = property.find("MaxValue").asFloat64();} if (std::isnan(p_Kp)==false) {m_new_pid.kp=p_Kp;} if (std::isnan(p_Kd)==false) {m_new_pid.kd=p_Kd;} if (std::isnan(p_Ki)==false) {m_new_pid.ki=p_Ki;} @@ -270,25 +270,25 @@ void PositionControlAccuracy::run() idir->setPosition(m_jointsList[i], m_cmd_single); Bottle& b1 = dataToPlotRaw.addList(); - b1.addInt(cycle); - b1.addDouble(elapsed); - b1.addDouble(m_encoders[m_jointsList[i]]); - b1.addDouble(m_cmd_single); + b1.addInt32(cycle); + b1.addFloat64(elapsed); + b1.addFloat64(m_encoders[m_jointsList[i]]); + b1.addFloat64(m_cmd_single); yarp::os::Time::delay(m_sampleTime); } //reorder data for (int t = 0; t < dataToPlotRaw.size(); t++) { - int cycle = dataToPlotRaw.get(t).asList()->get(0).asInt(); - double time = dataToPlotRaw.get(t).asList()->get(1).asDouble(); - double val = dataToPlotRaw.get(t).asList()->get(2).asDouble(); - double cmd = dataToPlotRaw.get(t).asList()->get(3).asDouble(); + int cycle = dataToPlotRaw.get(t).asList()->get(0).asInt32(); + double time = dataToPlotRaw.get(t).asList()->get(1).asFloat64(); + double val = dataToPlotRaw.get(t).asList()->get(2).asFloat64(); + double cmd = dataToPlotRaw.get(t).asList()->get(3).asFloat64(); Bottle& b1 = dataToPlotSync.addList(); - b1.addInt(cycle); - b1.addDouble(time - time_zero); - b1.addDouble(val); - b1.addDouble(cmd); + b1.addInt32(cycle); + b1.addFloat64(time - time_zero); + b1.addFloat64(val); + b1.addFloat64(cmd); } m_dataToSave.append(dataToPlotSync); diff --git a/src/positionDirect/PositionDirect.cpp b/src/positionDirect/PositionDirect.cpp index 47dc4041..3b23abaf 100644 --- a/src/positionDirect/PositionDirect.cpp +++ b/src/positionDirect/PositionDirect.cpp @@ -74,24 +74,24 @@ bool PositionDirect::setup(yarp::os::Property& property) { n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(n_cmd_joints>0,"invalid number of joints, it must be >0"); - frequency = property.find("frequency").asDouble(); + frequency = property.find("frequency").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(frequency>0,"invalid frequency"); - amplitude = property.find("amplitude").asDouble(); + amplitude = property.find("amplitude").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(amplitude>0,"invalid amplitude"); - zero = property.find("zero").asDouble(); + zero = property.find("zero").asFloat64(); - cycles = property.find("cycles").asDouble(); + cycles = property.find("cycles").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(cycles>0,"invalid cycles"); - tolerance = property.find("tolerance").asDouble(); + tolerance = property.find("tolerance").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(tolerance>0,"invalid tolerance"); - sampleTime = property.find("sampleTime").asDouble(); + sampleTime = property.find("sampleTime").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(sampleTime>0,"invalid sampleTime"); - cmd_mode = (cmd_mode_t) property.find("cmdMode").asInt(); + cmd_mode = (cmd_mode_t) property.find("cmdMode").asInt32(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(cmd_mode>=0 && cmd_mode<=2,"invalid cmdMode: can be 0=single_joint, 1=all_joints ,2=some_joints"); Property options; @@ -126,7 +126,7 @@ bool PositionDirect::setup(yarp::os::Property& property) { pos_tot=new double[n_part_joints]; jointsList=new int[n_cmd_joints]; cmd_some=new double[n_cmd_joints]; - for (int i=0; i get(i).asInt(); + for (int i=0; i get(i).asInt32(); return true; } diff --git a/src/sensors-duplicate-readings/SensorsDuplicateReadings.cpp b/src/sensors-duplicate-readings/SensorsDuplicateReadings.cpp index 4a711b05..b0d8c62b 100644 --- a/src/sensors-duplicate-readings/SensorsDuplicateReadings.cpp +++ b/src/sensors-duplicate-readings/SensorsDuplicateReadings.cpp @@ -45,7 +45,7 @@ bool SensorsDuplicateReadings::setup(yarp::os::Property &property) { setName(property.find("name").asString()); // updating parameters - testTime = (property.check("time")) ? property.find("time").asDouble() : 2; + testTime = (property.check("time")) ? property.find("time").asFloat64() : 2; ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF(property.check("PORTS"), "A list of the ports must be given"); @@ -56,7 +56,7 @@ bool SensorsDuplicateReadings::setup(yarp::os::Property &property) { ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF(btport && btport->size()>=3, "The ports must be given as lists of "); DuplicateReadingsPortInfo info; info.name = btport->get(0).asString(); - info.toleratedDuplicates = btport->get(1).asInt(); + info.toleratedDuplicates = btport->get(1).asInt32(); ports.push_back(info); } diff --git a/src/system-status/SystemStatus.cpp b/src/system-status/SystemStatus.cpp index 738e881d..3f1b520a 100644 --- a/src/system-status/SystemStatus.cpp +++ b/src/system-status/SystemStatus.cpp @@ -52,7 +52,7 @@ bool SystemStatus::setup(yarp::os::Property &property) { ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF(btport && btport->size()>=2, "Hosts must be given as lists of "); HostInfo info; info.name = btport->get(0).asString(); - info.maxCpuLoad = btport->get(1).asInt(); + info.maxCpuLoad = btport->get(1).asInt32(); hosts.push_back(info); } diff --git a/src/torqueControl-accuracy/TorqueControlAccuracy.cpp b/src/torqueControl-accuracy/TorqueControlAccuracy.cpp index 28c5ca52..e384dad7 100644 --- a/src/torqueControl-accuracy/TorqueControlAccuracy.cpp +++ b/src/torqueControl-accuracy/TorqueControlAccuracy.cpp @@ -76,12 +76,12 @@ bool TorqueControlAccuracy::setup(yarp::os::Property& property) { m_n_cmd_joints = jointsBottle->size(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF(m_n_cmd_joints>0, "invalid number of joints, it must be >0"); - m_step = property.find("step").asDouble(); + m_step = property.find("step").asFloat64(); - m_cycles = property.find("cycles").asInt(); + m_cycles = property.find("cycles").asInt32(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF(m_cycles>0, "invalid cycles"); - m_sampleTime = property.find("sampleTime").asDouble(); + m_sampleTime = property.find("sampleTime").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF(m_sampleTime>0, "invalid sampleTime"); Property options; @@ -106,8 +106,8 @@ bool TorqueControlAccuracy::setup(yarp::os::Property& property) { m_encoders = new double[m_n_part_joints]; m_jointsList = new int[m_n_cmd_joints]; m_torques = new double[m_n_part_joints]; - for (int i = 0; i get(i).asInt(); - for (int i = 0; i get(i).asDouble(); + for (int i = 0; i get(i).asInt32(); + for (int i = 0; i get(i).asFloat64(); return true; } @@ -229,25 +229,25 @@ void TorqueControlAccuracy::run() itrq->setRefTorque(m_jointsList[i], m_cmd_single); Bottle& b1 = dataToPlotRaw.addList(); - b1.addInt(cycle); - b1.addDouble(elapsed); - b1.addDouble(m_torques[m_jointsList[i]]); - b1.addDouble(m_cmd_single); + b1.addInt32(cycle); + b1.addFloat64(elapsed); + b1.addFloat64(m_torques[m_jointsList[i]]); + b1.addFloat64(m_cmd_single); yarp::os::Time::delay(m_sampleTime); } //reorder data for (int t = 0; t < dataToPlotRaw.size(); t++) { - int cycle = dataToPlotRaw.get(t).asList()->get(0).asInt(); - double time = dataToPlotRaw.get(t).asList()->get(1).asDouble(); - double val = dataToPlotRaw.get(t).asList()->get(2).asDouble(); - double cmd = dataToPlotRaw.get(t).asList()->get(3).asDouble(); + int cycle = dataToPlotRaw.get(t).asList()->get(0).asInt32(); + double time = dataToPlotRaw.get(t).asList()->get(1).asFloat64(); + double val = dataToPlotRaw.get(t).asList()->get(2).asFloat64(); + double cmd = dataToPlotRaw.get(t).asList()->get(3).asFloat64(); Bottle& b1 = dataToPlotSync.addList(); - b1.addInt(cycle); - b1.addDouble(time - time_zero); - b1.addDouble(val); - b1.addDouble(cmd); + b1.addInt32(cycle); + b1.addFloat64(time - time_zero); + b1.addFloat64(val); + b1.addFloat64(cmd); } m_dataToSave.append(dataToPlotSync); diff --git a/src/torqueControl-consistency/TorqueControlConsistency.cpp b/src/torqueControl-consistency/TorqueControlConsistency.cpp index d80c5664..78c7afa3 100644 --- a/src/torqueControl-consistency/TorqueControlConsistency.cpp +++ b/src/torqueControl-consistency/TorqueControlConsistency.cpp @@ -70,7 +70,7 @@ bool TorqueControlConsistency::setup(yarp::os::Property& property) { robotName = property.find("robot").asString(); partName = property.find("part").asString(); - zero = property.find("zero").asDouble(); + zero = property.find("zero").asFloat64(); Bottle* jointsBottle = property.find("joints").asList(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(jointsBottle!=0,"unable to parse joints parameter"); @@ -113,7 +113,7 @@ bool TorqueControlConsistency::setup(yarp::os::Property& property) { cmd_some=new double[n_cmd_joints]; prevcurr_tot=new double[n_part_joints]; prevcurr_some=new double[n_cmd_joints]; - for (int i=0; i get(i).asInt(); + for (int i=0; i get(i).asInt32(); return true; } diff --git a/src/torqueControl-stiffDampCheck/TorqueControlStiffDampCheck.cpp b/src/torqueControl-stiffDampCheck/TorqueControlStiffDampCheck.cpp index a2ec6654..c74f95d7 100644 --- a/src/torqueControl-stiffDampCheck/TorqueControlStiffDampCheck.cpp +++ b/src/torqueControl-stiffDampCheck/TorqueControlStiffDampCheck.cpp @@ -103,7 +103,7 @@ bool TorqueControlStiffDampCheck::setup(yarp::os::Property& property) { ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(b_home!=0,"unable to parse home parameter"); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(b_home->size()==n_cmd_joints,"invalid number of home values"); - testLen_sec = property.find("duration").asDouble(); + testLen_sec = property.find("duration").asFloat64(); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR_IF_FALSE(testLen_sec>0, "duretion should be bigger than 0"); if(property.check("plot_enabled")) @@ -147,10 +147,10 @@ bool TorqueControlStiffDampCheck::setup(yarp::os::Property& property) { pos_tot=new double[n_cmd_joints]; home=new double[n_cmd_joints]; - for (int i=0; i get(i).asInt(); - for (int i=0; i get(i).asDouble(); - for (int i=0; i get(i).asDouble(); - for (int i=0; i get(i).asDouble(); + for (int i=0; i get(i).asInt32(); + for (int i=0; i get(i).asFloat64(); + for (int i=0; i get(i).asFloat64(); + for (int i=0; i get(i).asFloat64(); return true; } @@ -192,18 +192,18 @@ void TorqueControlStiffDampCheck::verifyMode(int desired_control_mode, yarp::dev { char sbuf[800]; sprintf(sbuf,"Test (%s) failed: current mode is (%s,%s), it should be (%s,%s)",title.c_str(), - Vocab::decode((NetInt32)desired_control_mode).c_str(), - Vocab::decode((NetInt32)desired_interaction_mode).c_str(), - Vocab::decode((NetInt32)cmode).c_str(), - Vocab::decode((NetInt32)imode).c_str()); + Vocab32::decode((NetInt32)desired_control_mode).c_str(), + Vocab32::decode((NetInt32)desired_interaction_mode).c_str(), + Vocab32::decode((NetInt32)cmode).c_str(), + Vocab32::decode((NetInt32)imode).c_str()); ROBOTTESTINGFRAMEWORK_ASSERT_ERROR(sbuf); } yarp::os::Time::delay(0.2); timeout++; } char sbuf[500]; - sprintf(sbuf,"Test (%s) passed: current mode is (%s,%s)",title.c_str(), Vocab::decode((NetInt32)desired_control_mode).c_str(), - Vocab::decode((NetInt32)desired_interaction_mode).c_str()); + sprintf(sbuf,"Test (%s) passed: current mode is (%s,%s)",title.c_str(), Vocab32::decode((NetInt32)desired_control_mode).c_str(), + Vocab32::decode((NetInt32)desired_interaction_mode).c_str()); ROBOTTESTINGFRAMEWORK_TEST_REPORT(sbuf); } @@ -318,16 +318,16 @@ void TorqueControlStiffDampCheck::run() itrq->getRefTorque(jointsList[i], &reftrq); Bottle& row = b_pos_trq.addList(); - row.addDouble(curr_pos-home[i]); - row.addDouble(torque- init_torque); - row.addDouble(reftrq); + row.addFloat64(curr_pos-home[i]); + row.addFloat64(torque- init_torque); + row.addFloat64(reftrq); yarp::os::Time::delay(0.01); curr_time = yarp::os::Time::now(); } string testfilename = "posVStrq_"; Bottle b; - b.addInt(jointsList[i]); + b.addInt32(jointsList[i]); string filename1 = testfilename + partName + "_j" + b.toString().c_str() + ".txt"; saveToFile(filename1,b_pos_trq); b_pos_trq.clear(); @@ -354,16 +354,16 @@ void TorqueControlStiffDampCheck::run() itrq->getRefTorque(jointsList[i], &reftrq); Bottle& row = b_vel_trq.addList(); - row.addDouble(curr_vel); - row.addDouble(torque- init_torque); - row.addDouble(reftrq); + row.addFloat64(curr_vel); + row.addFloat64(torque- init_torque); + row.addFloat64(reftrq); yarp::os::Time::delay(0.01); curr_time = yarp::os::Time::now(); } testfilename = "velVStrq_"; Bottle b1; - b1.addInt(jointsList[i]); + b1.addInt32(jointsList[i]); filename1 = testfilename + partName + "_j" + b1.toString().c_str() + ".txt"; saveToFile(filename1,b_vel_trq); b_vel_trq.clear(); @@ -457,9 +457,9 @@ void TorqueControlStiffDampCheck::run() // //itrq->getTorque(jointsList[i], torque); // Bottle& row = b_pos_trq.addList(); -// //row.addDouble(curr_pos-home[i], torque); -// row.addDouble(x); -// row.addDouble(10+x); +// //row.addFloat64(curr_pos-home[i], torque); +// row.addFloat64(x); +// row.addFloat64(10+x); // yarp::os::Time::delay(0.01); // curr_time = yarp::os::Time::now(); // x++; @@ -467,7 +467,7 @@ void TorqueControlStiffDampCheck::run() // string testfilename = "posVStrq_"; // Bottle b; -// b.addInt(jointsList[i]); +// b.addInt32(jointsList[i]); // string filename1 = testfilename + partName + "_j" + b.toString().c_str() + ".txt"; // saveToFile(filename1,b_pos_trq); // b_pos_trq.clear(); @@ -491,8 +491,8 @@ void TorqueControlStiffDampCheck::run() // //itrq->getTorque(jointsList[i], torque); // Bottle& row = b_vel_trq.addList(); -// row.addDouble(x); -// row.addDouble(x+20); +// row.addFloat64(x); +// row.addFloat64(x+20); // yarp::os::Time::delay(0.01); // curr_time = yarp::os::Time::now(); // x++; @@ -500,7 +500,7 @@ void TorqueControlStiffDampCheck::run() // testfilename = "velVStrq_"; // Bottle b1; -// b1.addInt(jointsList[i]); +// b1.addInt32(jointsList[i]); // filename1 = testfilename + partName + "_j" + b1.toString().c_str() + ".txt"; // saveToFile(filename1,b_vel_trq); // b_vel_trq.clear();