]> git.taranathan.com Git - FRC2026.git/commitdiff
Clean up unit test (no print statements / add comments).
authorGLRoylance <GLRoylance@gmail.com>
Sat, 14 Feb 2026 23:01:14 +0000 (15:01 -0800)
committerGLRoylance <GLRoylance@gmail.com>
Sat, 14 Feb 2026 23:01:14 +0000 (15:01 -0800)
src/test/java/frc/robot/subsystems/Intake/IntakeTest.java

index af5e271e003b5b29b9aec6886e18feaf5c0e6c11..fe406cf70775d7f4ff29aa536184cbd96c38352f 100644 (file)
@@ -13,16 +13,22 @@ public class IntakeTest {
         intake.close();
     }
 
+    /** 
+     * Test the rotations to inches and inches to rotations conversion functions.
+     * Assumes a gear ratio of 36:12 (= 3).
+     * Assumes a 10DP rack and a 10-tooth rack pinion.
+     */
     @Test
     public void conversionTest() {
-        System.out.println("rotations to inches: "  + intake.rotationsToInches(3.0));
+        // 3 motor rotations will turn the rack pinion once.
+        // That will advance the rack 10 teeth.
+        // linear distance will be pi * 10 / 10 = pi.
         assertEquals(Math.PI, intake.rotationsToInches(3.0), 0.0001);
 
-        System.out.println("2: inches to rotations: "  + intake.inchesToRotations(Math.PI));
-        
+        // traveling pi inches should take 3 motor turns
         assertEquals(3.0, intake.inchesToRotations(3.14159), 0.0001);
 
+        // the methods should be inverses of each other
         assertEquals(15.0, intake.rotationsToInches(intake.inchesToRotations(15.0)), 0.0001);
     }
-    
 }