Skip to content

Commit

Permalink
Initialise input variables
Browse files Browse the repository at this point in the history
  • Loading branch information
viggy96 committed Nov 14, 2023
1 parent b1be0f8 commit f6ea258
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/lasarobotics/hardware/Analog.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ID(String name, int port) {

@AutoLog
public static class AnalogInputs {
public double voltage;
public double voltage = 0.0;
}

private AnalogInput m_analogInput;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/lasarobotics/hardware/LimitSwitch.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public enum SwitchPolarity {

@AutoLog
public static class LimitSwitchInputs {
public boolean value;
public boolean value = false;
}

private DigitalInput m_limitSwitch;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/lasarobotics/utils/GlobalConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package org.lasarobotics.utils;

import edu.wpi.first.math.geometry.Rotation2d;

public class GlobalConstants {
public static final int ROBOT_LOOP_HZ = 50;
public static final double ROBOT_LOOP_PERIOD = 1.0 / ROBOT_LOOP_HZ;
Expand All @@ -14,4 +16,6 @@ public class GlobalConstants {
public static final int REV_ENCODER_TICKS_PER_ROTATION = 8192;

public static final String REPLAY_ENVIRONMENT_VAR = "ROBOT_REPLAY";

public static final Rotation2d ROTATION_PI = Rotation2d.fromRadians(Math.PI);
}

0 comments on commit f6ea258

Please sign in to comment.