Quote:
Originally Posted by Ether
That statement taken at face value would seem to allow the following: Command A requires only Subsystem B and takes 1ms to complete.
Command X requires only Subsystem Y and takes 3 seconds to complete
Since Command A and Command X don't require writing data to the same Subsystems, they can be running simultaneously My question is, how does the CommandBased model implement this, if not by preemptive time-slicing.
Posts 6 and 8, and post 10 if I interpreted it correctly, would answer that question.
|
The commandbased model waits for a command's initialize, execute, or finish method to finish completely before moving on to the next method scheduled. There's no preemptive time slicing or threading going on. If your code for any command takes >20ms to execute, the whole thing falls to pieces.
The provided PID controller does start it's own thread to do PID math, and can update the motor speed from this thread too.