Versions Compared

Key

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

...

Code Block
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!

...

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.

Code Block
languagepy
from sic_framework import SICApplication
from sic_framework.devices.common_naoqi.naoqi_speakers import NaoqiTextToSpeechActionNaoqiTextToSpeech, NaoqiTextToSpeechRequest


class DemoTextToSpeech(SICApplication):
    def run(self):
        nao3_actionnao_tts = self.connect(NaoqiTextToSpeechAction, device_id='nao1')
        nao3_actionNaoqiTextToSpeech(ip='192.168.0.236')
nao_tts.request(NaoqiTextToSpeechRequest("Hello world!"))


if __name__ == '__main__':
    test_app = DemoTextToSpeech()
    test_app.run()
Code Block
import time

import cv2
from sic_framework.core.message_python2 import CompressedImageMessage
from sic_framework.devices.desktop.desktop_camera import DesktopCamera

def on_image(image_message: CompressedImageMessage):
  cv2.imshow('', image_message.image)
  cv2.waitKey(1)

camera = DesktopCamera()
camera.register_callback(on_image)

time.sleep(100)