diff --git a/src/main/kotlin/frc/robot/RobotContainer.kt b/src/main/kotlin/frc/robot/RobotContainer.kt index 534b1428..b9230fd6 100644 --- a/src/main/kotlin/frc/robot/RobotContainer.kt +++ b/src/main/kotlin/frc/robot/RobotContainer.kt @@ -6,10 +6,11 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard import edu.wpi.first.wpilibj2.command.Command import edu.wpi.first.wpilibj2.command.Commands import edu.wpi.first.wpilibj2.command.button.CommandXboxController +import edu.wpi.first.wpilibj2.command.button.RobotModeTriggers import frc.robot.ControllerInputs.driverController import frc.robot.ControllerInputs.operatorController -import edu.wpi.first.wpilibj2.command.button.RobotModeTriggers import frc.robot.commandGroups.* +import frc.robot.lib.markAbnormalEvent import frc.robot.scoreState.AmpState import frc.robot.scoreState.ClimbState import frc.robot.scoreState.ScoreState @@ -116,6 +117,8 @@ object RobotContainer { operatorController().circle().onTrue(gripper.disableSensor()) operatorController().options().whileTrue(intake.reset()) + + operatorController().square().onTrue(markAbnormalEvent()) } fun getAutonomousCommand(): Command = autoChooser.get() diff --git a/src/main/kotlin/frc/robot/lib/MarkerCommands.kt b/src/main/kotlin/frc/robot/lib/MarkerCommands.kt new file mode 100644 index 00000000..4aa93fd8 --- /dev/null +++ b/src/main/kotlin/frc/robot/lib/MarkerCommands.kt @@ -0,0 +1,16 @@ +package frc.robot.lib + +import edu.wpi.first.wpilibj.Alert +import edu.wpi.first.wpilibj.DataLogManager +import edu.wpi.first.wpilibj2.command.Command +import edu.wpi.first.wpilibj2.command.Commands + +const val ABNORMAL_EVENT_NAME = "EVENT" +val alert = Alert(ABNORMAL_EVENT_NAME, Alert.AlertType.kWarning) + +fun markEvent(eventName: String): Command = Commands.runOnce({ + DataLogManager.log(eventName) + alert.set(true) // TODO: Make something that sets this to false after a couple of seconds +}) + +fun markAbnormalEvent(): Command = markEvent(ABNORMAL_EVENT_NAME) \ No newline at end of file