File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
Robot2019/src/main/java/frc/robot Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -153,9 +153,10 @@ private static UsbCamera configureCamera(int port) {
153153 *
154154 * @param ec The error code to check
155155 */
156- private static void catchError (ErrorCode ec ) {
157- if (ec != ErrorCode .OK )
158- System .out
159- .println ("Error configuring in RobotMap.java at line: " + new Throwable ().getStackTrace ()[1 ].getLineNumber ());
156+ public static void catchError (ErrorCode ec ) {
157+ if (ec != ErrorCode .OK ) {
158+ System .out .println ("Error configuring in RobotMap.java at line: " + new Throwable ().getStackTrace ()[1 ].getLineNumber ());
159+ System .out .println (ec .toString ());
160+ }
160161 }
161162}
Original file line number Diff line number Diff line change 1919import edu .wpi .first .wpilibj .Encoder ;
2020import edu .wpi .first .wpilibj .command .Subsystem ;
2121import edu .wpi .first .wpilibj .smartdashboard .SmartDashboard ;
22+ import frc .robot .RobotMap ;
2223
2324public class Drivetrain extends Subsystem {
2425 public enum Side {
@@ -150,16 +151,10 @@ public double getMaxVoltage() {
150151
151152 public void setVoltageCompensation (double volts ) {
152153 ErrorCode ecVoltSat = leftMaster .configVoltageCompSaturation (volts , 10 );
153-
154- if (!ecVoltSat .equals (ErrorCode .OK )) {
155- throw new RuntimeException ("Voltage Saturation Configuration could not be set" );
156- }
154+ RobotMap .catchError (ecVoltSat );
157155
158156 ecVoltSat = rightMaster .configVoltageCompSaturation (volts , 10 );
159-
160- if (!ecVoltSat .equals (ErrorCode .OK )) {
161- throw new RuntimeException ("Voltage Saturation Configuration could not be set" );
162- }
157+ RobotMap .catchError (ecVoltSat );
163158
164159 leftMaster .enableVoltageCompensation (true );
165160 rightMaster .enableVoltageCompensation (true );
You can’t perform that action at this time.
0 commit comments