FAQ

Creating Server TCP listening socket *:6379: bind: Address already in use

Try sudo service redis-server stop. Otherwise, find the running process of redis and kill it. After succesfully killing redis, the OS might take a few seconds to register the port as available again (up to 30 seconds).
For Mac OS users: go to Activity Monitor → search for redis-server –> double click the process → click QuitQuit

Could not connect to redis:

On windows, running redis in WSL or docker does not allow external acces. This acces is required for the robot to be able to send information back.
There is unfortunately no known solution if both WSL and docker do not work for you.
How to diagnose this is indeed the issue:

  1. On the affected windows laptop: Start redis using WSL or docker.

  2. On another laptop: redis-cli -h [windows_laptop_ip_adress_here] -p changemeplease
    full example: redis-cli -h 145.108.231.33 -p changemeplease

  3. If this connects, then the issue is something else. If it does not connect then this is the root cause.

Could not connect to YourComponentNameHere on device 192.168.0.xxx:

This could have many different causes, but there are a few things to check.

  1. Check the IP address of the robot is correct. Press the chest button to find out.

  2. Make sure the component is running, if it is not a desktop or robot component. E.g. Dialogflow and Whisper have to be started separately.

  3. You are using the desktop or robot components directly. Use the Nao(ip=...)/Pepper(ip=...)/Desktop() wrappers which will start the components for you.

No module named sic_framework

Make sure to execute the last step in the Confluence (https://socialrobotics.atlassian.net/wiki/spaces/CBSR/pages/2180415493/Install#Installation):

> cd framework

> pip install -e .

Then you can run the scripts using 

> python .\sic_framework\tests\xxxx.py

Alternatively: Make sure to use Python 3 instead of Python 2.

 

RuntimeError: Wrong path format

Error: RuntimeError: Wrong path format (animations/Stand/BodyTalk/BodyTalk_1) which has been converted in: animations/Stand/BodyTalk/BodyTalk_1, it should follow the pattern: package/path

Solution: BodyTalk/BodyTalk_XX does not work on the NAO’s as of 16/11/2023. The Gestures do work, so try those instead (possible to record your own).

Cannot show the camera output [Mac]

Solution A: run in own terminal or VS code, not in pycharm terminal

Solution B: Check that your OpenCV install is working (https://stackoverflow.com/questions/34966541/how-can-one-display-an-image-using-cv2-in-python). On MacOS you can only use cv2.imshow from the main thread, not from other threads or callbacks (which use threads).

Webcam doesn't turn on but on the iphone it does [Mac]

On mac can turn off "Continuity Camera" or 

On your iPhone, go to Settings > General > AirPlay & Handoff. Turn off Continuity Camera

Pyaudio install problem [Mac]

brew install portaudio pip install pyaudio pip install opencv-python six

Incompatible architecture [Mac]

error: have ‘arm64’, need ‘x86_64’, this seems to affect the newer macbooks only. I was told that the student fix it my trying different answers of this stackoverflow question:

https://stackoverflow.com/questions/71882029/mach-o-file-but-is-an-incompatible-architecture-have-arm64-need-x86-64-i

 

Very laggy camera output [All OS]

Make sure libturbo-jpeg is installed.

#Install libturbo-jpeg 1- download and run installer from https://sourceforge.net/projects/libjpeg-turbo/files/2.1.5.1/libjpeg-turbo-2.1.5.1-gcc64.exe/download 2- add the bin folder where you installed libjpeg-turb to the PATH environment variable  (see e.g. https://www.wikihow.com/Change-the-PATH-Environment-Variable-on-Windows for how to do this) 3- make sure that the dll is called turbojpeg.dll (e.g. by copying and renaming libturbojpeg.dll) 4- pip install -U git+https://github.com/lilohuang/PyTurboJPEG.git

Image is tinted blue [Python]

if using openCV, try adding this line of code:

img= cv2.cvtColor(img, cv2.COLOR_RGB2BGR)

Webcam output is flipped [Python]

flip the image by vertically by adding this line ofcode

img= cv2.flip(img, 0)

Module google not found [Python]

pip install google-cloud-dialogflow

How can I do two things at the same time in my python program?

Use the block=False parameter of the nao.request method to not wait for things to complete. If you do need to wait for the result, but still want to do multiple things: use threads!

face_detection_dnn.py: ERROR: invalid load key, 'v':

Use python 3.9

gRPC error: No DesignTimeAgent found:

You probably are not using the right keys and/or have not created an agent on the dialogflow site. Check the instructions TODO here.

Issue with dialogflow not properly transcribing after subsequent calls:
Try restarting the dialogflow component. E.g. restart dialogflow.py

How to change the speed a recorded motion?

Use

nao.motion_record.request(PlayRecording(recording, playback_speed=1.7))

Can I use NaoQi without/parallel to SIC?

In theory, yes. However, usually it is quite a hassle to install and run yourself so this is not recommended(either on Mac or Windows) as it usually takes a significant amount of time.

Naoqi SDK installation instructions (if you are using NAO or Pepper directly in Python)

This is the official library for Pepper/Nao robots. One thing you might want to pay particular attention to is the installation of it .
To download PythonSDK, follow here:
Make sure you have python 2.7 (eg. run “python -V” in the terminal)
Download Python SDK from
Tips for installing Naoqi on Mac (and similar on Linux):
After downloading python sdk of naoqi, open the terminal and type in:
$ open ~/.zshrc
Next, add the following lines into your zsh file:

Save the changes to zsh file and restart a new terminal. Enter python 2.7 in the terminal and try to import naoqi. If you succeed to import it without any error complaints, then you are good to go.

Issues with naoqi:

Install python 2.7 from website below:

https://www.python.org/downloads/release/python-2710/

if you use conda, type ‘conda deactivate’ in terminal

If your MacOS blocks installing the sdk from an unidentified developer, check the Mac user guide here to override your security settings. The python version should be 2.7 now