Here's a quick blog post to help poeple get started using an AIML based InMoov in MyRobotLab...

To keep things simple this will go over downloading the "latest build"  , cloning the pyrobotlab github and launching the Harry.py  script 

Some key features of this are that each InMoov gesture is defined in a separate file (checked into the pyrobotlib project) and that the spoken responses and actions are managed by ProgramAB and defined by the chat bot named "harry" ...

Step 1.

download latest myrobotlab build and do the typical "install all" for the services.  hopefully that's all worky

Step 2. 

clone the pyrobotlab repository with the example "harry" chat bot.

git clone https://github.com/MyRobotLab/pyrobotlab.git 

Step 3 

find the file in the pyrobotlab github  /home/kwatters/Harry.py and edit the "aimlPath" and "gesturesPath" variable to make sure it's pointing to where you've cloned the pyrobotlab project.

update the left/rigth ports setting in harry.py and add any servo min/max settings as you normally would.

Step 4

run the harry.py script.

 

Notes: 

ProgramAB expects to find aiml files in the proper location so that i can load the bot.

Assuming you've installed MyRobotLab in the "C:\MyRobotLab" directory  for these instructions

Normally MyRobotLab when it installs the ProgramAB service , program ab will install programAB stuff into the following directory:

c:\MyRobotLab\develop\ProgramAB\
 
It has 1 subdirectory where the bots are stored
 
c:\MyRobotLab\develop\ProgramAB\bots
 
Each bot's brain has it's own subdirectory. the default ones are listed below
 
c:\MyRobotLab\develop\ProgramAB\bots\alice2
c:\MyRobotLab\develop\ProgramAB\bots\currentevents
c:\MyRobotLab\develop\ProgramAB\bots\jokebot
c:\MyRobotLab\develop\ProgramAB\bots\wndef
 
Admitedly, you probably only care about the "alice2" bot..
 
each bot has it's set of "aiml" files.
Those are expected to be in the following directory
 
c:\MyRobotLab\develop\ProgramAB\bots\<bot_name>\aiml
 
Replace "<bot_name>" with the name of the chat bot that you want to make available.
 
ok.. now lets say  your "ProgramAB" directory is stored somewhere else. for example.. if it's in the pyrobotlab project.
 
Lets say you cloned "pyrobotlab" into a director like   "C:\pyrobotlab"  ...  In order to tell ProgramAB that it should look in a different directory you can use the ProgramAB.setPath(path)  method.
 
so you could update the aimlPath in the harry.py script to say the following:
 
aimlPath = "c:/pyrobotlab/home/kwatters/harry"
aimlBotName = "harry"
aimlUserName = "Kevin"
harry = Runtime.createAndStart("harry", "ProgramAB")
harry.setPath(aimlPath)
harry.startSession(aimlUserName, aimlBotName)
 
 
If you look at the directory structure of the c:/pyrobotlab/home/kwatters/harry folder you'll see 2 subdrectories.
 
c:/pyrobotlab/home/kwatters/harry/bots/
and 
c:/pyrobotlab/home/kwatters/harry/gestures
 
the "bots/harry/aiml" folder has the aiml
the "gestures" folder has the gesture python files.
 
 
In this case we're replacing the normal default directory of "c:\MyRobotLab\develop\ProgramAB" with  "c:\pyrobotlab\home\kwatters\harry"
 
this is done with the "harry.setPath(aimlPath)" command...
 
 
 

 

 

moz4r

8 years 5 months ago

Thanks for the comunity, it's a great job ! i look at this with attention. I will try to make a ready to start package for  users, with other stuff. 

Maybe I add your recomendation : strandardize by angle. So do I need to edit all gestures or I must wait some Inmoov service modification ?

Thanks Kevin for writing this post!

I now got it working properly, what need to do now is to modify some stuff to avoid double speaking as I mentionned to you on the chabox.

Thanks again for the great work!

Hello, I am having a problem with kwatters Harry.py script. When I run it this is the error that I get

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

Traceback (most recent call last):  File string, line 60, in moduleNameError: name python is not defined   at org.python.core.Py.NameError(Py.java:284)        at org.python.core.PyFrame.getname(PyFrame.java:257)              at org.python.pycode._pyx3.f$0(string:98) at org.python.pycode._pyx3.call_function(string)              at org.python.core.PyTableCode.call(PyTableCode.java:167)             at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.Py.runCode(Py.java:1386)           at org.python.core.Py.exec(Py.java:1430)              at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:267)        at org.myrobotlab.service.Python$PIThread.run(Python.java:177)------

I cant launch the hary servico also, i guess the path for the programAB is not correct but i cant seem to understand where to configure it!!

 

Can you help me?

 

AttributeError: 'org.myrobotlab.service.ProgramAB' object has no attribute 'setPath'

you can comment out that line. or replace it with :

ear.addListener("publishText", "python", "heard")

Odd that there is a semicolon at the end of that line.  That's not valid python syntax.

Also, your issue seems to indicate that python isn't running as a service.  Are you sure you've got everything installed correctly?

I suspect there's some issue with how your running the script, or how you installed the services or somethjing like that.

you can comment out that line. or replace it with :

ear.addListener("publishText", "python", "heard")

Odd that there is a semicolon at the end of that line.  That's not valid python syntax.

Also, your issue seems to indicate that python isn't running as a service.  Are you sure you've got everything installed correctly?

I suspect there's some issue with how your running the script, or how you installed the services or somethjing like that.

But isnt the 1.0.119 the latest build, what u mean by doesnt work with 1.0.xx :)

 

i think my problem is the path bor the ABprogram

also ive been seeing, that acapela doesnt work in linux... maybe thats the problem im using ubunto atm