Notifications
Clear all

Does any one know about the program flow of Q.bo?

4 Posts
3 Users
0 Reactions
1,103 Views
(@gokul)
Active Member
Joined: 6 years ago
Posts: 7
Topic starter  

Hi Team,

Does any one know about the program running flow in Q.bo like 1. PiCmd.py 2.PiCmdLine.py 3.PiFaceFast.py 4.QBOtalk.py etc.

Thanks


   
Quote
(@lucarobotics)
Active Member
Joined: 6 years ago
Posts: 7
 

Hi,

We have only had our Qbo One for about 24 hours but this is what we believe is happening in interactive mode:

Q.bo One – Software process for Interactive Mode with DialogFlow

autoStart.py – this appears to be the first thing that is run once Q.bo One has booted up. This python code seems to determine the language, and the mode.

If Scratch mode is in use it launches the appropriate Scratch application (“/home/pi/Documents/deamonsScripts/QBO_scratch”)

If Interactive mode is active, then it launches "/home/pi/Documents/deamonsScripts/QBO_PiFaceFast start”

 

As this document is related to interactive mode, the Scratch application will not be detailed here.

 

QBI_PiFaceFast  script – this script accepts a ‘start’ and ‘stop’ option – when starting it runs the “/home/pi/Documents/Python projects/PiFaceFast.py” code. This code initialises the servos and webcams, and has functions to home the head, speak, listen for speech and wait for touch sensors. The final section appears to be the code to loop looking for a face and listen for speech when a face is detected. This code also creates two instances od classes, firstly, QBO which is an instance of the QboCmd.Controller which appears to communicate serially with the Arduino for servo control and changing the colour of the nose, and Qbo which is an instance of QBOtalk.QBOtalk() – note if Google assistant is being used then QboGAssistant is started instead of QBOTalk.

QBOTalk manages the actual recording of the audio and processing by Google's free Speech to Text engine. Once it has a result it will pass this to DialogFlow V1 and attempt to get a response. The QBOTalk.Decode function makes the call to DialogFlow and extracts the response to be spoken by Qbo One.  

The WaitForSpeech function in PiFaceFast.py, checks to see if QBOTalk has a response for it to utilise. If it does it passes it on to the QboTalk.SpeechText function which directs Qbo One to speak the response.

The QboTalk.SpeechText builds a command line to convert the text response from API.AI to a wav file using pico2wave and then play it using aplay.

The process then loops and continues listening.

 

As I said, that is our thought of the process at present. I am just about to update this to try and get DialogFlowV2 working so if we find anything different I will let you know.

 

Carl

This post was modified 6 years ago by LucaRobotics

   
ReplyQuote
(@lucarobotics)
Active Member
Joined: 6 years ago
Posts: 7
 

I can confirm a little more. We have changed the QboTalk. Decode routine to support DialogFlow V2 API. We wrote a new Decode function called DecodeV2(), replaced the calls to Decode(audio) to DecodeV2(audio), pip installed the DialogFlowV2 api, and imported it in the QboTalk module. 

At this point we upgraded our DialogFlow Agent to V2 and tested. All worked. We then removed all of the calls to the DialogFlow V1 api (API.AI python sdk). Final test and all seems to be working. 

So, although not very detailed, I think the above outline of the software flow is correct.


   
ReplyQuote
(@romeo)
Member
Joined: 6 years ago
Posts: 76
 

https://www.amazon.com/ROBOTICS-EDUCATION-CODING-English-version/dp/B0BRMT29KC/ref=sr_1_1?crid=3HLX2FOV83UZV&keywords=qbo+coding+for+stem&qid=1679435736&s=books&sprefix=qbo+coding+for+stem%2Cstripbooks-intl-ship%2C195&sr=1-1

I advise you to read my textbook to implement Q.BO STEM or Q.BO One at the latest version, with which you can also make it play with chat-gpt.


   
ReplyQuote
Share: