Go to Post Any school official who isn't tickled pink by hundreds high school students, and teachers, and parents, and mentors spending their weekend celebrating STEM isn't a school official worth having. - Ian Curtis [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-02-2005, 15:29
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Panning algorithm

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?
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #2   Spotlight this post!  
Unread 20-02-2005, 20:22
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Panning algorithm

We've tried time and time again, and we couldn't find a way to do it. Now we just kinda hope it'll be in our robots field of view.
__________________
http://www.mikesorrenti.com/
  #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;
  #4   Spotlight this post!  
Unread 27-02-2005, 21:03
SpeakerSilenced SpeakerSilenced is offline
Programming/Electrical Team Member
#0219 (Team Impact)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Hackettstown, NJ
Posts: 28
SpeakerSilenced is an unknown quantity at this point
Send a message via AIM to SpeakerSilenced
Re: Panning algorithm

I found a really good way by accident...

just have it search for green and set the result in a variable called "cantfindgreen" 0 being it found it, 1 being it didnt, then put something like this in your code

if (cantfindgreen)
{
pan++
}

and on the top have it set the servos to the variable pan and tilt... No this does NOT break the servo... quite amazingly when it hits the end of it, it spins to the other side and continues...
__________________
"I want to put a ding in the universe" - Steve Jobs
  #5   Spotlight this post!  
Unread 28-02-2005, 13:53
ldeffenb ldeffenb is offline
Registered User
AKA: Lynn Deffenbaugh (Mr)
None #0386 (Team Voltage 386)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Florida
Posts: 75
ldeffenb has a spectacular aura aboutldeffenb has a spectacular aura aboutldeffenb has a spectacular aura about
Send a message via ICQ to ldeffenb Send a message via AIM to ldeffenb Send a message via Yahoo to ldeffenb
Re: Panning algorithm

For partlly that reason, we decided not to let the camera do its own pan, but hooked the pan servo to a PWM output on the RC. We start at one side and skip to the other until we get T packets that we like.

Lynn (D) - Team Voltage 386
  #6   Spotlight this post!  
Unread 01-03-2005, 18:11
Unsung FIRST Hero
Greg Marra Greg Marra is offline
[automate(a) for a in tasks_to_do]
FRC #5507 (Robotic Eagles)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2005
Location: San Francisco, CA
Posts: 2,031
Greg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond reputeGreg Marra has a reputation beyond repute
Re: Panning algorithm

For this reason we rewrote the camera code they gave us, basically from scratch.

It works a lot better now, but it was a lot of work.
  #7   Spotlight this post!  
Unread 08-03-2005, 16:19
SpeakerSilenced SpeakerSilenced is offline
Programming/Electrical Team Member
#0219 (Team Impact)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Hackettstown, NJ
Posts: 28
SpeakerSilenced is an unknown quantity at this point
Send a message via AIM to SpeakerSilenced
Re: Panning algorithm

Why wouldnt you want it to do that? Is there a flaw I am not seeing?
__________________
"I want to put a ding in the universe" - Steve Jobs
Closed Thread


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 19:53.

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