14 #include <boost/test/unit_test.hpp>
18 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
24 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
35 for (Eigen::DenseIndex
i = 0;
i < (Eigen::DenseIndex)
geom_model.ngeoms; ++
i)
37 for (Eigen::DenseIndex j =
i + 1; j < (Eigen::DenseIndex)
geom_model.ngeoms; ++j)
48 BOOST_CHECK(
cp == cp_ref);
56 for (
size_t k = 0; k <
geom_model.collisionPairs.size(); ++k)
59 collision_map((Eigen::DenseIndex)
cp.first, (Eigen::DenseIndex)
cp.second) =
true;
77 for (
size_t k = 0; k <
geom_model.collisionPairs.size(); ++k)
87 for (
size_t k = 0; k <
geom_data.activeCollisionPairs.size(); ++k)
88 BOOST_CHECK(
geom_data.activeCollisionPairs[k]);
95 for (
size_t k = 0; k <
geom_data.activeCollisionPairs.size(); ++k)
96 BOOST_CHECK(!
geom_data.activeCollisionPairs[k]);
102 geom_data_copy.deactivateAllCollisionPairs();
107 for (
size_t k = 0; k <
geom_data.activeCollisionPairs.size(); ++k)
110 collision_map((Eigen::DenseIndex)
cp.first, (Eigen::DenseIndex)
cp.second) =
115 geom_data_copy.setActiveCollisionPairs(
geom_model, collision_map);
116 BOOST_CHECK(geom_data_copy.activeCollisionPairs ==
geom_data.activeCollisionPairs);
129 security_margin_map_upper.triangularView<Eigen::Lower>().
fill(0.);
131 geom_data_upper.setSecurityMargins(
geom_model, security_margin_map,
true,
true);
132 for (
size_t k = 0; k < geom_data_upper.collisionRequests.size(); ++k)
134 BOOST_CHECK(geom_data_upper.collisionRequests[k].security_margin == 1.);
136 geom_data_upper.collisionRequests[k].security_margin
137 == geom_data_upper.collisionRequests[k].distance_upper_bound);
140 geom_data_lower.setSecurityMargins(
geom_model, security_margin_map,
false);
141 for (
size_t k = 0; k < geom_data_lower.collisionRequests.size(); ++k)
143 BOOST_CHECK(geom_data_lower.collisionRequests[k].security_margin == 1.);
153 for (
size_t k = 0; k <
geom_data.activeCollisionPairs.size(); ++k)
156 if (
cp.first == 0 ||
cp.second == 0)
158 BOOST_CHECK(
geom_data.activeCollisionPairs[k]);
162 BOOST_CHECK(!
geom_data.activeCollisionPairs[k]);
173 for (
size_t k = 0; k <
geom_data.activeCollisionPairs.size(); ++k)
176 if (
cp.first == 0 ||
cp.second == 0)
178 BOOST_CHECK(!
geom_data.activeCollisionPairs[k]);
182 BOOST_CHECK(
geom_data.activeCollisionPairs[k]);
192 + std::string(
"/example-robot-data/robots/romeo_description/urdf/romeo_small.urdf");
216 BOOST_AUTO_TEST_SUITE_END()