Skip to content

Commit

Permalink
edited shooter flywheel ready command
Browse files Browse the repository at this point in the history
  • Loading branch information
siyoyoCode committed Feb 4, 2024
1 parent dd0994d commit 578be9d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@ public void initialize() {
shooterSubsystem.setShooterMotorSpeed(shooterSubsystem.SHOOTER_MOTOR_SPEED);
}

//pivot: vertical, auto-aim
//feed: load, shoot
//shooter: stop, ready shooters

//load note
//shoot
//ready shooter
//vertical
//auto-angle
@Override
public boolean isFinished(){
return (Math.abs(shooterSubsystem.getFlywheelSpeed() - shooterSubsystem.SHOOTER_MOTOR_SPEED) < shooterSubsystem.SPEED_TOLERANCE);
}

@Override
public void end(boolean interrupted) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ public ShooterFeederSubsystem(){
public void setFeederMotorSpeed(double speed){
feederMotor.set(TalonSRXControlMode.PercentOutput, speed);
System.out.println("feeding motor speed is: " + feederMotor.getMotorOutputPercent());

}



public int getProximity(){
System.out.println("proximity: " + shooterSensor.getProximity());
return shooterSensor.getProximity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public class ShooterFlywheelSubsystem extends SubsystemBase {

//change later (ALL OF THEM ARE PLACEHOLDERS)
int IDNUMBER = 10; //so I remember to change them later
// public static final int SHOOTER_MOTOR_ONE_ID = 13;
// public static final int SHOOTER_MOTOR_TWO_ID = 14;
public final double SHOOTER_MOTOR_SPEED = 1;
public final double SPEED_TOLERANCE = 0.7;

//motors
private final CANSparkMax shooterMotor;
private final CANSparkMax shooterMotorTwo;
private double currentSpeed;

//devices
private ShooterState currentState; //an enum state thing
Expand Down Expand Up @@ -54,7 +54,12 @@ public void setShooterState(ShooterState newState){

public void setShooterMotorSpeed(double speed){
shooterMotor.setVoltage(-speed * 12);
currentSpeed = speed;
System.out.println("shooter motor speed is: " + shooterMotor.get());
}

public double getFlywheelSpeed(){
return currentSpeed;
}

}

0 comments on commit 578be9d

Please sign in to comment.