How to save what you do

This is in response to wkinnes question about how to save your work in MRL.

The best way to save your work is by creating a Python script, because they can be saved. The GUI is good for playing around with as a beginner, but not really a good way to get a permanent result.   

The generic way to start a service from a python script is like this.

arduino1 = Runtime.createAndStart("arduino one","Arduino")

This will create an object arduino1 that you can use later in the script. The service will be seen as "arduino one" in the GUI and it can also be reference with that name in. "Arduino" is the name of the service as you find it in the list of services. The names of services are case sensitive.  

For the Arduino, the next step is to connect to the USB port. On my computer it's COM3. You do it like this:

arduino1.connect("COM3")

You can start the InMoovHead the same way.

inmoovhead = Runtime.createAndStart("Head","InMoovHead")

When you do this you can see that this service also starts an Arduino service and serveral servo services. So if you use this method you don't need to start any Arduino service. It still needs to connect to the USB port like this:

inmoovhead.connect("COM3")

When using the InMoov head service to connect, it connects to the Arduino, and it also attaches the servos to the defaullt pins for the head  of InMoov. 

To find out what you can do with different services, you can look at the documentation in several different ways. The link below wil help you find out more. If you need more help, please ask short questions in the shoutbox, and questions that reqires a little more explanation in the Forum. 

http://myrobotlab.org/content/what-methods-can-i-use

I notice that the servicepage for the InMoovHead service is a little outdated. I will try to make it more up to date with the latest version.

Good luck with your InMoov build :)

wkinne's picture

???

working on it but not easy. I am using the windows gui, fewwer problems sorta. But I keep locking it up. How do I load my old script? when i push "open" a very very small window opens that is empty and to small to even type in. I am too old to keep learning all this young stuff

 

 

wkinne's picture

fustration

it is very fustrating when it works one time but not another. I close mrl, restart it and now it will not attach any servos

 

wkinne's picture

a

a