|
Re: Lag
I get this problem all the time, when debugging totally new segments of previously un-run code or heavily modified code.
The major cause is an error somewhere. I had the fun experience just yesterday while migrating code from the test vehicle to the real robots, forgetting to change a few resources (specifically, solenoids that were on Spikes are now on Solenoids). Every time the WPI lib gets an error, it logs it and sends it to the DS, which takes time. Times 2 for two Refnum Gets, plus the wait 33ms for the loop time, and it was enough to trip the watchpuppy on the drive motors. What did work was very very laggy.
A quick look at the Diagnostic tab showed me that there were errors coming in, the VI that caused the error, and the call chain.
It was helpful data, but in this case I would much rather ignore the error since it completely incapacitates the entire drive system.
To try:
Clear the errors and run your code again, to see what the Dashboard gives you in the Diagnostic tab.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor
"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
|