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

LED #12

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

LED #12

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/main/kotlin/com/team4099/robot2021/Robot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.team4099.robot2021

import com.team4099.lib.logging.Logger
import com.team4099.lib.smoothDeadband
import com.team4099.robot2021.auto.modes2021.EnemyTrenchMode
import com.team4099.robot2021.auto.modes2021.ThreeBallMode
import com.team4099.robot2021.commands.climber.LockClimberCommand
import com.team4099.robot2021.commands.climber.OpenLoopClimbCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.team4099.robot2021.auto.modes2021
import com.team4099.robot2021.auto.PathStore
import com.team4099.robot2021.commands.drivetrain.AutoDriveCommand
import com.team4099.robot2021.commands.shooter.ShootAllCommand
import com.team4099.robot2021.commands.shooter.VisionCommand
import com.team4099.robot2021.subsystems.Drivetrain
import com.team4099.robot2021.subsystems.Shooter
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup
Expand Down
17 changes: 17 additions & 0 deletions src/main/kotlin/com/team4099/robot2021/commands/led/LEDCommand.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.team4099.robot2021.commands.led

import com.team4099.lib.logging.Logger
import com.team4099.robot2021.config.Constants
import com.team4099.robot2021.subsystems.LED
import edu.wpi.first.wpilibj2.command.CommandBase

class LEDCommand(var LEDstate: Constants.LED.Status) : CommandBase() {
init {
addRequirements(LED)
}

override fun initialize() {
LED.statusState = LEDstate
Logger.addEvent("LED", "LED State: $LEDstate")
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.team4099.robot2021.commands.shooter

import com.team4099.lib.logging.Logger
import com.team4099.robot2021.commands.led.LEDCommand
import com.team4099.robot2021.config.Constants
import com.team4099.robot2021.subsystems.Shooter
import com.team4099.robot2021.subsystems.Vision
Expand All @@ -19,6 +20,7 @@ class SpinUpCommand(
Logger.addEvent("SpinUpCommand", "Started shooter spin-up command")
}
override fun execute() {
LEDCommand(Constants.LED.Status.SHOOTER_SPEED)
if (withVision) {
Shooter.targetVelocity =
when (Vision.currentDistance) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.team4099.lib.units.base.meters
import com.team4099.lib.units.derived.degrees
import com.team4099.lib.units.derived.inDegrees
import com.team4099.lib.units.perSecond
import com.team4099.robot2021.commands.led.LEDCommand
import com.team4099.robot2021.config.Constants
import com.team4099.robot2021.subsystems.Drivetrain
import com.team4099.robot2021.subsystems.Vision
Expand Down Expand Up @@ -68,6 +69,7 @@ class VisionCommand : CommandBase() {
}

override fun end(interrupted: Boolean) {
LEDCommand(Constants.LED.Status.VISION_LOCK)
Drivetrain.setOpenLoop(0.degrees.perSecond, Pair(0.0.meters.perSecond, 0.0.meters.perSecond))
}
}
Loading