Closed drewwhis closed 4 years ago
When we create commands, there are a few steps we want to follow. These are slightly different for default commands, so we'll look at regular commands on a separate task (#14)
To set up a default command, we want to do that in the constructor of the RobotContainer. For this particular command, we want to make sure the driver control has been created, first.
private final Joystick mDriverOneController = new Joystick(0);
.mDriveSubsystem.setDefaultCommand();
.mDriveSubsystem.setDefaultCommand(new DriveCommand());
.mDriveSubsystem.setDefaultCommand(new DriveCommand(drive, joystick));
.A similar process would be followed for any other subsystem that needs a default command. The default command runs when no other command is using the subsystem.
One key for a default command vs. other commands is that the default command's isFinished
should always return false.
Breanna and Maison knocked this out on Saturday.
This depends on #5