|
Re: What base class do you use when programming?
Would someone please explain the difference between a CommandBased robot and an IterativeRobot?
We went to java in 2012 and started with the RobotBuilder tool. It generated a code skeleton derived from IterativeRobot. The IterativeRobot class is contained in sunspotfrcsdk\lib\wpilibj.src\edu\wpi\first\wpilib j. I have not been able to find a CommandBased class in the wpilib.
The IterativeRobot is "command based" in the sense that on every iteration of the control loop, it executes any active commands. I'm not sure how a CommandBased robot would be any different.
As for multi-threading, we can get into a theoretical discussion on the merits of multi-threading on a single CPU platform. In general, I prefer the explicit control of keeping things single threaded and using the setInterruptible or cancel methods if I need to preempt a running command.
But this would be a discussion for a separate thread (so to speak).
|