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

Method cloud_cb_

tools/openni_grabber_example.cpp:53–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 SimpleOpenNIProcessor (openni_wrapper::OpenNIDevice::DepthMode depth_mode = openni_wrapper::OpenNIDevice::OpenNI_12_bit_depth) : mode (depth_mode) {}
52
53 void
54 cloud_cb_ (const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr &cloud) const
55 {
56 static unsigned count = 0;
57 static double last = pcl::getTime ();
58 if (++count == 30)
59 {
60 double now = pcl::getTime ();
61 std::cout << "distance of center pixel :" << cloud->points [(cloud->width >> 1) * (cloud->height + 1)].z << " mm. Average framerate: " << static_cast<double>(count)/(now - last) << " Hz" << std::endl;
62 count = 0;
63 last = now;
64 }
65
66 if (save)
67 {
68 std::stringstream ss;
69 ss << std::setprecision (12) << pcl::getTime () * 100 << ".pcd";
70 pcl::PCDWriter w;
71 w.writeBinaryCompressed (ss.str (), *cloud);
72 std::cout << "wrote point clouds to file " << ss.str () << std::endl;
73 }
74 }
75
76 void
77 imageDepthImageCallback (const openni_wrapper::Image::Ptr&, const openni_wrapper::DepthImage::Ptr& d_img, float constant)

Callers

nothing calls this directly

Calls 3

getTimeFunction · 0.85
strMethod · 0.80
writeBinaryCompressedMethod · 0.45

Tested by

no test coverage detected