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

Method RangeLikelihood

simulation/src/range_likelihood.cpp:275–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275pcl::simulation::RangeLikelihood::RangeLikelihood(
276 int rows, int cols, int row_height, int col_width, Scene::Ptr scene)
277: scene_(scene)
278, rows_(rows)
279, cols_(cols)
280, row_height_(row_height)
281, col_width_(col_width)
282, sum_reduce_(cols * col_width, rows * row_height, max_level(col_width, row_height))
283{
284 height_ = rows_ * row_height;
285 width_ = cols_ * col_width;
286
287 depth_buffer_ = new float[width_ * height_];
288 color_buffer_ = new std::uint8_t[width_ * height_ * 3];
289
290 // Set Default Camera Intrinstic Parameters. techquad
291 // Correspond closely to those stated here:
292 // http://www.ros.org/wiki/kinect_calibration/technical
293 camera_width_ = 640;
294 camera_height_ = 480;
295 camera_fx_ = 576.09757860f;
296 camera_fy_ = 576.09757860f;
297 camera_cx_ = 321.06398107f;
298 camera_cy_ = 242.97676897f;
299
300 z_near_ = 0.7f;
301 z_far_ = 20.0f;
302
303 which_cost_function_ = 2; // default to commonly used meter based function
304
305 // default lhood parameters - these should always be set by the user
306 // so might want to add to constructor eventually:
307 sigma_ = 0.1;
308 floor_proportion_ = 0.9;
309
310 int height = rows * row_height;
311 int width = cols * col_width;
312
313 // For now we only support a limited size texture
314 assert(height > 0 && height <= 8192 && width > 0 && width <= 8192);
315 // throw std::runtime_error "
316
317 // Allocate framebuffer
318 glGenRenderbuffers(1, &depth_render_buffer_);
319 glBindRenderbuffer(GL_RENDERBUFFER, depth_render_buffer_);
320 glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT32, width, height);
321 glBindRenderbuffer(GL_RENDERBUFFER, 0);
322
323 glGenRenderbuffers(1, &color_render_buffer_);
324 glBindRenderbuffer(GL_RENDERBUFFER, color_render_buffer_);
325 glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB8UI, width, height);
326 glBindRenderbuffer(GL_RENDERBUFFER, 0);
327
328 // Setup texture to store depth image
329 glGenTextures(1, &depth_texture_);
330 glBindTexture(GL_TEXTURE_2D, depth_texture_);
331 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
332 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

Callers

nothing calls this directly

Calls 6

max_levelFunction · 0.85
addShaderFileMethod · 0.80
linkMethod · 0.80
emplace_backMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected