Simplicity Is Beauty

And the following I think is very simple

http://somehost/services/myThingy/someMethod/parameter0/parameter1/…

Unfortunately - this breaks down when there is a "/" in the parameter :(
An example of this would be 

http://localhost/services/arduino/setSerialDevice//dev/ttyUSB0

instead of this being equivalent to 

arduino.setSerialDevice("/dev/ttyUSB0")

it becomes

arduino.setSerialDevice("","dev"/"ttyUSB0")

and explodes, because there is no 3 parameter setSerialDevice method on arduino ! 

I thought about the idea of using a doubl // to escape forward slashes (very bad idea !) - for multiple parameters and this type of encoding we wouldn't know if the slash was supposed to be on the end of one param or the beginning of another :(

BUT WAIT !  - just encode it with %2F ! ... with a little bit of hacking - now

http://localhost/services/arduino/setSerialDevice/%2Fdev%2FttyUSB0

becomes

arduino.setSerialDevice("/dev/ttyUSB0")

Yay !  I think now any method in MRL which has simple primitive type parameters can be accessed with a url  !


Need the python scripting engine on a remote system - no problem just use this url

http://192.168.0.2:7777/services/runtime/createService/jython/org.myrobotlab.service.Python


Update :)

Started an MRL instance with webgui & arduino (sprinklers) :)

opened the runtime - found the method createAndStart

created a clock & opencv service 
looked at services again .. Low and behold !!!

Lets look what InMoov Looks like :D

 


Looks like it would fit on a phone ... No ?   ;)

Here's the beginning of the REST interface - showing MRL with 3 Services running...

Open one up and you can see ALL - the methods for that service ... (there are lots) - the input text boxes are parameters

Some of them have no parameters .. like detach - the goal is to get this "link" to call servo01's "detach" method...

It's getting there :)


update... a little closer...

Served from the WebGUI service http://localhost:7777/services.html 
This is the Arduino menu .. gest what I want this method to do :D