View Single Post
  #18   Spotlight this post!  
Unread 17-02-2009, 00:05
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

Quote:
Originally Posted by CardcaptorRLH85 View Post
Is there any way that we could see a sample of your newImageAvailable() function Kruuzr? I'm looking at the GetImage() function but I see it returning an int (1 for success and -1 for failure). Not the double timestamp.
Sorry I didn't get back to you earlier. (Last build night already started).

I don't have the code in front of me, but I believe the two parameters for GetImage() are Image* and double*. It may get the image into your Image* param but it also puts the timestamp into your double. The code looks something like this:

Image* image; // created using frcCreateImage() somewhere else

bool newImageAvailable()
{
double timestamp;
static double lastTimestamp = 0.0;

GetImage( image, &timestamp );
if ( timestamp > lastTimestamp )
{
lastTimestamp = timestamp;
return true;
}

return false;
}

I may have missed something but I think that's it.

Steve C.
Reply With Quote