|
Re: nagging problem with CPU usage
I ran your code on my roboRIO and the disabled CPU load was about 30% and teleOp was about 60%. Of course I don't have the CAN devices or RoboRealm running on a tablet, so I'm getting lots of errors and may not be running some of the code. In the profiler, the biggest contributor was the CAN updates.
As a test, I converted the CAN Talon SRX in Begin into a PWM Talon SRX and the numbers changed to 20% and 40%. Of course there were still lots of error, and different errors, but in general, using CAN when the Talon is in power mode, the equivalent of PWMs, will be more expensive. Until this is on a real robot with a true CAN network, I don't trust my numbers much, but this may be a pretty easy experiments for you to run.
Using CAN for velocity control, position control, or other things that cannot be done easily with PWM is certainly worth it, but there is additional overhead to CAN, and for PWM, it will somewhat your CPU usage.
Greg McKaskle
Last edited by Greg McKaskle : 13-02-2016 at 09:03.
Reason: A bit more on CAN
|