Pepper Robot - getImageLocal生成错误

时间:2017-06-20 06:38:58

标签: nao-robot pepper

尝试使用getImageLocal从机器人获取图像时,收到错误消息。尽管我正在直接在机器人上运行代码。错误消息是:

Traceback (most recent call last):
  File "test.py", line 13, in <module>
    video_device.getImageLocal(handle)
RuntimeError: Uncaught error: Pointer serialization not implemented

我用来获取此错误的代码如下(我在使用C ++时也收到同样的错误):

import qi
import sys

if __name__ == "__main__":
    app = qi.Application(sys.argv)

    # start the eventloop
    app.start()

    video_device = app.session.service("ALVideoDevice")
    handle = video_device.subscribe('handler', 0, 0, 10)

    video_device.getImageLocal(handle)
    video_device.releaseImage(handle)

我目前正在使用以下代码运行此代码:

python test.py --qi-url=tcp://pepper.local

我很想知道这是否是我在这里做错了,或者是否存在更严重的潜在问题。

1 个答案:

答案 0 :(得分:1)

即使您直接在机器人上运行此代码,您也无法使用Python代码检索此图像。使用C ++时出现相同错误的事实确实令人非常不安......

如果你想在Python中工作,你应该考虑使用 getImageRemote()方法来获取图像。如果您的代码在机器人上运行,但如果它在远程计算机上运行,​​则此解决方案可以正常运行。

如果您想更快地检索图像,您还可以考虑使用 GStreamer (这里是一个link来描述如何使用它。这是一个有效的解决方案对于Nao,但它也可以用于Pepper。)

您使用的是哪个版本的Naoqi?