Go to Post You can build an amazing robot that is capable and beautiful on a limited budget. - Andy Baker [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
  #1   Spotlight this post!  
Unread 02-02-2009, 12:30 PM
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,182
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
TrackTwoColors execution time

It seems (at least in our tests) that the TrackTwoColors function from the example two color tracking code is bogging down the cRIO to an almost unusable point. Has anyone else had this issue?

Symptoms are as follows:
1) When function is called in sequence with motor control code, execution of the main loop is slowed to a few Hz, lagging operator control.
2) Code runs relatively quick when there are no HSL color matches in view. As soon as a pink or green target appears, regardless of orientation, the process slows down immensely. This makes sense, but the lag seems very big for the amount of code that is running.

To fix #1, we split the object matching code out into a separate thread, which fixed the motor update lag. Unfortunately, our servos now overshoot the target by quite a bit before the "target found" flag is raised.

We tried to characterize the execution time of the code block, and came up with the attached graph. I don't have the source on hand, but it looked something like this:
Code:
/*This runs in a seperate thread, so I have no idea how the other threads effect execution time.*/
Timer timer;
float start,finish,delta;
timer.Start();
while(1){
   start = timer.Get();
   TrackTwoColors(params here);
   finish = timer.Get();
   delta = finish - start;
   cout << start << "," << delta << endl ;
}
A graph generated from the stdout is attached. The low points happen when the camera is panning with no target, and the peaks occur when the target is upside down. The high holds occur when the target is oriented the correct way.

Is there any kind of hidden debug stuff going on? I have turned down all the do-debug flags in target.h, but I don't see a difference. I don't want to re-write a signal processor, and want to make sure I'm not alone before I start any such work.

Link to graph: http://i43.tinypic.com/119w6k9.png

Last edited by Tom Bottiglieri : 02-02-2009 at 12:33 PM.
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
Single button function execution RonStoppable102 Programming 2 01-05-2007 09:45 AM
User Processor Execution Time Andrew Blair Programming 1 02-12-2006 09:52 PM
Loop execution time for Autonomous code Transporter08 Programming 2 02-13-2005 04:17 PM
How to measure execution time? And code size? gnormhurst Programming 17 02-17-2004 08:06 AM
Actual execution time measurement Dan Technical Discussion 5 03-24-2003 11:36 AM


All times are GMT -5. The time now is 09:34 AM.

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