From 25f3e85f43a0eb0012626ff3c53de32e2808ecde Mon Sep 17 00:00:00 2001 From: Nicogene Date: Thu, 18 Apr 2024 15:25:00 +0200 Subject: [PATCH] Add SN002/V1_2 to unit tests --- tests/CMakeLists.txt | 2 ++ tests/ergocub-model-test.cpp | 12 +++++++----- urdf/CMakeLists.txt | 3 +++ .../robots/ergoCubGazeboV1_2/.gitignoreTOBEDELETED | 0 .../.gitignoreTOBEDELETED | 0 .../robots/ergoCubSN002/.gitignoreTOBEDELETED | 0 6 files changed, 12 insertions(+), 5 deletions(-) delete mode 100644 urdf/ergoCub/robots/ergoCubGazeboV1_2/.gitignoreTOBEDELETED delete mode 100644 urdf/ergoCub/robots/ergoCubGazeboV1_2_minContacts/.gitignoreTOBEDELETED delete mode 100644 urdf/ergoCub/robots/ergoCubSN002/.gitignoreTOBEDELETED diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 303a6865..192a2b52 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,6 +14,8 @@ endmacro() # Model generated with simmechanics add_ergocub_model_test(ergoCubGazeboV1) add_ergocub_model_test(ergoCubGazeboV1_1) +add_ergocub_model_test(ergoCubGazeboV1_2) add_ergocub_model_test(ergoCubSN000) add_ergocub_model_test(ergoCubSN001) +add_ergocub_model_test(ergoCubSN002) diff --git a/tests/ergocub-model-test.cpp b/tests/ergocub-model-test.cpp index 15ad30fe..f9142301 100644 --- a/tests/ergocub-model-test.cpp +++ b/tests/ergocub-model-test.cpp @@ -14,10 +14,12 @@ #include #include -bool isergoCub1_1Model(const std::string& modelPath) +bool isNotergoCub1Model(const std::string& modelPath) { return (modelPath.find("SN001") != std::string::npos || - modelPath.find("GazeboV1_1") != std::string::npos); + modelPath.find("GazeboV1_1") != std::string::npos || + modelPath.find("SN002") != std::string::npos || + modelPath.find("GazeboV1_2") != std::string::npos); } inline bool checkDoubleAreEqual(const double & val1, @@ -258,7 +260,7 @@ bool checkSolesAreParallelAndCorrectlyPlaced(iDynTree::KinDynComputations & comp -bool checkAxisDirections(iDynTree::KinDynComputations & comp, bool isergoCub1_1Model) +bool checkAxisDirections(iDynTree::KinDynComputations & comp, bool isNotergoCub1Model) { std::vector axisNames; @@ -319,7 +321,7 @@ bool checkAxisDirections(iDynTree::KinDynComputations & comp, bool isergoCub1_1M expectedDirectionInRootLink.push_back(iDynTree::Direction(-0.116648,0.227771,0.966702)); axisNames.push_back("r_thumb_add"); expectedDirectionInRootLink.push_back(iDynTree::Direction(-0.329847,0.160871,0.930227)); - if (!isergoCub1_1Model) { + if (!isNotergoCub1Model) { axisNames.push_back("r_thumb_prox"); expectedDirectionInRootLink.push_back(iDynTree::Direction(-0.525416,0.838737,-0.143034)); axisNames.push_back("r_thumb_dist"); @@ -740,7 +742,7 @@ int main(int argc, char ** argv) comp.setRobotState(qj,dqj,grav); // Check axis - if( !checkAxisDirections(comp, isergoCub1_1Model(modelPath)) ) + if( !checkAxisDirections(comp, isNotergoCub1Model(modelPath)) ) { return EXIT_FAILURE; } diff --git a/urdf/CMakeLists.txt b/urdf/CMakeLists.txt index 506256ee..822926f5 100644 --- a/urdf/CMakeLists.txt +++ b/urdf/CMakeLists.txt @@ -11,6 +11,9 @@ list(APPEND GAZEBO_SUPPORTED_MODELS "ergoCubGazeboV1") list(APPEND GAZEBO_SUPPORTED_MODELS "ergoCubGazeboV1_minContacts") list(APPEND GAZEBO_SUPPORTED_MODELS "ergoCubGazeboV1_1") list(APPEND GAZEBO_SUPPORTED_MODELS "ergoCubGazeboV1_1_minContacts") +list(APPEND GAZEBO_SUPPORTED_MODELS "ergoCubGazeboV1_2") +list(APPEND GAZEBO_SUPPORTED_MODELS "ergoCubGazeboV1_2_minContacts") + set(INSTALLED_URDF_MODELS "") diff --git a/urdf/ergoCub/robots/ergoCubGazeboV1_2/.gitignoreTOBEDELETED b/urdf/ergoCub/robots/ergoCubGazeboV1_2/.gitignoreTOBEDELETED deleted file mode 100644 index e69de29b..00000000 diff --git a/urdf/ergoCub/robots/ergoCubGazeboV1_2_minContacts/.gitignoreTOBEDELETED b/urdf/ergoCub/robots/ergoCubGazeboV1_2_minContacts/.gitignoreTOBEDELETED deleted file mode 100644 index e69de29b..00000000 diff --git a/urdf/ergoCub/robots/ergoCubSN002/.gitignoreTOBEDELETED b/urdf/ergoCub/robots/ergoCubSN002/.gitignoreTOBEDELETED deleted file mode 100644 index e69de29b..00000000