Go to Post Your drivetrain is THE most important system on your robot. Don't rob from it. - Monochron [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
  #16   Spotlight this post!  
Unread 16-02-2009, 13:12
Kruuzr Kruuzr is offline
Mentor - electrical, software
AKA: Steve Cote
FRC #1922 (Ozram)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Henniker, NH
Posts: 33
Kruuzr has a spectacular aura aboutKruuzr has a spectacular aura about
Re: TrackTwoColors execution time

Another aspect that will effect the CPU loading is how often you are calling the TrackTwoColors() routine. The number of images per second that are retrieved from the camera is set at the StartCameraTask() call. Once you have a new image and process it once, if you keep calling TrackTwoColors() you will not only chew up CPU time, but you will keep getting the same answer back (you're checking the same image). If the camera task is a lower priority than the main task (I don't know) then the constant vision processing in the main loop may be backlogging the camera task. Regardless, it's a whole lot of useless CPU hogging.

We made a 'newImageAvailable()' function, which uses the GetImage() function (which returns a timestamp) to determine when a new image is available. So we only have to do our version of the TrackTwoColors() call once per new image. With a 160x120 image size, we easily do 15 frames per second. We could maybe do more but haven't tried.

Steve C.
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 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


All times are GMT -5. The time now is 14:27.

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