From 29ecd03d005c6f0247d90bfc7045a68fbb6d64ff Mon Sep 17 00:00:00 2001 From: Wu-Fan-529 <3681247216@qq.com> Date: Mon, 28 Oct 2024 00:26:48 +0800 Subject: [PATCH] rename motor --- src/main/java/frc/robot/RobotMap.java | 2 +- src/main/java/frc/robot/commands/PrepShooter.java | 4 ++-- src/main/java/frc/robot/subsystems/Shooter.java | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/RobotMap.java b/src/main/java/frc/robot/RobotMap.java index 68cea13..8241836 100644 --- a/src/main/java/frc/robot/RobotMap.java +++ b/src/main/java/frc/robot/RobotMap.java @@ -33,7 +33,7 @@ public static class mapIntake { public static class mapShooter { public static final int PROPEL_MOTOR_CAN = 10; - public static final int SHOOT_MOTOR_CAN = 11; + public static final int SPIRAL_MOTOR_CAN = 11; } public static class mapStager { diff --git a/src/main/java/frc/robot/commands/PrepShooter.java b/src/main/java/frc/robot/commands/PrepShooter.java index e4cdb13..304a871 100644 --- a/src/main/java/frc/robot/commands/PrepShooter.java +++ b/src/main/java/frc/robot/commands/PrepShooter.java @@ -20,7 +20,7 @@ public PrepShooter(Shooter passedShooter) { @Override public void initialize() { globalShooter.setPropelVelocity(0.6); - globalShooter.setShooterVelocity(0.8); + globalShooter.setSpiralMotorVelocity(0.8); } // Called every time the scheduler runs while the command is scheduled. @@ -32,7 +32,7 @@ public void execute() { @Override public void end(boolean interrupted) { globalShooter.setPropelVelocity(0); - globalShooter.setShooterVelocity(0); + globalShooter.setSpiralMotorVelocity(0); } // Returns true when the command should end. diff --git a/src/main/java/frc/robot/subsystems/Shooter.java b/src/main/java/frc/robot/subsystems/Shooter.java index cde88ff..730482b 100644 --- a/src/main/java/frc/robot/subsystems/Shooter.java +++ b/src/main/java/frc/robot/subsystems/Shooter.java @@ -12,19 +12,19 @@ public class Shooter extends SubsystemBase { /** Creates a new Shooter. */ TalonFX propelMotor; - TalonFX shootMotor; + TalonFX spiralMotor; public Shooter() { propelMotor = new TalonFX(RobotMap.mapShooter.PROPEL_MOTOR_CAN); - shootMotor = new TalonFX(RobotMap.mapShooter.SHOOT_MOTOR_CAN); + spiralMotor = new TalonFX(RobotMap.mapShooter.SPIRAL_MOTOR_CAN); } - public void setShooterVelocity(double velocity) { - shootMotor.set(velocity); + public void setSpiralMotorVelocity(double velocity) { + spiralMotor.set(velocity); } - public double getShooterVelocity() { - return shootMotor.get(); + public double getSpiralMotorVelocity() { + return spiralMotor.get(); } public void setPropelVelocity(double velocity) {