Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maxspier committed Dec 14, 2023
1 parent 7ffa69e commit 052dd5c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/main/java/com/team766/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -162,7 +163,7 @@ public void run(final Context context) {
e.printStackTrace();
}
}

//Send data to file
if(joystick2.getButtonPressed(6)){
Robot.shooter.resetCalibrationAndStoreDataInFine();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/team766/robot/mechanisms/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/team766/robot/procedures/ShootPower.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 052dd5c

Please sign in to comment.