23 #include "pcl_frombuf_thread.h"
25 #include <fvutils/ipc/shm_image.h>
26 #include <fvutils/color/colorspaces.h>
27 #include <fvutils/base/types.h>
28 #include <pcl_utils/utils.h>
32 using namespace fawkes;
33 using namespace firevision;
46 :
Thread(
"OpenNiPclOnlyThread",
Thread::OPMODE_WAITFORWAKEUP),
64 __width = __pcl_buf->
width();
65 __height = __pcl_buf->
height();
68 __pcl->is_dense =
false;
69 __pcl->width = __width;
70 __pcl->height = __height;
71 __pcl->points.resize(__width * __height);
72 __pcl->header.frame_id =
"/kinect/depth";
95 if (__last_capture_time != capture_time) {
96 __last_capture_time = capture_time;
102 pcl_utils::set_time(__pcl, capture_time);
104 unsigned int idx = 0;
105 for (
unsigned int h = 0; h < __height; ++h) {
106 for (
unsigned int w = 0; w < __width; ++w, ++idx, ++pclbuf) {
108 pcl.points[idx].x = pclbuf->
x;
109 pcl.points[idx].y = pclbuf->
y;
110 pcl.points[idx].z = pclbuf->
z;