| 234 | } |
| 235 | |
| 236 | void |
| 237 | capture(Eigen::Isometry3d pose_in) |
| 238 | { |
| 239 | // No reference image - but this is kept for compatibility with range_test_v2: |
| 240 | float* reference = |
| 241 | new float[range_likelihood_->getRowHeight() * range_likelihood_->getColWidth()]; |
| 242 | const float* depth_buffer = range_likelihood_->getDepthBuffer(); |
| 243 | // Copy one image from our last as a reference. |
| 244 | for (int i = 0, n = 0; i < range_likelihood_->getRowHeight(); ++i) { |
| 245 | for (int j = 0; j < range_likelihood_->getColWidth(); ++j) { |
| 246 | reference[n++] = depth_buffer[i * range_likelihood_->getWidth() + j]; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | std::vector<Eigen::Isometry3d, Eigen::aligned_allocator<Eigen::Isometry3d>> poses; |
| 251 | std::vector<float> scores; |
| 252 | poses.push_back(pose_in); |
| 253 | |
| 254 | range_likelihood_->computeLikelihoods(reference, poses, scores); |
| 255 | std::cout << "score: "; |
| 256 | for (const float& score : scores) { |
| 257 | std::cout << " " << score; |
| 258 | } |
| 259 | std::cout << std::endl; |
| 260 | |
| 261 | std::cout << "camera: " << camera_->getX() << " " << camera_->getY() << " " |
| 262 | << camera_->getZ() << " " << camera_->getRoll() << " " |
| 263 | << camera_->getPitch() << " " << camera_->getYaw() << std::endl; |
| 264 | |
| 265 | delete[] reference; |
| 266 | |
| 267 | // Benchmark Values for |
| 268 | // 27840 triangle faces |
| 269 | // 13670 vertices |
| 270 | |
| 271 | // 45.00Hz: simulation only |
| 272 | // 1.28Hz: simulation, addNoise? , getPointCloud, writeASCII |
| 273 | // 33.33Hz: simulation, getPointCloud |
| 274 | // 23.81Hz: simulation, getPointCloud, writeBinary |
| 275 | // 14.28Hz: simulation, addNoise, getPointCloud, writeBinary |
| 276 | // MODULE TIME FRACTION |
| 277 | // simulation 0.02222 31% |
| 278 | // addNoise 0.03 41% |
| 279 | // getPointCloud 0.008 11% |
| 280 | // writeBinary 0.012 16% |
| 281 | // total 0.07222 |
| 282 | |
| 283 | pcl::PointCloud<pcl::PointXYZRGB>::Ptr pc_out(new pcl::PointCloud<pcl::PointXYZRGB>); |
| 284 | } |
| 285 | |
| 286 | void |
| 287 | print_Quaterniond(Eigen::Quaterniond r, std::stringstream& ss) |
no test coverage detected