{"id":288,"date":"2014-04-03T07:06:14","date_gmt":"2014-04-03T07:06:14","guid":{"rendered":"http:\/\/blogs.discovery.wisc.edu\/projects\/?p=288"},"modified":"2014-04-03T16:10:27","modified_gmt":"2014-04-03T16:10:27","slug":"rekinstruct-first-time-varying-pcd","status":"publish","type":"post","link":"https:\/\/blogs.discovery.wisc.edu\/projects\/2014\/04\/03\/rekinstruct-first-time-varying-pcd\/","title":{"rendered":"ReKinStruct : First Time Varying PCD"},"content":{"rendered":"<p style=\"text-align: justify\">So, like I said in the last post, I had got the Kinect to obtain and view point cloud data but only manually. I updated the code a bit to do the above without intervention. Here is the link to the video of a time varying PCD that I obtained.<\/p>\n<p style=\"text-align: justify\">YouTube link :\u00a0<a href=\"http:\/\/youtu.be\/T4IPKq0rGII\" target=\"_blank\" rel=\"nofollow noreferrer\">http:\/\/youtu.be\/T4IPKq0rGII<\/a><\/p>\n<p style=\"text-align: justify\">Yes, that is me walking like a zombie. Note that I have loaded the points as PointXYZ on purpose to give a feel of the pointcloud. Loading the points as PointXYZRGBA feels like a picture and not a pointcloud.<\/p>\n<p style=\"text-align: justify\">The idea behind this is 8 PCD files named output1.pcd, output2.pcd and so on. The ReKinStruct_Snapshot.cpp code would take a snapshot once every second and save as binary PCD files with names as listed above. The Binary PCD files are constant in size (4801 KB).<\/p>\n<p style=\"text-align: justify\">The ReKinStruct_Viewer.cpp loads these files and displays them in sequence with a time delay of 1 second. It uses two pcl::PointXYZ pointers. One loads the output&lt;even&gt;.pcd files and the other loads the output&lt;odd&gt;.pcd files. So when the even-pointer is displaying the point cloud in the viewer, the odd-pointer loads the next .pcd file in the background and vice versa thus abstracting the user from the latency of loading the files.<\/p>\n<p style=\"text-align: justify\">And for some reason, Visual Studio 2010 didn&#8217;t let me use Sleep() or wait() routines. So I had to write my own API as follows.<\/p>\n<p><code><\/p>\n<p style=\"text-align: left\">#include &lt;time.h&gt;<\/p>\n<p style=\"text-align: left\">void wait(unsigned int seconds)<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; clock_t timeToWait = clock () + seconds * CLOCKS_PER_SEC ;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp; while (clock() &lt; timeToWait);<br \/>\n}<\/p>\n<p><\/code><\/p>\n<p style=\"text-align: justify\">Next steps would be to obtain a faster scenario and progress through the 3D viewer faster, like real-time motion.<\/p>\n<p style=\"text-align: left\">Will keep you posted.!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, like I said in the last post, I had got the Kinect to obtain and view point cloud data but only manually. I updated the code a bit to do the above without intervention. Here is the link to &hellip; <a href=\"https:\/\/blogs.discovery.wisc.edu\/projects\/2014\/04\/03\/rekinstruct-first-time-varying-pcd\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":85,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4],"tags":[15,19,13,21,23],"_links":{"self":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/288"}],"collection":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/users\/85"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/comments?post=288"}],"version-history":[{"count":9,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":297,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/288\/revisions\/297"}],"wp:attachment":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}