Hi everyone,            I am asking for advice from the community in my attemmpt to create an oscilloscope mouth for the inmoov robot. I am working on a redesign of the inmoov face which makes its far less humanlike and more bender form futurama and "general grevious like" for lack of a better terms I would like to use a far smaller lcd board, but I am using a 4.9 inch by 3 inch by .3 inch hdmi compatable lcd board. I plan on having the mouth scope any audio response the robot makes from myrobotlab. To do this I want to make myrobot lab (python) connection to matlab (where I can easily make scope function). For this first attempt I just plan on generating the scope on my laptop display and using the lcd board as a second monitor. I will change this in future iterations if I make any. 

But back the point, I would like to export some kind of serial connection which would allow me to tell the matlab 1) whether the robot is or is not speaking 2) which mp3 file of the MRL audio should the matlab load to scope.    So I want to export variables from MRL to MATLAB and really dont know how I should go about it. 

If anyone can provide any help on this method, or could suggest another method creating a scope of the audio responses for my lcd board please let me know.

Thank you for your time!

-Lsmith

GroG

8 years 7 months ago

Ahahah .. 

Great idea !

The first thing which comes to mind is Sweety by Beetlejuice - he made an LED mouth with MRL

The LCD board will be connected to a laptop ? RasPi ?  other ?
I don't know your future plans or budget - but I think an older generation raspi would have more than enough power to drive the LCD + oscope mouth.  Its not a touch screen - might be neat to have control, but a little weird to be poking your robot in the mouth :)

The Speech service is getting overhauled this release - but it has in the past and will in the future send out Speaking events to tell other systems when its speaking and when its not.

MatLab seems overkill to me .. perhaps you could just post the algorithm or show us what you have currently with MatLab and we could look further into the details..

And Welcome Lsmith !

Yeah so I planned on just using matlab simple scope function and calling the mp3 files of the audio.

This lcd board I got. Its a bit large  (and more expensive than I would like tbh)  but it seems like with this lcd board I can just use it as another display to my laptop

http://www.adafruit.com/products/2232 

Very Nice to meet you GroG, I have been following you and Gael's work for a couple years now and your open source work helped me get into robotics. So thank you it means alot.  

since my lack of knowledge of python code is the greatest thing impeading me right now, 

could anyone explain how to export a string to another environment (such as matlab or proccessing) using an "if " or "elif" statemtent. Such that my code would look like this with many more audio options:

 

from java.lang import String

from org.myrobotlab.service import Speech

from org.myrobotlab.service import Sphinx

from org.myrobotlab.service import Runtime

 

# create ear and mouth

ear = Runtime.createAndStart("ear","Sphinx")

mouth = Runtime.createAndStart("mouth","Speech")

 

# start listening for the words we are interested in

ear.startListening("hello robot|Goodbye")

 

# set up a message route from the ear --to--> python method "heard"

ear.addListener("recognized", python.name, "heard");

 

mouth.setGoogleURI("http://thehackettfamily.org/Voice_api/api2.php?voice=WillBadGuy&txt=")

 

mouth.speak("I am ready")

 

def heard(data):

      print "heard ", data

      if (data == "hello robot"):

         mouth.speak("Hello Meatbag")

         ***Here is where I would like to be able to export a string as a variable to upload a specific MP3 file***

     elif(data=="Goodbye"):

          mouth.speak("See ya Meatbag")

       ***And be able to export a DIFFERENT string here as to signal to a code to upload a specific mp3 file to my ocsope***

 

I'm guessing when you say "export" - the goal is to save the string to file - so the matlab can pick up the file ?

If that is the case you can save a file with the name of a file in it like this in Python

file = open('toMatLab.txt', 'w')
file.write('nameOfMyMp3File.mp3')
file.close() 
I like your idea of an oscilloscope mouth - MRL has a couple of Oscope displays.
This is the older GUI
 
And this is a couple views of the new WebGUI Oscope
 
 
Our goal is always to make these representitive of the input data feeding in them (righ now they have some problems .. but we'll get them ironed out)
 
Your Blender voice/mouth idea is great - but it might be more profiecient to send a series of predefined images with traces so the animation looks smooth.
 
On the above oscopes - you can see the trace move from left to right ..  On a real hardware oscope it moves so fast you only see the signal.
 
In short, although I think it would be cool to have the actual Fourier transform of the MP3 file or some equivalent - it would be considerably less resource intensive if you just make the "effect"
 
 

  In Simulink the scoping ascept is as you can see below incredibly simple:

I used a From Mulitmedia File block but I can easily import audiofiles from Matlab to simulink through the From Workspace block you see above. This simple oscope can look pretty cool tool.

(this is the accapella bot saying "Hello Brave New World" on loop, I can change the axes and style of the scope very easily too which cool)

I can make a simple if and elsif construct that would load a certain audio file, but I need to have some input from MRL, and I m not really sure how I should go about that.  All i need is some input "x" that be equal to various different. If x equaled a I could load the mp3 to matlab workspace and upload that to Simulink to be scoped. 

It would look soemthing like :

if x = a

    load(filename) ;
   y= load(filename);
 
if x = b
   
    load(filename) ;
    y= load(filename);