I now have most off the InMoov head and torso printed and I can move each servo in turn by connecting it to a single channel of my Arduino. I am now ready to run the head service but I want to add some features - articulated neck, individual x control of the eyes, drive some LEDS and maybe even add a tongue control? What's the best way to do this, do I have to download and compile everything or can I somehow overload the default service with my own?
Regards
Andrew
InMoov head
The InMoovHead service is a collection of several other services. It's just an easy way to start all the services is the head. You can override the settings in your python script or you can create your own python script that does the things that you want your head to do. The best way to learn MRL is to learn one service at the time. The InMoovHead service only use Arduino and Servo services. So I would start with writing a small Python script that starts the Arduino service and a Servo service.
The sourcecode for InMoovHead can be found here:
https://github.com/MyRobotLab/myrobotlab/blob/develop/src/org/myrobotla…
Copy and modify
OK so I can copy files and modify them, but how do I add them to MRL and run them - is there a tutorial?
Andrew
Execute a program in MRL
First you need to download and install MRL. You can use this turtorial:
http://myrobotlab.org/content/how-start-new-mrl
When all is installed, the you can write and execute scripts in the python tab.
It's not really python, but jython ( a java implementation of python ) so you can do almost anything in python that you can do in java.
File location?
So these files for my top-level script and all my new serviices, do I just copy them to the root directory of MRL or do they have to go in a special place?
Andrew
Script location
Hi
I suggest that you place your scripts in some other folder than the MRL folder.
If you install a new version if MRL, then the fisrt step is to delete everyting in the MRL folder, so your scripts would also be deleted. Doh.
/Mats
Debuging started
I've coded (hacked) with a lot of languages with a lot of compilers, but need a little help here please, excuse me if I get my terminology wrong.
I created a new class (service) for my InMoov head in "EricInMoovHead.java" (Robot's name is Eric) and a new top level class for my InMoov project in "EricInMoov.java". Both are in a sub-directoy of the mrl install.
When load my InMoov.java file into MRL and try to run it, I get (not suprisingly) an error:
<-------------
13:47:23.526 [python.interpreter.3] ERROR class org.myrobotlab.logging.Logging - ------
SyntaxError: ("no viable alternative at character '?'", ('<string>', 50, 22, '\t// port map NOT SURE ????\n'))
at org.python.core.ParserFacade.fixParseError(ParserFacade.java:95)
at org.python.core.ParserFacade.parse(ParserFacade.java:205)
at org.python.core.Py.compile_flags(Py.java:1976)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:267)
at org.myrobotlab.service.Python$PIThread.run(Python.java:180)
------
13:47:23.541 [python.interpreter.3] ERROR c.myrobotlab.framework.Service - python error Python error - ------SyntaxError: (no viable alternativ
-------------->
How do I go about tracking down this error? Which file is it in? Which line number?
Just a little help to get me going would be appreciated.
Thanks
Andrew
Java vs Python
Java and python are two very different languages.
The python tab expects the program to be written in python. You can't execute a Java program from there.
But you can use all the methods that each service makes available from there.
I suggest that you try some of the many python scripts that are available on this site to get you started,
For example http://myrobotlab.org/users/Mats has some scripts that can help you getting started.
I would wait with trying to develop in Java until you feel comfortable with using python and how to use the already existing services.
You can do almost everything in python except developing or changing the services.
Here is a guide to what methods you can use for each service:
http://myrobotlab.org/content/what-methods-can-i-use
I hope this helps to get you started.
/Mats
The mist is clearing...
OK so the two "sevices" I wrote (copied) were Java (hence the extension!) so I need to run a Python script to instantiate my top level InMoov service...
I'll read through those links, thanks Mats.
I must be missing something...
OK - I've had a look round and I can see how to connect to an "existing" service, but what if I have my own services? How tdo I get MRL to see those so that I can connect to them?
Andrew
MRL install for developers
Hi
You need to do a developer install using this guide:
http://myrobotlab.org/quick_start
Please note that you should select the developer branch, not the master branch when you clone the two repositories.
New path
Thanks Mats, looks like there is another learning curve ahead :-)
Really appreciate your help.
Andrew
One question per night :-)
I'll try to limit my questions. I have used Eclipse to develop C applications for the synthesisable MicroBlaze processor in Xilinx FPGAs but I've never used it with GIT or JAVA.
I got to the point where it says switch to the java view (did that OK) and double-click org.myrobotlab.service.Runtime - where should that appear for me to click on it?
Andew
Navigating
Hi
It should be on the left side in Eclipse. In the Package explorer window.
myrobotlab => scr => org.myrobotlab.service => Runtime.java
I was worried you were going to say something like that :(
I'm runnin Ubuntu 12.04, I intalled "Eclipse for Java Developers" there didn't seem to be an option to install "Eclipse Standard".
Maybe I didn't click "Import projects after clone"???????
I'll check...
Doh!
I now get an error when I try to run the debugger:
Error: Could not find or load main class org.myrobotlab.service.Runtime
java -version returns:
java version "1.7.0_95"
OpenJDK Runtime Environment (IcedTea 2.6.4) (7u95-2.6.4-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)
I set the runtime parameters in the debug configuration.
From Googling this seems to be a library problem? Either my Java environment is not set or I am missing some paths in Eclipse? That's just a guess???
Anyone got any ideas please?
yes Yes YES
I had to tick "JRE System Library [java-7-openjdk-am64" in the project settings "Java build path" dialogue.
Seem to be running now, well I have a gui :-)
Service written
So I have written my new service and added it to the Eclipse project. When I run runtime in the debugger my service is not show in the GUI. How do I make this service available to use?
Andrew
serviceData.xml
I tried adde an enty in serviceData.xml but it still does not appear in the list: at runtime -(
Well somthing runs...
I added an entry in serviceData.xml, but still can't see my service in the GUI runtime list.
Anyway I ran my python script to instantiate my new EricInMoovHead and it seemed to work, i.e. all the servos and arduino instances were created :-)
Now to get my top-level service to run....
PS, found some useful stuff here: http://myrobotlab.org/content/new-service-robot although it is not complete.