vocabulary [solved]

I would like to know how I can add vocabulary to a script. Do I have to create a library? I do have all the mp3 files necessary.

For example: In existing scripts I see

ear.addCommand("open hand", "python", "handopen")

where does he get the information in the bracket from? I would like to have this here for example:

ear.addCommand("shake hand", "???", "shakehand")

I was searching for information but I did not find the right one. Thanks for any help

Alessandruino's picture

hey mastablasta,if you want

hey mastablasta, if you want to add new voice commands you have to use for example this :

ear.addCommand("open hand", "python", "handopen")

i'll explain how is this composed :

"open hand" is the voice command you want to add, so after adding it MyRobotLab will "Listen" for that command too

then you need to add an action to do when that command is heard :

"hand open" : you are saying you want to execute "handopen" function when the "open hand" command is heard and "python" means that the "hand open" function is in python...

In fact the action you want to do, will look in this way in python :

def handopen():      

         put here what you want to do

Alessandruino's picture

In your case you did it in

In your case you did it in the right way !

Now you just have to create the "shakehand" function in python

ear.addCommand("shake hand", "python", "shakehand")

def shakehand():

       print 'hey i'm using a new function !'

Mastablasta's picture

working!

Hello Allesandruino.

First of all thank you.
I did not expect it to be that simple. It´s working already (modified minimal.py), next I will try to make him answer new phrases.
So this way I just need to feed the script with whatever I want to say to him and what I want him to do/answer.

I enjoy MRL more and more!

Update: Listens and speaks as well!

wvantoorn's picture

markus got a very good

markus got a very good script, when you say something too many times, it react on that, might be usefull for U, gael put it in his inmoov2full3 script

 

Mastablasta's picture

script

I guess you mean the part with the "howdoyoudo" for example. Yeah really great! One day I will attach the paintball gun so he can start shooting around if I drive him nuts ;-)

Now things make more sense to me. I will try to do a small script myself these days. Just purchased a webcam so I will try the tracking today.

 

wvantoorn's picture

Do you have pics of your bot?

Do you have pics of your bot?

Mastablasta's picture

Pics

That´s all I have so far:

https://www.youtube.com/watch?v=ep9UINA9jhM

Next is the biceps but I don´t know about the servos, the 805 is very expensive over here. I was wondering if I can use this one as well: http://www.hobbyking.com/hobbyking/store/__8496__turnigy_s8166m_high_tor...

wvantoorn's picture

Only the size should be

Only the size should be fixed, the rest, it will work.