Skip to content

Commit

Permalink
moar lint fun
Browse files Browse the repository at this point in the history
  • Loading branch information
dejabot committed Nov 23, 2023
1 parent 16c8d55 commit 667deb6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/team766/robot/mechanisms/EncoderUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ public static double wristRotationsToDegrees(double rotations) {
*/
public static double elevatorHeightToRotations(double height) {
// height * net gear ratio * (rotations / height)
return height * (36./12.) * (1./(1.641 * Math.PI));
return height * (36./12.) * (1. / (1.641 * Math.PI));
}

/**
* Converts the elevator motor's rotations to a height (in inches).
*/
public static double elevatorRotationsToHeight(double rotations) {
// rotations * net gear ratio * (height / rotations)
return rotations * (12./36.) * ((1.641 * Math.PI)/1.);
return rotations * (12./36.) * ((1.641 * Math.PI) / 1.);
}

/**
* Converts a target rotation (in degrees) to encoder units for the shoulder motor.
*/
public static double shoulderDegreesToRotations(double angle) {
// angle * net gear ratio * (rotations / degrees)
return angle * (4./1.) * (3. / 1.) * (1. / 360.);
return angle * (4. / 1.) * (3. / 1.) * (1. / 360.);
}

/**
Expand All @@ -68,7 +68,7 @@ public static double shoulderRotationsToDegrees(double rotations) {
* @return
*/
public static double lawOfCosines(double side1, double side2, double angle) {
double side3Squared = (Math.pow(side1,2.0)+Math.pow(side2,2.0)-2*side1*side2*Math.cos(Math.toRadians(angle)));
double side3Squared = (Math.pow(side1, 2.0) + Math.pow(side2, 2.0) - 2*side1*side2*Math.cos(Math.toRadians(angle)));
return Math.sqrt(side3Squared);
}

Expand Down

0 comments on commit 667deb6

Please sign in to comment.