This is a fairly simple (and not so exciting) demonstration of a distributed system using MRL. Although the demo is rather boring, the concept of distributed control systems is great ! The general idea is that systems of a robot, or multiple robots can be shared and utilized with no boundaries, as long as there is a viable network in place. Multiple computers can be invovled in coordinated processing, which makes MRL very scalable.
Ok, on with silly demo :
step 1 - There is one rule in MRL (no one talks about MRL) .. no heh .. that's not it .. All service names must be unique ! The default runtime service in MRL starts with its name "runtime" but this (as any service) can be changed in the startup script.
copy past startup script (this case I'm running Windows, but all concepts are the same on Linux)
in this case i've renamed it myrobotlab02.bat
Edit the new copy. The -service is a list of names and Service to be started. In this case I'm changing the name of the gui to gui02 the name of the python engine to python02 and adding a RemoteAdapter named remote02. The Runtime is always the first service started regardless of what is put first, so it has its own parameter to change its name. I will change the name of this runtime to runtime02 with the command
-runtimeName runtime02
RemoteAdapter allows other remote MRL instance to connect (inbound connection). Any MRL (with or without a RemoteAdapter) can connect to another MRL instance running the Adapter (outbound connection). This is by design to simplify security.
Start the two scripts and 2 instances of MRL will appear. All services between them will have UNIQUE SERVICE NAMES (very important)
Now you can connect myrobotlab instance to myrobotlab02 instance.
They are now CONNECTED !!! - each can see and use the other's services. New tabs appear, and are different colored because they are from a remote instance.
Now we are going to create a Clock service named clock01, in the myrobotlab02 instance,
from the myrobotlab01 instance. First select the "remote" runtime02 tab, then right click start new Clock service. This is "remote control" and creates a Clock instance in myrobotlab02.
New tabs and displays appear in both instances. The clock can be controlled and the display is changed in both gui's event though its running in only one. WooHoo! This could happen on different computers thousands of miles apart.
So boring demo, but important point. Distributed applications can be very strong because they may have many friends on the internet who will help. Yay !
Hey Grog, I tried this
Hey Grog,
I tried this tutorial today on v1695.
So from what I understand, the two instaces of MRL running are like mirror image of each other which keeps the services and the GUI in sync in real time. (Please correct me if I am wrong here).
Now for my testing I initiated the chess service and played a move to see if the GUI stays in sync. But I am getting error in sending data (screenshot attached below).
(the above image shows the screen when I establish the connection and start new service, all seems good till here)
(the above image shows me the error, this happens when i try to play a game move in GUI02)
I thought this error might be due to the older version, but the newer releases ( .jar files) dont have a (.bat) file to edit in the directory, so could you please guide me regarding what to do in this case??
The problem probably is the
The problem probably is the GUI (lot of data to pass) .... so needs improvement
Moving data consistently over
Moving data consistently over the netork is (non-trivial)
I noticed this was borked in the latest release - but quickly got it fixed up so that at least Runtime, GUIService & Clock work in a distributed system.
The error your getting has to do with something which either needs to be serialized or marked as transient.
Before I look into the details I was wondering what you intend to do with it ?
Are you going to play chess from a different computer?
Yes, I intend to use this
Yes, I intend to use this distributed functionality to play chess on different computer.
Actually, Ill write a detailed blog post showing the physical board and stuff, and ill also explain in that how I plan to use ditributed functionality.