Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add marker button #74

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
5 changes: 4 additions & 1 deletion src/main/kotlin/frc/robot/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,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
Expand Down Expand Up @@ -116,6 +117,8 @@ object RobotContainer {
operatorController().circle().onTrue(gripper.disableSensor())

operatorController().options().whileTrue(intake.reset())

operatorController().square().onTrue(markAbnormalEvent())
}

fun getAutonomousCommand(): Command = autoChooser.selected
Expand Down
11 changes: 11 additions & 0 deletions src/main/kotlin/frc/robot/lib/MarkerCommands.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package frc.robot.lib

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add the time since match start/match end. Did you check it's convenient in the console tab? I would also add error/warning so AdvantageScope will color it (check their docs for the exact wording).


fun markEvent(eventName: String): Command = Commands.runOnce({ DataLogManager.log(eventName) })
rakrakon marked this conversation as resolved.
Show resolved Hide resolved

fun markAbnormalEvent(): Command = markEvent(ABNORMAL_EVENT_NAME)