【问题标题】:raspberry pi has a error with kinect树莓派 kinect 出现错误
【发布时间】:2017-08-16 12:00:59
【问题描述】:

我在 Raspberry Pi 上使用 Kinect 时遇到问题。 当我用 libfreenect 运行我的程序时,我运行程序时出错,然后我一次又一次地执行更多,突然系统开始工作,我的 kinect 唤醒并运行我的程序。 请帮忙。我的错误是:

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

【问题讨论】:

    标签: python raspberry-pi kinect


    【解决方案1】:

    显然,freenect.sync_get_depth() 返回 None,当您尝试将其存储到 depth, timestamp 时失败,因为 None 不可迭代。

    重构此代码,并进行适当的错误处理:

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

    【讨论】:

      猜你喜欢
      • 2013-07-18
      • 1970-01-01
      • 2018-10-15
      • 1970-01-01
      • 2021-07-22
      • 1970-01-01
      • 2013-12-07
      • 2015-06-17
      • 2018-07-08
      相关资源
      最近更新 更多