Quote:
Originally Posted by Greg McKaskle
For C++ and Java, you can use tasks or allocate threads. I do not think that commands currently use more than one thread. PID subsystems do, however. So WPILib code in these languages will automatically get some use from multiple cores. As with PID, WPILib can do some things automatically, and that will likely happen over time. Other libraries such as OpenCV may also internally use threads to use multiple cores.
|
That is correct. Commands do NOT use multiple threads. The scheduler calls the execute method in a command once about every 20 ms. PIDController does spin up a thread to handle updating the motor, which also loops every 20 ms.