2

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

1 Answer 1

1

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()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.