Note that there are some explanatory texts on larger screens.

plurals
  1. PONaoqi eventhandling 10 Secounds delay
    text
    copied!<p>I am working with a NAO-robot on a Windows-XP machine and Python 2.7.</p> <p>I want to detect markers in speech. The whole thing worked, but unfortunately I have to face now a 10 Secounds delay and my events aren't detected (the callback function isnt invoked).</p> <p>First, my main-function:</p> <pre><code>from naoqi import ALProxy, ALBroker from speechEventModule import SpeechEventModule myString = "Put that \\mrk=1\\ there." NAO_IP = "192.168.0.105" NAO_PORT = 9559 memory = ALProxy("ALMemory", NAO_IP, NAO_PORT) tts = ALProxy("ALTextToSpeech", NAO_IP, NAO_PORT) tts.enableNotifications() myBroker = ALBroker("myBroker", "0.0.0.0", # listen to anyone 0, # find a free port and use it NAO_IP, # parent broker IP NAO_PORT) # parent broker port global SpeechEventListener SpeechEventListener = SpeechEventModule("SpeechEventListener", memory) memory.subscribeToEvent("ALTextToSpeech/CurrentBookMark", "SpeechEventListener", "onBookmarkDetected") tts.say(initialString) </code></pre> <p>And here my speechEventModule:</p> <pre><code>from naoqi import ALModule from naoqi import ALProxy NAO_IP = "192.168.0.105" NAO_PORT = 9559 SpeechEventListener = None leds = None memory = None class SpeechEventModule(ALModule): def __init__(self, name, ext_memory): ALModule.__init__(self, name) global memory memory = ext_memory global leds leds = ALProxy("ALLeds",NAO_IP, NAO_PORT) def onBookmarkDetected(self, key, value, message): print "Event detected!" print "Key: ", key print "Value: " , value print "Message: " , message if(value == 1): global leds leds.fadeRGB("FaceLeds", 0x00FF0000, 0.2) if(value == 2): global leds leds.fadeRGB("FaceLeds", 0x000000FF, 0.2) </code></pre> <p>Please, do anybody have the same problem? Can anybody give me an advice?</p> <p>Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload