MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / sampleRandomTransform

Function sampleRandomTransform

test/registration/test_registration.cpp:246–258  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

244
245////////////////////////////////////////////////////////////////////////////////////////////////////////
246void
247sampleRandomTransform (Eigen::Affine3f &trans, float max_angle, float max_trans)
248{
249 srand(0);
250 // Sample random transform
251 Eigen::Vector3f axis(static_cast<float>(rand()) / RAND_MAX, static_cast<float>(rand()) / RAND_MAX, static_cast<float>(rand()) / RAND_MAX);
252 axis.normalize();
253 float angle = static_cast<float>(rand()) / RAND_MAX * max_angle;
254 Eigen::Vector3f translation(static_cast<float>(rand()) / RAND_MAX, static_cast<float>(rand()) / RAND_MAX, static_cast<float>(rand()) / RAND_MAX);
255 translation *= max_trans;
256 Eigen::Affine3f rotation(Eigen::AngleAxis<float>(angle, axis));
257 trans = Eigen::Translation3f(translation) * rotation;
258}
259
260//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
261TEST (PCL, IterativeClosestPointWithRejectors)

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected