View Single Post
  #2   Spotlight this post!  
Unread 10-02-2009, 21:25
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Optimising the camera

Quote:
Originally Posted by shrimp View Post
Firstly, how do I see how many fps I'm getting, the CPU usage, etc? Is it possible and how?
the actual fps is in the camera init function, the first arg, but to find how fast you loop:
at the top: create a new timer
Timer tmr = new Timer();
just before the loop in auto or where ever your code is:
int timesrun=0;
tmr->Start();
in the loop:
timesrun++;
if (tmr->Get() >= 1.0)
{
tmr->Stop();
printf("This cycle was at %i Hz\n", (timesrun/tmr->Get());
tmr->Reset();
timesrun=0;
tmr->Start();
}

then open the console and every second, it should tell you the speed of the loop
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib