Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can find the instructions on how to install the framework here: Install.

Setup

Once installed to all devices you want to use, we can start the framework.

...

  1. Start Redis

  2. (Optional) Start a service, such as face detection

  3. Run your program

Starting Redis on your laptop

To enable communication between all your devices, we have to start Redis on some device.

This can be done in two ways: By starting redis yourself or using docker.

In a (WSL) terminal, start redis usingserver. Make sure Redis is always up and running when you run any demos.

Ubuntu / Debian / macOS
Code Block
# in the `framework` folder:
 Navigate to the repo where you cloned the sic_applications
cd sic_applications 

# Start the Redis server
redis-server conf/redis/redis.conf
Expand
titleDocker alternative to start redis (for windows without WSL)

Start it on your laptop in the root framework framework folder (for MacOS and Windows: make sure Docker Desktop is running).

Code Block
languagebash
cd your/path/to/framework
docker compose up redis

This should start print Container framework-redis-1 Created which means Redis is up and running.

Optionally, you can now start other services on your laptop, such as text to speech, by starting the service in a terminal. For example:

Code Block
cd framework/sic_framework/services/text2speech
python3 text2speech_service.py

or with docker

docker compose up text2speech
Code Block
Info

Troubleshoot (Could not create server TCP listening socket *:6379: bind: Address already in use)

If you encounter the error Could not create server TCP listening socket *:6379: bind: Address already in use., please use the following command to stop the Redis server first

Code Block
sudo systemctl stop redis-server.service

And, if you wish to prevent Redis server from starting automatically at boot, you can run

Code Block
sudo systemctl disable redis-server.service

If you still can’t kill Redis server, you can use ps aux | grep redis-server command to find the PID (process ID) of the Redis server. And, terminate the process using kill PID

Windows

The commands here are for the Command Prompt:

Code Block
# Navigate to the repo where you cloned the sic_applications
cd sic_applications 

# Start the Redis server
cd conf\redis
redis-server.exe redis.conf
Info

Troubleshoot (Could not create server TCP listening socket *:6379: bind; Failed listening on port 6379 (TCP), aborting.)

It means that port 6379 is already in use, probably by a previous instance of the Redis server that is still running in the background. You can either leave it as it is, or if you really want to kill it and restart the server, find the PID and kill the program.

Running a demo

To start a demo, for example to show pepper’s nao’s camera output on your screen, simply execute a python script. Some demos are available in the framework/sic_frameworkapplications /tests folderdemos.

For example, to show the camera feed of the robot:

...

To start the camera demo from the terminal, use the following commands.

Note: This demo requires you to have the OpenCV module installed, as well as have the framework installed.

...

Ubuntu / Debian / macOS
Code Block
# Activate the same virtual environment where you pip installed 
# social-interaction-cloud in the installation steps
source venv_sic/bin/activate

# Go to sic_applications and the demo script
cd sic_applications/demos
python demo_nao_camera.py
Windows
Code Block
# Activate the same virtual environment where you pip installed 
# social-interaction-cloud in the installation steps
.\.venv_sic\Scripts\activate

# Go to sic_applications and the demo script
cd sic_applications\demos
python demo_nao_camera.py

And, you should get the following output:

Code Block
Starting SIC on /data/home/nao/.venv_sic/lib/python2.7/site-packages/sic_framework/devices/nao with redis ip 192.168.2.6
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiSpeakerComponent
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiButtonSensor
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiAutonomousActuator
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiMicrophoneSensor
[SICComponentManager 

...

192.168.2.7]: INFO:  - NaoqiMotionActuator
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiBottomCameraSensor
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiStiffnessActuator
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiMotionRecorderActuator
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiTextToSpeechActuator
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiTrackerActuator
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiTopCameraSensor
[SICComponentManager 192.168.2.7]: INFO:  - NaoqiLookAtComponent

If all goes well, a display should pop up showing you the camera output of your robot!

...

The goal of SIC is to provide easy to use high level access to devices and services. For example, to make a NAO robot say something, run the following python script on your laptop! To see more functionality check out the framework/sic_frameworkapplications /testsdemos folder!

Code Block
languagepy
from sic_framework.devices import Nao
from sic_framework.devices.common_naoqi.naoqi_text_to_speech import NaoqiTextToSpeechRequest

nao = Nao(ip='192.168.0.151') # adjust this to the IP adress of your robot.

nao.tts.request(NaoqiTextToSpeechRequest("Hello!"))