4 posts / 0 new
Last post
Offline
Last seen: 2 days 23 hours ago
Joined: January 4, 2018
ALTabletService
Hi,We have created a chat bot web application (HTML based UI + angular.js + java) which is running in Bluemix JavaLiberty runtime. (which can be launched in any Web browser by opening this url for example https://mychatbot.mybluemix.net).The WebUI renders properly in pepper's tablet when opened using ALTabletService.showWebView(https://mychatbot.mybluemix.net). But This means that the html page is being served by web server and is not present inside the robot behavior application.Now i want to enable this webui to be able to take user questions as voice input. For this i tried to inject the qimessaging js library in my html code. But it seems that since the Webpage is being served from my web server () the "new QISession()" call fails to connect to the robot and if the mention the robot's ip in the "new QISession("robot ip")" call then it by default attaches a 9080 port to the ip while trying to connect and hence the connection fails. Hence my questions are as below:Is it possible to access Pepper's audio recording feature from a WebApplication/Webpage (deployed in a remote server)? For this the main criteria should be if it is possible to connect to QiSession from a remotely deployed web application (in a remote server not a remote robot)?If not then,Is it possible to install a basic http server in pepper robot's OS system?Any pointers or suggestion will be greatly helpful!
Offline
Last seen: 2 days 23 hours ago
Joined: August 26, 2016
Hi bideshd,In principle it's possible to do what you describe - you can totally create a QiSession from a webpage that isn't served from the robot, for example look at the documentation on robotutils.js - when debugging, I usually use that so I can debug the webapge on my computer. You'd be want to do the same from Pepper's tablet.However, if you do that to make an audio recording, the recording file will still be on your robot, so I'm not sure your use case would work.What we usually do is have this logic on the robot-side, not on a webpage, and have the python handling that talk directly to the server.Does that help?Cheers,Emile
Offline
Last seen: 2 days 23 hours ago
Joined: January 4, 2018
Hi Emile,Thanks for your reply! I did come across robotutils.js prior to posting the question here, but was not sure if ti would work for my scenario. Your reply and suggestion nudged me towards giving it a try and it did work out!!! :) Had to tweak couple of things in the robotutils.js though, but yes i am able to achieve what i was looking for. To answer your doubt regarding whether my approach will work since the recording file will reside inside the robot - what i am trying to acheive is to accept voice input from users while using the same chat bot UI as being used by the Web application. So i just needed to trigger the robot's voice recording from the web ui and then receive the translated text in the web ui. The translation happens inside my robot behavior and then i send the text to the tablet web ui via a memory event. I have one more question for you  regarding the working of the robotutil.js helper. Do you know how qi session is handled by this helper lib? let's suppose i create multiple subscriptions to different almemory events in my controler js, then will this lib be creating multiple qi session objects also for each subscription? When does a qi session get disconnected? do we need to handle the disconnection ourselves? I have seen that they have given an unsubscribe call for events but nothing to terminate a qi session. ThanksBidesh
Offline
Last seen: 2 days 23 hours ago
Joined: August 26, 2016
Hi bideshd, you can look at the code here -  basically, there's only one session (stored in RobotUtils.session) and it doesn't handle deconnection / reconnection - it does handle the case where the page is loaded and the session is not ready yet. In my experience you shouldn't need add anything to handle disconnections, the connection on the tablet is stable enough, the only problem will be if naoqi stops. Note that RobotUtils.js is just syntactic sugar on top of qimessaging.js - you can read it's doc here; and there you can get the callback for disconnection.