* @brief starts the main loop */
| 116 | * @brief starts the main loop |
| 117 | */ |
| 118 | void |
| 119 | run() |
| 120 | { |
| 121 | //pcl::Grabber* interface = new pcl::OpenNIGrabber(device_id_, pcl::OpenNIGrabber::OpenNI_QQVGA_30Hz, pcl::OpenNIGrabber::OpenNI_VGA_30Hz); |
| 122 | |
| 123 | std::function<void (const CloudConstPtr&) > f = [this] (const CloudConstPtr& cloud) { cloud_cb_ (cloud); }; |
| 124 | |
| 125 | boost::signals2::connection c = grabber_.registerCallback (f); |
| 126 | |
| 127 | grabber_.start(); |
| 128 | |
| 129 | while (!viewer.wasStopped ()) |
| 130 | { |
| 131 | if (cloud_) |
| 132 | { |
| 133 | FPS_CALC ("drawing"); |
| 134 | //the call to get() sets the cloud_ to null; |
| 135 | viewer.showCloud (getLatestCloud (), "cloud"); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | grabber_.stop(); |
| 140 | } |
| 141 | |
| 142 | pcl::visualization::CloudViewer viewer; |
| 143 | pcl::ONIGrabber& grabber_; |
no test coverage detected