Gavin Suddrey
Gavin Suddrey

Reputation: 45

Pepper Robot - getImageLocal generates error

When trying to get an image from the robot using getImageLocal, I receive an error message. This is despite the fact that I am running the code directly on the robot. The error message is:

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

The code I've used to obtain this error is below (I receive the same error when using C++ as well) :

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)

I'm currently running this code using:

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

I would be very interested to know if it is something that I am doing wrong here, or if there is a more serious underlying issue.

Upvotes: 1

Views: 376

Answers (1)

Maxime BUSY
Maxime BUSY

Reputation: 128

Even if you run this code directly on the robot, you won't be able to retrieve this image using Python code. The fact that you get the same error while using C++ is quite disturbing indeed...

If you want to work in Python, you should consider using the getImageRemote() method to get the images. This solution works if your code runs on the robot, but also if it runs on a remote computer.

If you want to retrieve the images faster, you could also consider using GStreamer (here is a link to a post describing how to use it. It's a valid solution for Nao, but it can be used for Pepper as well).

Which version of Naoqi are you using ?

Upvotes: 1

Related Questions