Skip to content

Commit ad2b555

Browse files
authored
Revert "Examples yay (#21)"
This reverts commit 47b4f19.
1 parent 47b4f19 commit ad2b555

File tree

16 files changed

+39
-475
lines changed

16 files changed

+39
-475
lines changed

src/main/java/frc/robot/BuildConstants.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ public final class BuildConstants {
66
public static final String MAVEN_NAME = "4829-BaseRobotCode";
77
public static final String VERSION = "unspecified";
88
public static final int GIT_REVISION = 15;
9-
public static final String GIT_SHA = "9b2d52efc94f51550c86781dc4d51112afc44b13";
10-
public static final String GIT_DATE = "2024-12-16 17:53:23 EST";
11-
public static final String GIT_BRANCH = "ExamplesYay";
12-
public static final String BUILD_DATE = "2024-12-18 17:41:48 EST";
13-
public static final long BUILD_UNIX_TIME = 1734561708416L;
9+
public static final String GIT_SHA = "f6cf5383d95d1116029cbb69e2db020295f5c2bf";
10+
public static final String GIT_DATE = "2024-11-09 19:29:39 EST";
11+
public static final String GIT_BRANCH = "actual-unit-tests";
12+
public static final String BUILD_DATE = "2024-11-09 19:50:39 EST";
13+
public static final long BUILD_UNIX_TIME = 1731199839115L;
1414
public static final int DIRTY = 1;
1515

1616
private BuildConstants() {}

src/main/java/frc/robot/commands/intake/Outtake.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/main/java/frc/robot/commands/intake/RegularIntake.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/main/java/frc/robot/extras/util/JoystickUtil.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ public static double modifyAxis(DoubleSupplier supplierValue, int exponent) {
4343
return value;
4444
}
4545

46+
public static double modifyAxisCubed(DoubleSupplier supplierValue) {
47+
double value = supplierValue.getAsDouble();
48+
49+
// Deadband
50+
value = JoystickUtil.deadband(value, JoystickConstants.DEADBAND_VALUE);
51+
52+
// Cube the axis
53+
value = Math.copySign(value * value * value, value);
54+
55+
return value;
56+
}
57+
4658
/**
4759
* Converts the two axis coordinates to polar to get both the angle and radius, so they can work
4860
* in a double[] list.
@@ -69,4 +81,22 @@ public static double[] modifyAxisPolar(
6981
Math.copySign(Math.pow(yInput, exponent), yInput)
7082
};
7183
}
84+
85+
public static double[] modifyAxisCubedPolar(DoubleSupplier xJoystick, DoubleSupplier yJoystick) {
86+
double xInput =
87+
JoystickUtil.deadband(xJoystick.getAsDouble(), JoystickConstants.DEADBAND_VALUE);
88+
double yInput = deadband(yJoystick.getAsDouble(), JoystickConstants.DEADBAND_VALUE);
89+
if (Math.abs(xInput) > 0 && Math.abs(yInput) > 0) {
90+
double theta = Math.atan(xInput / yInput);
91+
double hypotenuse = Math.sqrt(xInput * xInput + yInput * yInput);
92+
double cubedHypotenuse = Math.pow(hypotenuse, 3);
93+
xInput = Math.copySign(Math.sin(theta) * cubedHypotenuse, xInput);
94+
yInput = Math.copySign(Math.cos(theta) * cubedHypotenuse, yInput);
95+
return new double[] {xInput, yInput};
96+
}
97+
return new double[] {
98+
Math.copySign(xInput * xInput * xInput, xInput),
99+
Math.copySign(yInput * yInput * yInput, yInput)
100+
};
101+
}
72102
}

src/main/java/frc/robot/extras/util/MathUtil.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package frc.robot.extras.util;
22

33
import edu.wpi.first.math.geometry.Rotation3d;
4-
import frc.robot.BuildConstants;
54
import java.util.Random;
65

76
public class MathUtil {
87
/**
98
* random object that generates random variables the seed is the hash of GIT_SHA this way when you
109
* do log-replay even the generated random numbers are the same
1110
*/
12-
private static final Random random = new Random(BuildConstants.GIT_SHA.hashCode());
11+
private static final Random random = new Random((long) Math.random());
1312

1413
public static double linearInterpretationWithBounding(
1514
double x1, double y1, double x2, double y2, double x) {

src/main/java/frc/robot/subsystems/elevator/Elevator.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/elevator/ElevatorConstants.java

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/elevator/ElevatorInterface.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/elevator/PhysicalElevator.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/main/java/frc/robot/subsystems/elevator/SimulatedElevator.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)