Open vmagro opened 9 years ago
I was planning on doing the drive without commands and then using commands and subsystems for whatever the game requires (shooter, intake, etc). Is this ok to do? Or is it better to use commands for everything including the drive?
It would work fine but Commands offer some advantages and can make the code cleaner. For example if you look at the 2014 code in Gateway robotInit I just bind commands to a bunch of buttons instead of having a bunch of if statements. As I'm looking I don't know why I had some button checks to do drive things in teleopPeriodic, I think we just ran into some issues and I had to fix them really fast and didn't have time to think about the best place to put it, but those really should've been in TeleopDrive command.
It's kinda subjective but I think there are some things that are fine to just throw in teleopPeriodic, like if you look at 2014 that's where I drive the intake, but that was only 1 line of code, while driving logic has the potential to become very complex
There's no reason to have anything with a Scheduler in there if you don't have any Commands. See my 2014 code or the WPILib docs for more info. If you are going to use the Command based architecture, there should be a Command subclass for driving that you just start in teleopInit and stop in disabledInit again see 2014 code for more info