Go to Post ...never do something because it is comfortable, do something because you WANT to do it. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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
  #8   Spotlight this post!  
Unread 18-01-2009, 11:41
yoyodyne yoyodyne is offline
Registered User
AKA: Greg Smith
FRC #0116 (Epsilon Delta)
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Reston, VA
Posts: 61
yoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to behold
Re: Only intermittently finding the 2 trailer colors

Has anyone had a problem with the FindColor() function finding a color exactly every Nth call? We haven't had much time to look into this yet. We think we are waiting enough time between calls

To do this test we edited the now old Iterative robot example and added the following to the constructor:

if (StartCameraTask(10, 0, k160x120, ROT_0) == -1)
97 {
98 dprintf( LOG_ERROR,"Failed to spawn camera task; Error code %s",
99 GetVisionErrorText(GetLastVisionError()) );
100 }
101
102 // Set up camera tracking parameters.
103 tdata = GetTrackingData(GREEN, PASSIVE_LIGHT);


The periodic autonomous function as shown below prints the "found value..." to the console exactly every 5th time with 4 ShowActivity("\n") between.

void Team116_Demo::AutonomousPeriodic(void) {
158 // feed the user watchdog at every period when in autonomous
159 GetWatchdog().Feed();
160 ParticleAnalysisReport par; // particle analysis reports
161
162 m_autoPeriodicLoops++;
163
164 // generate KITT-style LED display on the solenoids
165 SolenoidLEDsKITT( m_autoPeriodicLoops );
166
167 if ((m_autoPeriodicLoops % 60) == 0) {
168
169 if (FindColor(IMAQ_HSL, &tdata.hue, &tdata.saturation, &tdata.luminance, &par)
170 && par.particleToImagePercent < MAX_PARTICLE_TO_IMAGE_PERCENT
171 && par.particleToImagePercent > MIN_PARTICLE_TO_IMAGE_PERCENT) {
172 // drive toward color
173 m_robotDrive->Drive((float)1.0, (float)par.center_mass_x_normalized);
174 ShowActivity("%s found: follow x value: %f", tdata.name, par.center_mass_x_normalized);
175 }
176 else
177 {
178 m_robotDrive->Drive(0,0);
179 ShowActivity("\n");
180 }
181 }


We have tried calling FindColor() at different rates with the same result. Any help would be appreciated.

Thanks,

Greg
Reply With Quote
 


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
Attaching Colors to Trailer UnknownMember Technical Discussion 0 15-01-2009 17:41
Low-Cost trailer drawings? (was: Trailer) DM7000 General Forum 2 07-01-2009 16:54
[FTC]: The Rack colors addictedMax FIRST Tech Challenge 3 18-09-2008 23:06
Recognizing the colors of the balls in autonomous mode Armando Gonzalez General Forum 13 05-01-2008 22:35
How do you read the colors on the tetras??? hedgehogger Technical Discussion 1 11-01-2005 17:54


All times are GMT -5. The time now is 13:17.

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