SIC
SIC is a framework for quickly getting started with social robotics by making it simple to combine complex devices such as Nao’s and powerful services such as Google Dialogflow.
Getting started with SIC consists of a few basic steps:
Installing SIC on your device
Installing SIC on your robot
Starting Redis and SIC on your device
Starting SIC on your robot
Start your program to control the robot
Installation
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.
This consists of three (or four) steps:
Start redis
Start the device services on the robot
(Optional) Start a service, such as face detection
Run your program
Starting Redis and SIC 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. We recommend using docker as this makes starting other services easier later on.
In a terminal, start redis using
redis-server
Docker alternative
Start it on your laptop in the root framework framework
folder (for MacOS and Windows: make sure Docker Desktop is running).
cd your/path/to/framework docker compose up redis
This should start print Container sic-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, either using docker
docker compose up text2speech
Or by starting the service in a terminal. For example:
cd framework/sic_framework/services/text2speech python3 text2speech_service.py
Starting SIC on the Robot (NAOv6)
In a new terminal, start the framework on the robot using
cd framework/sic_framework/scripts/ sh ./start_nao.sh -h ROBOT_IP # Windows: .\start_nao.ps1 ROBOT_IP REDIS_IP
Where:
ROBOT_IP
is the adress of the Nao or Pepper robotREDIS_IP
the ip adress of your laptop/desktop where redis is running
Example command:
sh ./start_nao.sh -h 192.168.0.116 # Windows .\start_nao.ps1 192.168.0.116 192.168.0.181
This should show an output like
nao@nao:~/framework/sic_framework/devices$ python nao.py Starting service manager on ip "192.168.0.151" with services: - NaoqiMicrophone - TopNaoCamera - BottomNaoCamera Starting service manager on ip "192.168.0.151" with services: - NaoMotionReplayAction - NaoMotionRecorderAction - NaoMotionAction - NaoMotionStreamConsumer - NaoqiTextToSpeechAction - NaoMotionStreamProducer - NaoqiTabletService
Or due to a bug with stdout
:
Starting robot (due to a bug output may or may not be produced until you start your program) [SICSensorManager-192.168.0.151 192.168.0.151]: INFO: Manager on device 192.168.0.151 starting [SICComponentManager-192.168.0.151 192.168.0.151]: INFO: Manager on device 192.168.0.151 starting
Running a demo
To start a demo, for example to show pepper’s camera output on your screen, simply execute a python script with a SICApplication. Some demos are available in the docker/sic/sic_framework/tests
folder.
Terminal
To start the camera demo from the terminal, use the following commands.
Note: This demo requires you to have the OpenCV and tqdm modules and libjpeg-turbo installed, as well as have the framework installed on a NAO robot (see above). On Windows, moreover, the libjpeg dependency may not be automatically be found, and you may need to set the path to libturbojpeg.dll
manually.
cd framework/sic_framework/tests python demo_nao_camera.py
If all went well, a display should pop up showing you the camera output of your robot!
API
The goal of SIC is to provide easy to use high level access to devices and services. To make a NAO robot say something, follow the startup instruction in https://socialrobotics.atlassian.net/wiki/spaces/CBSR/pages/2180415493/Install#Starting-SIC-on-the-Robot and run the following python script on your laptop.
from sic_framework.devices.common_naoqi.naoqi_speakers import NaoqiTextToSpeech, NaoqiTextToSpeechRequest nao_tts = NaoqiTextToSpeech(ip='192.168.0.236') nao_tts.request(NaoqiTextToSpeechRequest("Hello!"))