View Single Post
  #12   Spotlight this post!  
Unread 27-08-2014, 13:22
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,715
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: What base class do you use when programming?

Quote:
Originally Posted by jfitz0807 View Post
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).
The Command Based structure uses the IterativeRobot base class with extra functionality built around it. It sounds like you have been using the Command Based structure.