diff --git a/unittest/urdf.cpp b/unittest/urdf.cpp index 1907368c13f03dddacb99689ef7b896dde31506b..c8fc25cd77ce4ae2af3fbb3f3a0444f4821115f9 100644 --- a/unittest/urdf.cpp +++ b/unittest/urdf.cpp @@ -1,5 +1,5 @@ // -// Copyright (c) 2015 CNRS +// Copyright (c) 2015-2018 CNRS // // This file is part of Pinocchio // Pinocchio is free software: you can redistribute it @@ -27,30 +27,28 @@ BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE ) BOOST_AUTO_TEST_CASE ( build_model ) { - std::string filename = PINOCCHIO_SOURCE_DIR"/models/simple_humanoid.urdf"; - - #ifndef NDEBUG - std::cout << "Parse filename \"" << filename << "\"" << std::endl; - #endif - se3::Model model; - se3::urdf::buildModel(filename, model); - se3::GeometryModel geomModel; - se3::urdf::buildGeom(model, filename, se3::COLLISION, geomModel); - std::cout << "Robot's name:" << model.name << std::endl; + const std::string filename = PINOCCHIO_SOURCE_DIR"/models/romeo/urdf/romeo.urdf"; + const std::string dir = PINOCCHIO_SOURCE_DIR"/models/romeo"; + + se3::Model model; + se3::urdf::buildModel(filename, model); + se3::GeometryModel geomModel; + se3::urdf::buildGeom(model, filename, se3::COLLISION, geomModel, dir); + + BOOST_CHECK(model.nq == 31); } - BOOST_AUTO_TEST_CASE ( build_model_with_joint ) - { - std::string filename = PINOCCHIO_SOURCE_DIR"/models/simple_humanoid.urdf"; - -#ifndef NDEBUG - std::cout << "Parse filename \"" << filename << "\"" << std::endl; -#endif - se3::Model model; - se3::urdf::buildModel(filename, se3::JointModelFreeFlyer(), model); - se3::GeometryModel geomModel; - se3::urdf::buildGeom(model, filename, se3::COLLISION, geomModel); - std::cout << "Robot's name:" << model.name << std::endl; - } +BOOST_AUTO_TEST_CASE ( build_model_with_joint ) +{ + const std::string filename = PINOCCHIO_SOURCE_DIR"/models/romeo/urdf/romeo.urdf"; + const std::string dir = PINOCCHIO_SOURCE_DIR"/models/romeo"; + + se3::Model model; + se3::urdf::buildModel(filename, se3::JointModelFreeFlyer(), model); + se3::GeometryModel geomModel; + se3::urdf::buildGeom(model, filename, se3::COLLISION, geomModel, dir); + + BOOST_CHECK(model.nq == 38); +} BOOST_AUTO_TEST_SUITE_END()