Package frc.robot.commands.autonomous
Class AutonomousSwitch
java.lang.Object
edu.wpi.first.wpilibj2.command.CommandBase
edu.wpi.first.wpilibj2.command.CommandGroupBase
edu.wpi.first.wpilibj2.command.SequentialCommandGroup
frc.robot.commands.autonomous.AutonomousSwitch
- All Implemented Interfaces:
edu.wpi.first.wpilibj.Sendable,edu.wpi.first.wpilibj2.command.Command
public class AutonomousSwitch
extends edu.wpi.first.wpilibj2.command.SequentialCommandGroup
Creates an autonomous according to the choices chosen in Shuffleboard.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAutonomousSwitch.IntakeSourcestatic classAutonomousSwitch.StartingPosition -
Field Summary
Fields Modifier and Type Field Description doubledelayjava.lang.StringdescriptionAutonomousSwitch.IntakeSourceintakeSourcebooleanpushRobotdoublerobotLengthAutonomousSwitch.StartingPositionstartingPosition -
Constructor Summary
Constructors Constructor Description AutonomousSwitch(AutonomousSwitch.StartingPosition StartingPosition, double Delay, boolean PushRobot, AutonomousSwitch.IntakeSource IntakeSource)Creates an autonomous according to the choices chosen in Shuffleboard. -
Method Summary
Modifier and Type Method Description static booleandoChoicesWork(AutonomousSwitch.StartingPosition StartingPosition, AutonomousSwitch.IntakeSource IntakeSource)Checks if this is a valid choice.booleanmatchesSettings(AutonomousSwitch.StartingPosition StartingPosition, double Delay, boolean PushRobot, AutonomousSwitch.IntakeSource IntakeSource)Methods inherited from class edu.wpi.first.wpilibj2.command.SequentialCommandGroup
addCommands, end, execute, initialize, isFinished, runsWhenDisabledMethods inherited from class edu.wpi.first.wpilibj2.command.CommandGroupBase
clearGroupedCommand, clearGroupedCommands, deadline, parallel, race, requireUngrouped, requireUngrouped, sequenceMethods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem, withNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
startingPosition
-
delay
public final double delay -
pushRobot
public final boolean pushRobot -
intakeSource
-
description
public java.lang.String description -
robotLength
public final double robotLength- See Also:
- Constant Field Values
-
-
Constructor Details
-
AutonomousSwitch
public AutonomousSwitch(AutonomousSwitch.StartingPosition StartingPosition, double Delay, boolean PushRobot, AutonomousSwitch.IntakeSource IntakeSource)Creates an autonomous according to the choices chosen in Shuffleboard.- Parameters:
StartingPosition- Where the robot starts on the field (right of power port, left of it, or directly in front of it).Delay- How long the robot should delay starting its automous, in seconds.PushRobot- Whether our robot will push another robot across the initiation line.IntakeSource- Where we intake power cells from after shooting (trench, rendezvous, or a mix of the two).
-
-
Method Details
-
matchesSettings
public boolean matchesSettings(AutonomousSwitch.StartingPosition StartingPosition, double Delay, boolean PushRobot, AutonomousSwitch.IntakeSource IntakeSource)- Parameters:
StartingPosition-Delay-PushRobot-IntakeSource-- Returns:
- Whether these inputs would create the same autonomous as currently exists (i.e. all settings match exactly).
-
doChoicesWork
public static boolean doChoicesWork(AutonomousSwitch.StartingPosition StartingPosition, AutonomousSwitch.IntakeSource IntakeSource)Checks if this is a valid choice.- Parameters:
StartingPosition-IntakeSource-- Returns:
- Whether this can create an autonomous.
-