PlaneSubSpaceSampler.cpp
Go to the documentation of this file.
1 
22 
23 namespace next_best_view {
25 
26  }
27 
29 
30  }
31 
33  SamplePointCloudPtr sampledSpacePointCloudPtr = SamplePointCloudPtr(new SamplePointCloud());
34 
35  // Calculate maximum span
36  SimpleVector4 minVector, maxVector;
37  pcl::getMinMax3D(*this->getInputCloud(), minVector, maxVector);
38  // the surrounding cube.
39  SimpleVector3 spanCube = maxVector.block<3,1>(0,0) - minVector.block<3,1>(0,0);
40 
41  double maximumSpan = spanCube.lpNorm<Eigen::Infinity>() * contractor;
42 
43  uint32_t samples = this->getSamples();
44 
45  // add current viewport
46  SamplePoint currentSamplePoint;
47  currentSamplePoint.x = currentSpacePosition[0];
48  currentSamplePoint.y = currentSpacePosition[1];
49  sampledSpacePointCloudPtr->push_back(currentSamplePoint);
50 
52  BOOST_FOREACH(SimpleQuaternion orientation, *spherePointsPtr) {
53  SimpleVector3 vector3 = orientation.toRotationMatrix() * SimpleVector3::UnitX();
54 
55  SimpleVector2 vector2(vector3[0], vector3[1]);
56  vector2 *= maximumSpan;
57  vector2[0] += currentSpacePosition[0];
58  vector2[1] += currentSpacePosition[1];
59 
60  SamplePoint samplePoint;
61  samplePoint.x = vector2[0];
62  samplePoint.y = vector2[1];
63  sampledSpacePointCloudPtr->push_back(samplePoint);
64  }
65 
66  return sampledSpacePointCloudPtr;
67  }
68 }
69 
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
Definition: typedef.hpp:53
virtual ObjectPointCloudPtr & getInputCloud()
Definition: CommonClass.cpp:31
SpaceSampler class generalizes the sampling of the space.
SamplePointCloudPtr getSampledSpacePointCloud(SimpleVector3 currentSpacePosition=SimpleVector3(), float contractor=1.0)
SamplePointCloud::Ptr SamplePointCloudPtr
Definition: typedef.hpp:93
pcl::PointCloud< SamplePoint > SamplePointCloud
Definition: typedef.hpp:92
Eigen::Matrix< Precision, 4, 1 > SimpleVector4
Definition: typedef.hpp:55
this namespace contains all generally usable classes.
virtual ~PlaneSubSpaceSampler()
destructor for PlaneSubSpaceSampler object
Eigen::Matrix< Precision, 2, 1 > SimpleVector2
Definition: typedef.hpp:52
Eigen::Quaternion< Precision > SimpleQuaternion
Definition: typedef.hpp:67
PlaneSubSpaceSampler()
constructor for PlaneSubSpaceSampler object
static SimpleQuaternionCollectionPtr getOrientationsOnUnitSphere(const int &numberOfPoints)
Definition: MathHelper.cpp:136


asr_next_best_view
Author(s): Aumann Florian, Borella Jocelyn, Heller Florian, Meißner Pascal, Schleicher Ralf, Stöckle Patrick, Stroh Daniel, Trautmann Jeremias, Walter Milena, Wittenbeck Valerij
autogenerated on Thu Jan 9 2020 07:20:18