Go to the documentation of this file.00001
00002
00003 #include "pcl/range_image/range_image.h"
00004
00005 int main (int argc, char** argv) {
00006 pcl::PointCloud<pcl::PointXYZ> pointCloud;
00007
00008
00009 for (float y=-0.5f; y<=0.5f; y+=0.01f) {
00010 for (float z=-0.5f; z<=0.5f; z+=0.01f) {
00011 pcl::PointXYZ point;
00012 point.x = 2.0f - y;
00013 point.y = y;
00014 point.z = z;
00015 pointCloud.points.push_back(point);
00016 }
00017 }
00018 pointCloud.width = pointCloud.points.size();
00019 pointCloud.height = 1;
00020
00021
00022 float angularResolution = 1.0f * (M_PI/180.0f);
00023 float maxAngleWidth = 360.0f * (M_PI/180.0f);
00024 float maxAngleHeight = 180.0f * (M_PI/180.0f);
00025 Eigen::Affine3f sensorPose = (Eigen::Affine3f)Eigen::Translation3f(0.0f, 0.0f, 0.0f);
00026 pcl::RangeImage::CoordinateFrame coordinate_frame = pcl::RangeImage::CAMERA_FRAME;
00027 float noiseLevel=0.00;
00028 float minRange = 0.0f;
00029 int borderSize = 1;
00030
00031 pcl::RangeImage rangeImage;
00032 rangeImage.createFromPointCloud(pointCloud, angularResolution, maxAngleWidth, maxAngleHeight,
00033 sensorPose, coordinate_frame, noiseLevel, minRange, borderSize);
00034
00035 std::cout << rangeImage << "\n";
00036 }