File: openni_grabber.py

package info (click to toggle)
python-pcl 0.3.0~rc1%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,388 kB
  • sloc: python: 3,102; cpp: 283; makefile: 181; sh: 24; ansic: 12
file content (33 lines) | stat: -rw-r--r-- 850 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
# The OpenNI Grabber Framework in PCL
# http://pointclouds.org/documentation/tutorials/openni_grabber.php

import pcl
import pcl.pcl_grabber
import pcl.pcl_visualization

def class SimpleOpenNIViewer:
    SimpleOpenNIViewer()
        viewer = pcl.pcl_visualization.CloudViewer(b'PCL OpenNI Viewer')
    
    def void cloud_cb_ (pcl.PointCloud_Ptr_t cloud):
        if !viewer.wasStopped() == True:
            viewer.showCloud (cloud)

    def void run ():
        interface = new pcl.OpenNIGrabber()
        
        interface.RegisterCallback (cloud_cb_)
        interface.Start ()
        
        while !viewer.wasStopped() == True:
            # boost::this_thread::sleep (boost::posix_time::seconds (1));
            time.sleep(1)

        interface.Stop()


if __name__ == '__main__':
v = SimpleOpenNIViewer()
v.run()