Quote:
Originally Posted by Ginto8
If you're running your loop in teleopPeriodic(), your latency will probably be closer to 20ms (that's the default period). However, making a higher-frequency loop with a TimerTask is definitely feasible. 1ms, I'm not sure of, but what I'd do is bring it down to 10ms, then 5ms, and see how the CPU usage is affected (you can check that with the DS Log Viewer). As long as you stay below ~80%, you should be fine. You could push it higher if you're certain there won't be any occasional peaks that take up that 20%.
|
We used a TimerTask for our shooter control last year, and decreasing the loop time definitely made the shooter more responsive. As long as what's running isn't too complicated, you should be able to get the loop time down to 5 ms.
If you wanted to go even faster, you could make a new thread and call thread.yield(), so that it runs as fast as possible, without affecting your other threads.