Checking the NAOqi Python development environment

Introduction

It is a continuation. For the time being, I haven't confirmed the connection to the actual Pepper machine yet, so I tried it. Until now, I tried it with C ++ because of my interest, but this time I tried it with handy Python.

Run on Pepper real machine

Execution 4 (failure)

Connect to Pepper with API from your PC and run it.

hello.py


#!/usr/bin/python

from naoqi import ALProxy

tts = ALProxy("ALTextToSpeech", "192.168.3.58", 9559)
tts.say("Hello")
$ ./hello.py
[INFO ] Starting ALNetwork
[INFO ] NAOqi is listening on 127.0.0.1:54010
Traceback (most recent call last):
  File "./hello.py", line 5, in <module>
    tts = ALProxy("ALTextToSpeech", "192.168.3.58", 9559)
  File "/path/to/pynaoqi-python-2.7-naoqi-1.14-mac64/naoqi.py", line 282, in __init__
    inaoqi.proxy.__init__(self, args[0], args[1], args[2])
  File "/path/to/pynaoqi-python-2.7-naoqi-1.14-mac64/inaoqi.py", line 276, in __init__
    this = _inaoqi.new_proxy(*args)
RuntimeError:   ALNetwork::getModuleByName
        failed to get module ALTextToSpeech http://192.168.3.58:9559

It was an error.

It seems that such a thing appeared in the log on the Pepper side, so I connected, but it is probably "failed to get module ALTextToSpeech".

Pepper102 [0] /var/log/naoqi $ tail -f tail-naoqi.log
[W] 1419836877.127194 3839 qimessaging.transportsocket: Incorrect magic from 192.168.3.4, disconnecting (expected 1118690882, got 1414745936).

Execution 5 (success)

Connect to Pepper via SSH from your PC and run the API within Pepper.

$ ssh [email protected]
Password:

Pepper102 [0] ~ $ python
Python 2.7.3 (default, Jun 13 2014, 15:08:05)
[GCC 4.5.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import naoqi
>>> from naoqi import ALProxy

First, try executing with localhost specified.

>>> tts = ALProxy("ALTextToSpeech", "localhost", 9559)
[I] 7615 qi.eventloop: Creating event loop while no qi::Application() is running
[I] 7615 qimessaging.session: Session listener created on tcp://0.0.0.0:0
[I] 7615 qimessaging.transportserver: TransportServer will listen on: tcp://127.0.0.1:42881
[I] 7615 qimessaging.transportserver: TransportServer will listen on: tcp://198.18.0.1:42881
[I] 7615 qimessaging.transportserver: TransportServer will listen on: tcp://192.168.3.58:42881
>>> tts.say("Hello")

Pepper said "Hello".

Next, try executing by specifying the IP address.

>>> tts = ALProxy("ALTextToSpeech", "192.168.3.58", 9559)
[I] 7994 qimessaging.session: Session listener created on tcp://0.0.0.0:0
[I] 7994 qimessaging.transportserver: TransportServer will listen on: tcp://127.0.0.1:43065
[I] 7994 qimessaging.transportserver: TransportServer will listen on: tcp://198.18.0.1:43065
[I] 7994 qimessaging.transportserver: TransportServer will listen on: tcp://192.168.3.58:43065
>>> tts.say("Hello")

Pepper said "Hello".

Impressions

Recommended Posts

Checking the NAOqi Python development environment
The strongest Python development environment PyCharm's recommendation
The strongest Python integrated development environment PyCharm
Python development environment construction
About Python development environment
python2.7 development environment construction
Development environment in Python
Introduction to Python Let's prepare the development environment
Organize your Python development environment
[ev3dev × Python] Build ev3dev development environment
[MEMO] [Development environment construction] Python
[For organizing] Python development environment
python memo (for myself): About the development environment virtualenv
Prepare Python development environment on Ubuntu
Unify the environment of the Python development team starting with Poetry
Commands often used in the development environment during Python implementation
Prepare your first Python development environment
[Python3] Development environment construction << Windows edition >>
Python development environment options for May 2020
Python development environment construction on macOS
Vim + Python development environment setting memo
Install Python development environment on Windows 10
How to get into the python development environment with Vagrant
Emacs Python development environment construction memo
Prepare Python development environment with Atom
Prepare the development environment with anyenv
Continuation ・ Notes on preparing the Python development environment on Mac OS X
Python (anaconda) development environment construction procedure (SpringToolsSuites) _2020.4
[Development environment] Python with Xcode [With screen transition]
Blender 2.82 or later + python development environment notes
About the virtual environment of python version 3.7
How to prepare Python development environment [Mac]
Python3 + venv + VSCode + macOS development environment construction
[python] Checking the memory consumption of variables
Prepare the development environment for keyhac for Mac
Build Python development environment (pythonz, virtualenv, direnv)
Building a Python development environment for AI development
Windows + gVim + Poetry python development environment construction
Create a Python development environment locally at the fastest speed (for beginners)
Python environment construction
python environment settings
python windows environment
python environment construction
Python --Environment construction
Python environment construction
python environment construction
Prepare the execution environment of Python3 with Docker
ffmpeg-Build a python environment and split the video
Instantiation of the BOX development environment created earlier
[Python] Build a Django development environment with Docker
Install the python package in an offline environment
[Python] Web development preparation (building a virtual environment)
python development environment -use of pyenv and virtualenv-
Set up a Python development environment on Marvericks
Code for checking the operation of Python Matplotlib
Create a Python virtual development environment on Windows
Build a Python development environment on Raspberry Pi
Get a quick Python development environment with Poetry
Prepare the development environment for Python on AWS Cloud9 (pip install & time change)
Arduino development on the command line: vim + platformio
Vim
vim
Vim + Python development environment setting memo
Find the maximum Python