Go to Post Proof: Remove the motor from it's mechanical house of bondage and it will operate just fine - Mike Betts [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 27-02-2005, 10:47
kokodabear's Avatar
kokodabear kokodabear is offline
HELP!
AKA: Brady
#0686 (Bovine Intervention)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Frederick, MD
Posts: 13
kokodabear is an unknown quantity at this point
Send a message via AIM to kokodabear
Re: Panning algorithm

Quote:
Originally Posted by jgannon
I'm working on a way to make the camera pan around until it finds green, because if the target is just out of its range of view, it continues looking straight ahead. The problem that I've run into is that when I manually set the servos, it disables the automatic tracking, and it's really inefficient to repeatedly switch between automatic and manual modes. Has anybody written an effective algorithm for panning to find a color?
Who needs default code anyway? Make your own auto tracking code so you dont have to switch modes. Remember that servos have to stay between 46 and 210, and use cam.x and cam.y to determine how to adjust them.

As for panning, try this: (haven't tested but should work)
Code:
// At top of file
int tempPan = 128; // Starting Position
char tInc = 4; // Rotate Speed


// In autonomous 26.2 ms loop
if (tempPan==210 || tempPan==46) {
	tInc *=	-1;
	tempPan	+= tInc;
}
else if	(tempPan + tInc	> 210)
	tempPan	= 210;
else if	(tempPan + tInc	< 46)
	tempPan	= 46;
else
	tempPan	+= tInc;
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic Shifting Algorithm phrontist Programming 10 29-07-2004 22:47
Warnock´s Algorithm sutto Computer Graphics 2 24-05-2004 14:05
Traction Control Algorithm Mr. Lim Programming 3 20-01-2004 14:26
Arcsin Calculation Algorithm Leo M Technical Discussion 11 05-11-2001 08:31


All times are GMT -5. The time now is 07:39.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi