Skip to content

Commit

Permalink
Added the 3rd Feeder constant
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMagicalMa committed Feb 1, 2024
1 parent 967b5ff commit 30eda8c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/kotlin/frc/team449/robot2024/Robot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import frc.team449.RobotBase
import frc.team449.control.holonomic.SwerveDrive
import frc.team449.control.holonomic.SwerveOrthogonalCommand
import frc.team449.robot2024.constants.RobotConstants
import frc.team449.robot2024.subsystems.Feeder.Companion.createFeeder
import frc.team449.robot2024.subsystems.Undertaker.Companion.createProtoUndertaker
import frc.team449.robot2024.subsystems.pivot.Pivot
import frc.team449.robot2024.subsystems.shooter.Shooter.Companion.createShooter
import frc.team449.robot2024.subsystems.pivot.Pivot.Companion.createShooter
import frc.team449.robot2024.subsystems.shooter.Shooter
import frc.team449.system.AHRS
import frc.team449.system.light.Light
import monologue.Annotations.Log
Expand Down Expand Up @@ -38,6 +43,9 @@ class Robot : RobotBase(), Logged {
val light = Light.createLight()

val undertaker = createProtoUndertaker()
val feeder = createFeeder()
val shooter = Shooter.createShooter(this)
val pivot = Pivot.createShooter(this);
//
// val infrared = DigitalInput(RobotConstants.IR_CHANNEL)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,46 @@ class ControllerBindings(
) {

private fun robotBindings() {
//Press right bumper to suck up, and feed.
JoystickButton(driveController, XboxController.Button.kRightBumper.value).onTrue(
robot.undertaker.intake()
).onFalse(
robot.undertaker.stop()
)

JoystickButton(driveController, XboxController.Button.kRightBumper.value).onTrue(
robot.feeder.intake()
).onFalse(
robot.feeder.stop()
)
JoystickButton(driveController, XboxController.Button.kRightBumper.value).onTrue(
robot.shooter.duringIntake()
).onFalse(
robot.shooter.stopIntake()
)
//Press left bumper to let out, and un-feed.
JoystickButton(driveController, XboxController.Button.kLeftBumper.value).onTrue(
robot.undertaker.outtake()
).onFalse(
robot.undertaker.stop()
)
JoystickButton(driveController, XboxController.Button.kLeftBumper.value).onTrue(
robot.feeder.outtake()
).onFalse(
robot.feeder.stop()
)

JoystickButton(driveController, XboxController.Button.kB.value).onTrue(
robot.shooter.shootSubwoofer()
)
JoystickButton(driveController, XboxController.Button.kA.value).onTrue(
robot.shooter.scoreAmp()
)
JoystickButton(driveController, XboxController.Button.kX.value).onTrue(
robot.shooter.shootAnywhere()
)
JoystickButton(driveController, XboxController.Button.kY.value).onTrue(
robot.pivot.hold()
)
}

private fun evergreenBindings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ open class Shooter(
}
}

fun stopIntake(): Command {
return this.runOnce {
rightMotor.stopMotor()
leftMotor.stopMotor()
}
}

private fun shootPiece(rightSpeed: Double, leftSpeed: Double) {
if (DriverStation.isDisabled()) {
rightLoop.correct(VecBuilder.fill(rightVelocity.get()))
Expand Down

0 comments on commit 30eda8c

Please sign in to comment.