Society of Robots - Robot Forum

Software => Software => Topic started by: bootstrap on March 05, 2009, 11:30:56 AM

Title: PID code /algo for object following using camera
Post by: bootstrap on March 05, 2009, 11:30:56 AM
Hi,

I want to make a PID based object following robot.I am getting the target object's X and Y using roborealm.I am using differential drive using modified servos with speed control.Please guide me about the algo to achieve the object following using differential drive.

Thanks in advance
Title: Re: PID code /algo for object following using camera
Post by: superchiku on March 05, 2009, 11:34:48 AM
suppose the object is red...run a mean filter...then a red filter...hen a threshold....

after that u shl get the objct filtered out...then what do u do is that u use the centre of gravity module.,...

if the centreof gravity is on left...then go left...if the centre o gravity is on right ...then go right...simple...
Title: Re: PID code /algo for object following using camera
Post by: airman00 on March 05, 2009, 11:51:07 AM
i would also set up some equation so that a center of gravity that is 30 off the center turns faster than a center of gravity that is 5 off the center.
Title: Re: PID code /algo for object following using camera
Post by: superchiku on March 05, 2009, 11:58:36 AM
thats the basic idea of how to do pid control...yes airman's enhancement is cool too...

i have go t a queston for uairman..in ur butler bo u used roborealm right...??

if ys then tell me how did u control the motors..i mean iam trying to pass out commands vi wireless serial commm...did u do that??

and also i want t add gui like u did...i want to import it from visual basic or java...how do u use them with roborealm??
Title: Re: PID code /algo for object following using camera
Post by: airman00 on March 05, 2009, 01:07:36 PM
thats the basic idea of how to do pid control...yes airman's enhancement is cool too...

i have go t a queston for uairman..in ur butler bo u used roborealm right...??

if ys then tell me how did u control the motors..i mean iam trying to pass out commands vi wireless serial commm...did u do that??

and also i want t add gui like u did...i want to import it from visual basic or java...how do u use them with roborealm??
Make a Roborealm program to "talk" to a custom program , I used VB6. Its called "sockets" look that up. Then the VB6 controls motors through the serial.
Title: Re: PID code /algo for object following using camera
Post by: superchiku on March 05, 2009, 01:20:33 PM
ya i know socket programming but how do u se them in roborealm and vb???

can i do the same thing in visual c++???
Title: Re: PID code /algo for object following using camera
Post by: bootstrap on March 06, 2009, 03:43:28 AM
I have built a serial servo control with a protocol to control 4 servos and even a GUI in VC++6.I am using roborealm for image processing.I am able to read the X and Y of the target red color object.But what algo/logic should I use to perform a smooth object tracking with the pan-tilt unit.Please suggest.

(http://www.flickr.com/photos/30169146@N04/3332963912/in/photostream/)
(http://www.flickr.com/photos/30169146@N04/3332963916/in/photostream/)

(http://<a href="http://www.flickr.com/photos/30169146@N04/3332963916/" title="Camera tracker by infibit, on Flickr"><img src="http://farm4.static.flickr.com/3355/3332963916_3cd720b1f3.jpg" width="500" height="366" alt="Camera tracker" /></a>)

(http://<a href="http://www.flickr.com/photos/30169146@N04/3332963912/" title="Serial servo controller by infibit, on Flickr"><img src="http://farm4.static.flickr.com/3639/3332963912_957109261f.jpg" width="500" height="313" alt="Serial servo controller" /></a>)
Title: Re: PID code /algo for object following using camera
Post by: airman00 on March 06, 2009, 06:04:29 AM
ya i know socket programming but how do u se them in roborealm and vb???

can i do the same thing in visual c++???
Oops sorry I didn't mean socket, I meant Pipes.
http://www.roborealm.com/help/Pipe_Program.php (http://www.roborealm.com/help/Pipe_Program.php)
Title: Re: PID code /algo for object following using camera
Post by: bootstrap on March 06, 2009, 08:01:11 AM
People are we not drifting a little bit out of the main question.Please tell me after getting COG_X and COG_Y how do I implement the PID algo to do object following.
Title: Re: PID code /algo for object following using camera
Post by: superchiku on March 06, 2009, 10:42:27 AM
asi told u cog x and cogy tell u the centre of gravity..then what u dois that ...u put it in some equation which u must develop which tries to find out th angle ur robot will turn either left or right or go straight...and accordingly send signals to ur motor


airman socket can also be used as iam usin java to create gui and send signals to the robot...via wireless seral comm...