iman ansari
iman ansari

Reputation: 103

raspberry pi has a error with kinect

I have a problem with use Kinect on a Raspberry Pi. when I run my program with libfreenect, I have an error to run the program, after then I execute more again and more again and suddenly system has work and my kinect wake-up and runs my program. please help. my error is :

send_cmd: Input control transfer failed (18)
freenect_fetch_reg_const_shift: send_cmd read 18 bytes (expected 8)
freenect_camera_init(): Failed to fetch const shift for device
Error: Invalid index [0]
Error: Can't open device. 1.) is it plugged in? 2.) Read the README
Traceback (most recent call last):
  File "9605019hsn2.py", line 64, in <module>
    depth = getDepthMap()
  File "9605019hsn2.py", line 42, in getDepthMap
    depth, timestamp = freenect.sync_get_depth()
TypeError: 'NoneType' object is not iterable

Upvotes: 2

Views: 458

Answers (1)

Andrejs Cainikovs
Andrejs Cainikovs

Reputation: 28474

Obviously, freenect.sync_get_depth() returns None, and when you try to store this into depth, timestamp it fails, since None is not iterable.

Refactor this code, and do proper error handling:

d = freenect.sync_get_depth()
if d is not None:
    depth, timestamp = d
else:
    error()

Upvotes: 1

Related Questions