|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ;
}
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. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Single button function execution | RonStoppable102 | Programming | 2 | 05-01-2007 09:45 |
| User Processor Execution Time | Andrew Blair | Programming | 1 | 12-02-2006 21:52 |
| Loop execution time for Autonomous code | Transporter08 | Programming | 2 | 13-02-2005 16:17 |
| How to measure execution time? And code size? | gnormhurst | Programming | 17 | 17-02-2004 08:06 |
| Actual execution time measurement | Dan | Technical Discussion | 5 | 24-03-2003 11:36 |