Skip to content

Commit

Permalink
Add SN002/V1_2 to unit tests (icub-tech-iit#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicogene authored Apr 18, 2024
2 parents c34edaf + 25f3e85 commit 5f04705
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

12 changes: 7 additions & 5 deletions tests/ergocub-model-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
#include <cmath>
#include <cstdlib>

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,
Expand Down Expand Up @@ -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<std::string> axisNames;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions urdf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
Empty file.
Empty file.
Empty file.

0 comments on commit 5f04705

Please sign in to comment.