From 052dd5cf0834549cc186fc71ff1bb89e390f122e Mon Sep 17 00:00:00 2001 From: Max <68516760+TTVMixmix00@users.noreply.github.com> Date: Wed, 13 Dec 2023 20:43:21 -0800 Subject: [PATCH] comments --- src/main/java/com/team766/robot/OI.java | 11 ++++++----- .../java/com/team766/robot/mechanisms/Shooter.java | 4 ++-- .../java/com/team766/robot/procedures/ShootPower.java | 3 +++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/team766/robot/OI.java b/src/main/java/com/team766/robot/OI.java index e274e452..be47d880 100644 --- a/src/main/java/com/team766/robot/OI.java +++ b/src/main/java/com/team766/robot/OI.java @@ -114,7 +114,7 @@ public void run(final Context context) { isCross = !isCross; } - + // Test shooting using if(joystick2.getButton(1)){ //Robot.shooter.shoot(1, 1); try { @@ -127,6 +127,7 @@ public void run(final Context context) { //Robot.shooter.shoot(0,0); } + //Button to press if you want to start a calibration session (so like a new distance) if(joystick2.getButtonPressed(2)){ try { Robot.shooter.startNewCalibrationDistanceSession(context); @@ -135,7 +136,7 @@ public void run(final Context context) { e.printStackTrace(); } } - + // Button to press if the ball went long if(joystick2.getButtonPressed(3)){ try { Robot.shooter.inputDataFromShot(false, true, context); @@ -144,7 +145,7 @@ public void run(final Context context) { e.printStackTrace(); } } - + // Button to press if the ball went short if(joystick2.getButtonPressed(4)){ try { Robot.shooter.inputDataFromShot(false, false, context); @@ -153,7 +154,7 @@ public void run(final Context context) { e.printStackTrace(); } } - + // Button to press if the ball went in if(joystick2.getButtonPressed(5)){ try { Robot.shooter.inputDataFromShot(true, false, context); @@ -162,7 +163,7 @@ public void run(final Context context) { e.printStackTrace(); } } - + //Send data to file if(joystick2.getButtonPressed(6)){ Robot.shooter.resetCalibrationAndStoreDataInFine(); } diff --git a/src/main/java/com/team766/robot/mechanisms/Shooter.java b/src/main/java/com/team766/robot/mechanisms/Shooter.java index 5a16daf1..5cfb284c 100644 --- a/src/main/java/com/team766/robot/mechanisms/Shooter.java +++ b/src/main/java/com/team766/robot/mechanisms/Shooter.java @@ -18,8 +18,8 @@ public class Shooter extends Mechanism { - - static AutomaticShooterPowerCalibration calibration; + // create calibration object, this is static so it can be used all over? I dont know why I put it this but it gets really unhappy when I make it unstatic so imma just leave it. + static AutomaticShooterPowerCalibration calibration; private double lastSpeed = 0; public Shooter(){ diff --git a/src/main/java/com/team766/robot/procedures/ShootPower.java b/src/main/java/com/team766/robot/procedures/ShootPower.java index 1bf8c7c0..f85397be 100644 --- a/src/main/java/com/team766/robot/procedures/ShootPower.java +++ b/src/main/java/com/team766/robot/procedures/ShootPower.java @@ -5,9 +5,12 @@ import com.team766.robot.Robot; public class ShootPower extends Procedure { + // private variable power to store amount of power that should be shot. This is set in the constructor. private double power; public ShootPower(double power){ this.power = power; + this.power = Math.min(this.power, 1); + this.power = Math.max(this.power, -1); } public void run(Context context){ context.takeOwnership(Robot.shooter);