41 #include <gtest/gtest.h>
55 for (
unsigned int i = 0; i < trials; ++i)
89 collision_detection::CollisionEnvPtr
cenv_;
91 collision_detection::AllowedCollisionMatrixPtr
acm_;
101 const std::string plugin_name = GetParam();
102 SCOPED_TRACE(plugin_name);
104 std::vector<moveit::core::RobotState> states;
105 std::vector<std::thread> threads;
106 std::vector<bool> collisions;
109 if (!loader.
activate(plugin_name, planning_scene_,
true))
111 #if defined(GTEST_SKIP_)
112 GTEST_SKIP_(
"Failed to load collision plugin");
118 for (
unsigned int i = 0; i <
THREADS; ++i)
122 state.setToRandomPositions();
125 states.push_back(std::move(state));
128 for (
unsigned int i = 0; i <
THREADS; ++i)
129 threads.emplace_back(std::thread([i, &scene = *planning_scene_, &state = states[i], expected = collisions[i]] {
130 return runCollisionDetectionAssert(i, TRIALS, scene, state, expected);
133 for (
unsigned int i = 0; i < states.size(); ++i)
139 planning_scene_.reset();
142 #ifndef INSTANTIATE_TEST_SUITE_P // prior to gtest 1.10
143 #define INSTANTIATE_TEST_SUITE_P(...) INSTANTIATE_TEST_CASE_P(__VA_ARGS__)
149 int main(
int argc,
char** argv)
151 ::testing::InitGoogleTest(&argc, argv);
152 return RUN_ALL_TESTS();