12 #ifdef PINOCCHIO_WITH_HPP_FCL
14 #endif // PINOCCHIO_WITH_HPP_FCL
16 #include <boost/test/unit_test.hpp>
18 #include <urdf_parser/urdf_parser.h>
20 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
26 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
45 BOOST_CHECK_EQUAL(
model.nq, 29);
50 BOOST_CHECK_EQUAL(geomModel.
ngeoms, 2);
52 #ifdef PINOCCHIO_WITH_HPP_FCL
54 #ifdef PINOCCHIO_URDFDOM_COLLISION_WITH_GROUP_NAME
56 #else // PINOCCHIO_URDFDOM_COLLISION_WITH_GROUP_NAME
60 #ifndef PINOCCHIO_URDFDOM_COLLISION_WITH_GROUP_NAME
62 #else // PINOCCHIO_URDFDOM_COLLISION_WITH_GROUP_NAME
65 #endif // PINOCCHIO_WITH_HPP_FCL
82 BOOST_CHECK_EQUAL(geomModel0.
ngeoms, 2);
90 BOOST_CHECK_EQUAL(geomModel1.
ngeoms, 2);
100 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
105 std::string filestr((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
116 std::string filestr(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
117 "<robot name=\"test\">"
118 " <link name=\"base_link\"/>"
119 " <link name=\"link_1\"/>"
120 " <link name=\"link_2\"/>"
121 " <joint name=\"joint_1\" type=\"fixed\">"
122 " <origin xyz=\"1 0 0\"/>"
123 " <axis xyz=\"0 0 1\"/>"
124 " <parent link=\"base_link\"/>"
125 " <child link=\"link_1\"/>"
127 " <joint name=\"joint_2\" type=\"fixed\">"
128 " <origin xyz=\"0 1 0\"/>"
129 " <axis xyz=\"0 0 1\"/>"
130 " <parent link=\"link_1\"/>"
131 " <child link=\"link_2\"/>"
139 link1_id =
model.getFrameId(
"link_1"),
140 link2_id =
model.getFrameId(
"link_2"),
144 BOOST_CHECK_EQUAL(base_link_id,
model.frames[
joint1_id].parentFrame);
154 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
156 ::urdf::ModelInterfaceSharedPtr urdfTree = ::urdf::parseURDFFile(
filename);
168 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
184 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
189 std::string filestr((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
201 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
203 ::urdf::ModelInterfaceSharedPtr urdfTree = ::urdf::parseURDFFile(
filename);
219 const int nframes =
model.nframes;
220 const std::string filestr(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
221 "<robot name=\"test\">"
222 " <link name=\"box\"/>"
238 const std::string filestr(
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
239 "<robot name=\"test\">"
240 " <link name=\"box\"/>"
245 std::invalid_argument);
256 #if defined(PINOCCHIO_WITH_HPP_FCL)
264 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
265 std::vector<std::string> packageDirs;
267 packageDirs.push_back(meshDir);
271 GeometryModel geomModel;
273 geomModel.addAllCollisionPairs();
275 GeometryModel geomModelOther =
279 #endif // if defined(PINOCCHIO_WITH_HPP_FCL)
290 PINOCCHIO_MODEL_DIR + std::string(
"/../unittest/models/link_and_joint_identical_name.urdf");
293 BOOST_CHECK_THROW(
model.getFrameId(
"base"), std::invalid_argument);
298 BOOST_AUTO_TEST_SUITE_END()