| 203 | } |
| 204 | |
| 205 | void |
| 206 | run() |
| 207 | { |
| 208 | // create a new grabber for OpenNI devices |
| 209 | pcl::OpenNIGrabber interface; |
| 210 | |
| 211 | // make callback function from member function |
| 212 | std::function<void(const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr&)> f = |
| 213 | [this](const pcl::PointCloud<pcl::PointXYZRGBA>::ConstPtr& cloud) { |
| 214 | cloud_cb_(cloud); |
| 215 | }; |
| 216 | |
| 217 | // connect callback function for desired signal. In this case its a point cloud with |
| 218 | // color values |
| 219 | boost::signals2::connection c = interface.registerCallback(f); |
| 220 | |
| 221 | // start receiving point clouds |
| 222 | interface.start(); |
| 223 | |
| 224 | while (!outputFile_.fail()) { |
| 225 | std::this_thread::sleep_for(1s); |
| 226 | } |
| 227 | |
| 228 | interface.stop(); |
| 229 | } |
| 230 | |
| 231 | pcl::PassThrough<PointXYZRGBA> pass_; |
| 232 | ostream& outputFile_; |
no test coverage detected