|
Re: Organized, multiple source code vs everything in one code.
Every mechanism has its own object, from its own class in a separate file. For instance, DriveStation2011.py deals with getting which button from where on the driver station. Everything that needs button presses goes through GetTriangle() or similar, so if the triangle button changes port it's all in one place. For safety, every motor system has its own motor output class, and the system has access to its own sensors in addition to the regular code. That way, we can put limit stops in the actual motor output and so long as we drive motors through the output class, we never have to worry about it anywhere else. We also created DualSpeedControllers, which allow us to treat two motors as one when setting outputs. On top of all that, there is a LineFollowing class for driver aid which is used by both autonomous and teleop to keep track of what state it is in- the driver holds down a button and it follows a line. The LineFollower object keeps track of whether it is drifting off in which direction and also whether we have already found a fork and are refollowing it, etc, exactly the same as in auto, so if we make line following better in auto, it automatically is better in teleop.
__________________
Student 294: 2007-2011
Mentor 597: 2013-2015
Google SWE: 2015-
Last edited by remulasce : 01-03-2011 at 00:20.
|