Closed shreyasprasad14 closed 5 years ago
Right now all of the drive methods are dependent on controller input -- this is fine for testing, but with a large emphasis on semi-autonomous movement it might be worth it to write your drive methods in a more controller-agnostic way. That is, have a drive(float leftInput, float rightInput, ...)
method and overload it with a drive(XboxController controller)
method which will parse input to drive(float ...)
and maybe do a few controller-exclusive functions. This will make the code more scalable when adding autonomous function calls.
Doesn't the driveMotors method already do that, or am I misinterpreting what you're saying?
A drive
method would probably do something a bit more general than what driveMotors
does. You can choose the design, but I think generally it would be difficult for some outside autonomous class to directly call driveMotors
in a coherent way without doubling all the information that SWDrive
is already using.
That said, I know @rbapat wanted to change the style of implementation from previous few years', so it's possible that drive
is purposefully limited to manual control and you want to completely separate calls for different drive modes (e.g. manual and autonomous), in which case this is a total non-issue.
Tested and debugged Drivebase & Transmission Speed Switch, works as intended.