Hi guys! :)
I have a project that uses arduino and pan/tilt servos to track a desired color. With the use of a camera and myrobotlab, this project slowly come to life. I and with the help of GroG, are working on it to make it possible. However, it's not yet done and the project is still under progress. Here's some of the highlights of the project. Comments and Suggestions will be greatly appreciated :)
First, you need to download MRL:
-you can download MRL at this link. Be sure to pick the latest build ( at this time of writing, the latest is ver.770) Here's the link: http://myrobotlab.dyndns.org:8080/job/myrobotlab/ws/myrobotlab/dist/
Next is you have to extract and open the folder and open myrobotlab.bat file:
After a while it should run like this:
Notice the BORG tab selected :)
Next is you should download the arduino service. Just right click the arduino service and click install. The same procedure applies to the OpenCV service
NOTE: Some anti-virus programs don't permit downloading the services. For me, I turned of my firewall and it worked.
Here's a pic (disregard the start under the info. It should be install because I already downloaded the service)
After downloading the Arduino and OpenCV service, Run OpenCV service by right clicking and choosing start. Then, name your service. Here I called it OpenCV. Click the OpenCV tab and scroll down the filters and select the PyramidDown filter to avoid the video booming up in your screen XD. and select the camera button then press capture. Normally the stop button is capture. :
Next is select the InRange filter to select the color you want to be tracked. Click the Inrange filter. Play with the values until the desired color will become white.
Color tracking is a bit sensitive. Sometimes you should be consistent with the color ( due to poor lighting and etc. that affects the color consistency) so you'll have to update those values sometimes to get an accurate output.
Now, if you are all set, Remember the values in InRange filter. Like this from the picture above:
Parameters Min Max
HUE 3 33
SATURATION 87 256
VALUE 151 256
If you are done taking down the values select the jython tab and copy these codes. You NEED to replace the values in "change values of the InRange filter with your own values that you took down down a while ago.
Now if you are done copying. Hit execute button( the button with a gear :D) . Notice in the pic below the jython console is printing x,y coordinates that later will be sent to arduino.
Now, start arduino service and follow these steps:
1- click tools and choose board then select the arduino model you have
2- click again tools and choose Serial Device then select the proper COM port the arduino uses(at this time your arduino should be connected in your computer)
3- click the compile (check) button. Wait for it to finish compiling (when you see a "done" in the console)
4- click the upload button and again wait for it to finish
5- click the connect button. Wait for the "good times"
Test the connection by clicking the pins tab and selecting some analog pins to active. Put some wires or sensors (potentiometers, etc.) to the analog pins. Then, select oscope tab to view some values sent to the myrobotlab.
Stay tuned :)