I have had many requests in the past from people making projects who wanted to use MRL, but did not know how to incorporate it in their "already running" projects.
In the past MRLComm.ino was a sketch which you had to load into your Arduino in order to use MyRobotLab. But now, there is a kinder / gentler MRL ! It's now an Arduino library !
Now how can you use it with your own sketch!
Here is a very basic example. It only shows how to use the MRLComm library and get all the functionality which was previously in the MRLComm.ino sketch .. But wait there's more ! You may want to send some of you sensor data to MRL. NO PROBLEM (in fact Alessandruino wants to do this from his MPU06050)
I don't have a MPU06050 - so I'll just show you how to get 3 variables from your Arduino sketch into MRL using the MRLComm library (ax ay & az)
Setup is pretty easy - create a MRLComm object .. I chose to call my mrl (clever no?)
mrl will want a serial connection - so I gave it my Mega's first serial connection.
And now to get all the functionality MRLComm.ino had all you have to do is call mrl.process() in the loop.
Typically its very fast.
Now to send 3 variables back to MRL (specifically python). Here's our Python script ..
And thats it !
available in 1.0.57
https://github.com/MyRobotLab/myrobotlab/releases
caveats :
-
You will need to load the library like all Arduino libraries - this is well documented here -
The library itself can be found here - https://github.com/MyRobotLab/repo/blob/master/cc.arduino/1.0/MRLComm.z… - The skeleton & what is now needed as the "main" MRLComm.ino is in the zip - it has very little code - same as what is posted in the previous pictures.
- Only ints are currently handled - other data types unsigned longs, longs, byte[], char will be added in the future.
- There still needs to be a way to pass information from python (or other services) - to the Arduino sketch
SWEET!
I would totally pimp this at my next monthly robotics meet up but I'm going to be hanging out with the MRL nation in "the real world."
SHWEET !
Ya, ok - I'll do a release.. I have a feeling Alessandruino will be testing tomorrow.
Still have a TODO:
1. handle other types besides int. E.g. char, char*, byte[], long, unsigned long or whatever the Arduino can supply.
2. I would want at some point to be able to "send" data to the Arduino via Python - (python --> arduino) for example
arduino.sendMsg(bx, by, bz) - then have the mrl library give me the data in the Arduino sketch.. e.g.
if (mrl.onCustomMsg()){
int bx = mrl.getMsg();
int by = mrl.getMsg();
int bz = mrl.getMsg();
}
or *something* like that....
Cool grog :) ya...definetely
Cool grog :) ya...definetely I want to test it as soon as I m done with work work :) great job o/
Thank you Grog - As our minds
Thank you Grog - As our minds grow and our robots the control program MRL is growing. Thanks to you one day we all have real operating robots.
Thank you for all the time and effort you give us and help us. We all learning from the best.
Thanks grog, will implement
Thanks grog,
will implement this for chess board now :)
Testing Needed !
Initially its more complex to install, because you have to install an Arduino library ...
I went through the process myself and have tested it using the oscope & a servo .. it worky for me but Masta has problems
WORKY!
I updated to 1.0.57 and pushed the library based MRLComm.ino into my mega with Arduino IDE 1.0.3 on my MacBook. Then I fired up MRL and opened my pingdar python script and it worked.
WOOHOO !
MRLComm Library...
YAY!!! I was waiting for this... Kudos Grog... Ur my man...
Still trying to get it working though... :) I am sure it will get better...
1.0.57 and the servos
1.0.57 did not work for me. Everything seemed to be normal, added the library to the Arduino (using IDE 1.5) but all servos went crazy. Back on 1.0.56 things work normally again.
Speech was ok but servos not. Even had to disconnect the wires of the omoplate as it was out of control.
E.g. "close hand" he closed 3 fingers.
After I deleted the library my OS deleted all users and I was having a hard time to get back to the roots. No browser, no IDE, no MRL working.
I haven t tried controlling a
I haven t tried controlling a servo get.
The example sketch/script worky for me.
I noticed that if i Include wire.h library in the same sketch, the serial connection is borkeded and the arduino can t connect to mrl
I'll try this..
I'll try this..
Worky ! For me - mebbe you
Worky ! For me - mebbe you should send me the current sketch wich is failing for you and I'll try it...
This is what I'm using...
I got worky !
I got worky !
I'm wondering how to proceed
I'm wondering how to proceed now for to do the whole install.
Do we load this into the arduino with the IDE arduino. and then use MRL like before?