roslibjs
roslibjs copied to clipboard
Service response issue ..
If` you request service from the console, it will not respond or will respond immediately.
I want tts.py to quit and respond.
rosservice call /echo_service "msgs: 'hello.' type: 'type1'" msgs: '' type: ''
` //////////////////////// var echoServer = new ROSLIB.Service({ ros : ros, name : '/echo_service', serviceType : 'echo/echoService' }); echoServer.advertise(function(request, response) { console.log('service request : ' + echoServer.name + ': ' + request.msgs + ': ' + request.type);
// text to speech
var process = spawn('python3',["/home/nvidia/tts.py", request.msgs]);
process.stdout.on('data', function (data){
response['msgs'] = request.msgs;
response['type'] = request.type;
return true;
});
}); //////////////////////////// `
Service calls work, I recommend asking on https://answers.ros.org