Search code examples
pythoncameraframe-ratelatencypepper

Softbank Pepper robot with Naoqi - camera livefeed latency with Python


I'm programming the Softbanks Pepper Robot with Python. I want to have a livefeed coming from the camera of the robot. But the function

 pepperImage = self.video_service.getImageRemote(self.nameId)

is very slow, and uses over 300ms getting the image. With a livefeed, this is only 2-3fps, which is very bad. Im using the Naoqi library, and network speed shouldn't be a issue, my PC, router and Pepper is in the same room, and Pepper is the only task for the router. I'm using Python 2 with Pycharm.

Anyone got a solution for this?


Solution

  • With a decent network, you should be able to have at least 10fps in wifi and 25fps in ethernet depending of the resolution. Here are some ideas:

    • If currently both in wifi, put your computer in ethernet
    • Try reducing the size of the image (do you really need color ?)
    • Try reducing the size of the image (do you really need 4VGA or HD ?)
    • Stop some other processing potentially using camera (on board face detection/recognition, image analysis, autonomous life, choregraphe...)

    Good luck...

    You can also refer to the documentation from Softbank, which tells you the limitations: See here...