Closed jimmyli97 closed 9 years ago
Ok I think the solution to this is to simply not do it at all - all motor loop code will go inside Motor.h. The driveResetEncoders function was removed as of fc25b463d01ba8f5e8c35b4f5e4d3a6c2581491d. I'll go ahead and close this.
Currently the way we loop through all motors requires the assumption that the motor definitions are initialized. This means that we have to include the code guard if(motorDefsInitialized), which is very ugly.
We don't want to force code outside of motor.h to use motorDefsInitialized, so all code that loops through motors (such as encoder functions) must be placed in motor.h.
We currently have one function that breaks this rule, which is driveResetEncoders in Drive.h
We have to figure out some way of letting any code loop through all motors. In python we could do this with a generator but this isn't python.. :(