loading
 
Arduino Mega + two Futaba Servos + RoboRealm = Pan/tilt object following.
Techdetect from United States  [28 posts]
12 year
Steven,

I was wondering if you had some updated Robo VBscript file that would work well with the Mega.  I still get some random movement like it just goes wild.  I also would like to ask if you have some updated Arduino code as well.  

Thanks,  I am using the same VBscript as last time as well as the arduino code.  Also using an external power supply for both servos so power shouldn't be the issue (however i forgot the common ground to arduino but will check that again to make sure it wasn't the issue).  Thanks for Helping Steve.

Techdetect
Techdetect from United States  [28 posts] 12 year
I checked the common ground issue and still doesn't help.  The webcam a logitech 720P is attached to two servos which are hotglued together for a pan/tilt.  I am using RGB as the filter, also tried to use filter_variables module.  I have tried to just use the pan servo by disconnecting the tilt.  The pan servo with RoboRealm finds an object but goes back to the origional location and just keeps going side to side.  I just wanted to track the object using one servo first.  what am I doing wrong?  This time i did not use the external power source.  I think there is something wrong with my VBscript.  Have any idea.
Techdetect from United States  [28 posts] 12 year
All,  I have used another Arduino code as well as a new VBscript, it works well now, better than I thought is would.  Very happy in the US!
Anonymous 12 year
Techdetect,

It may be more helpful if you could post your robofile so that we and others could see more specifically what you are trying to do. Regardless, its good that you found a script that works!

STeven.
 [29 posts] 12 year
see if this is what your are attempting. I can send you the code.
http://www.youtube.com/watch?v=KSkZv-OyV9U&feature=plcp
Doyle
Techdetect from United States  [28 posts] 12 year
Thanks Doyle,

I would love to have the code, especially the voice.  I am not sure how to contact you though?  I loved the vid.  Represents very well and brilliant work!

Thanks for your reply.
Techdetect
Techdetect from United States  [28 posts] 12 year
Doyle and Steven,

Figured out the speak issue, works well.  I have it set to speak when an object is detected by saying "I see you", but when not detected it says "Where are you" .   I can't believe that I am actually modifying the VBscript to get the speak to work.  Thanks for your inspiration.  I guess the next step is to use Doyles' example to move the servos around in a random pattern to actually pan/tilt randomly.  Is this mostly arduino code or should i experiment using VBscript???  Would like direction here not code, as I am learning this as a hobby on my own.  Again, thanks for any direction you may provide.  
snipet:
OBJECT = GetVariable("COG_BOX_SIZE")
SpeakStr  = "where are you"
If OBJECT > 10 then SpeakStr = "I see you"
SetVariable "SpeakStr", SpeakStr
Thanks for your much appreciated responses,

Techdetect
Anonymous 12 year
The OBJECT returns the COG_BOX_SIZE as you have defined. I'm not sure if you are using a color tracking routine to qualify the OBJECT variable.

In my example I used a specific color as the qualifier then speak ("I found my pink ball") when the pan/tilt servo centered (+- 5 pixels) the camera. When COG_X or COG_Y is roughly 30 pixels past center, the pan/tilt velocity moves proportional in distance to catch up, and speaks "Searching...". As the it gets closer to center, the pan/tilt velocity becomes equal to distance until it is < 6 pixels from center. Almost like a PID loop in terms of the velocity and distance vector.

I used COG_BOX_SIZE to calculate distance (size) from the target and determine forward or reverse direction from the set static (range) value. The web cam tracks the orange bucket and when the PAN vector is greater than 30 pixels, it commands the motor controller to move proportional in speed and rotation toward the direction of the target/servo. Again, as the pan/tilt camera becomes center, the motor controller knows that everything is centered.
I will post the code when I shift to my programming PC.

The "GardenBot" video is here; http://www.youtube.com/watch?v=r-ZiGQP2G9s&feature=plcp

Best,
Doyle
Techdetect from United States  [28 posts] 12 year
I AM USING TRACK BY COLOR, SUCH AS GREEN MOST OF THE TIME.  IT SEEMS TO KEEP UP WITH THE COLOR I AM TRACKING NICELY.  IT JUST DOESNT HAVE A GREAT RANGE OF MOTION DUE TO X/Y SERVOS I AM USING.  I LIKE HOW YOU OVERCAME WHAT I WAS ATTEMPTING BUT I HAVEN'T MOVED TO MOTORS YET.  I JUST STARTED WITH H-BRIDGES NTE1749.  USED THE KEYBOARD FUNCTION A FEW WEEKS AGO AND HAVE BEEN MESSING AROUND WITH IR REMOTES FOR THE LAST FEW WEEKS.  AHH SO MUCH TO DO AND LITTLE TIME TO LEARN AND HAVE FUN.  I WOULD STILL LIKE TO SEE THE CODE IF YOU CAN POST.  THANKS D.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index