NaoQi library for Node.js, it's inspired by qimessaging and provides a better interface for method calls and events.
$ npm install naoqi --save
const QiSession = require('naoqi').QiSession;
const session = new QiSession('your naoqi host or ip address');
// specify what services will be used later
session.using('ALTextToSpeech', 'tts');
session.using('ALBehaviorManager');
// start programming on this trigger
session.onload = function(loaded) {
assert.deepEqual(this, session);
this.tts.say('hello naoqi');
this.behaviorManager.run('behavir path').then(() => {
// get result from run
});
// register an event
this.subscribe('robotIsWakeUp', (awake) => {
console.log('when robot is wake up');
});
};
$ npm test
MIT