2

I have installed the K4W branch of the open kinect project on Linux 11.10 from https://github.com/renewagner/libfreenect/tree/k4w-wip . I can navigate to the directory libfreenect/build and run the command:

sudo bin/glview

and the output works correctly.

I have also installed the Python wrappers from libfreenect/wrappers/python and I can import the libraries successfully. However if I run a simple code such as

import freenect
freenect.sync_get_depth() 

Which I saved as kinect1.py and then ran using the command sudo kinect1.py

I get the following error:

Error: Invalid Index[0]

Error: Can't open device 1.) Is it plugged in? 2.) Read README

However, I can go straight back to running the glview example and it still work find. So I must be missing something with the Python wrapper implementation. I hope someone can help.

user1549912
  • 103
  • 1
  • 1
  • 5
  • ...did you read `README`? Does it work after running `glview`? Do any examples work? Make sure `glview` is not running! – nneonneo Mar 10 '13 at 13:43
  • Also IIRC `sudo` isn't required to make OpenKinect work. – nneonneo Mar 10 '13 at 13:44
  • I can run glview and that works fine but then running a python script will just give the error above however running glview again still works. I have tried running the python and the unplugging and reconnecting and trying again and it still gives the same error. Either you can use SUDO or a rules file. The rules file is written for Xbox and I tried to rewrite it based on the results of lsusb but I guess that didn't work. Thanks – user1549912 Mar 10 '13 at 13:52
  • Huh...maybe I fscked something when I installed it, because I never needed `sudo` :P – nneonneo Mar 10 '13 at 13:59
  • Were you installing the K4W version? Or did you use the installer in the repository? – user1549912 Mar 10 '13 at 20:27
  • Also I am very new to Linux so the chances are I have screwed something up. But I know I can access the kinect as glview works but Python doesn't... – user1549912 Mar 10 '13 at 20:28
  • Oops! For some reason I didn't understand you were using Linux. I am using OS X. So my experience doesn't apply. Sorry. – nneonneo Mar 10 '13 at 20:29

0 Answers0