I want to pass data from my choregraphe to webjs and the passed value will display it in the html through javascipt. I can successfully passed it but the problem is it will just display for a 1-3 seconds. Did i do this right?
Here is my code from choregraphe(python):
def onLoad(self):
#put initialization code here
pass
def onUnload(self):
self.memory = None
#put clean-up code here
pass
def onInput_onStart(self):
data = ['apple','mango','juice']
self.memory.raiseEvent("myData", data)
def onInput_onStop(self):
self.onUnload()
box is stopped
self.onStopped()
And this is the code for my javaschipt in getting the data from pepper:
var session = new QiSession();
$(document).ready(function(){
getData();
});
function getData(){
session.service('ALMemory').then(function(ALMemory){
ALMemory.subscriber("myData").then(function(subscriber) {
subscriber.signal.connect(function(data){
"display to html here"
});
});
});
}