Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 3 additions & 47 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

package frc.robot;

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

/**
* The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean
* constants. This class should not be used for any other purpose. All constants should be declared
Expand All @@ -15,53 +12,12 @@
* <p>It is advised to statically import this class (or one of its inner classes) wherever the
* constants are needed, to reduce verbosity.
*/
public final class Constants {

public enum Mode {
/**
* Running on a real robot.
*/
REAL,
/**
* Running a physics simulator.
*/
SIM,
/**
* Replaying from a log file.
*/
REPLAY
}

// Mode
public static final Mode simMode = Mode.SIM;
// public static final Mode simMode = Mode.REPLAY;

public static final Mode currentMode = RobotBase.isReal() ? Mode.REAL : simMode;

public static final int NEO_CURRENT_LIMIT = 20;

// Logging
public static final long MAX_LOG_TIME_WAIT = 10;
public static final boolean ENABLE_LOGGING = true;

public static final boolean DEBUG = true;
public final class Constants extends GameConstants{

public static final int ROLLER_MOTOR_ID = 1;
public static final int TILT_MOTOR_ID = 2;
public static final int INTAKE_MOTOR_ID = 3;

public static final double ROLLER_SPEED = 0.25;
public static final double TILT_SPEED = -0.5; // Arm motor is inverted - use negative speed
public static final double INTAKE_SPEED = -0.5;
public static final double SPIN_TIMEOUT = 5;
public static final double TILT_TIMEOUT = 5;
public static final double TILT_LENGTH = 0.2;
public static final Rotation2d TILT_MIN_ANGLE = Rotation2d.fromDegrees(45);
public static final Rotation2d TILT_MAX_ANGLE = Rotation2d.fromDegrees(90);
public static final double TILT_INERTIA = 0.5;
public static final double TILT_GEARING = 45.0;
public static final boolean TILT_SIMULATE_GRAVITY = false;

public static final boolean ARM_DEBUG = true;

public static final double DRIVE_BASE_WIDTH = 0.635;
public static final double DRIVE_BASE_LENGTH = 0.635;
public static final double INITIAL_ROBOT_HEIGHT = 0;
Expand Down
55 changes: 55 additions & 0 deletions src/main/java/frc/robot/GameConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package frc.robot;

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

public class GameConstants {

public enum Mode {
/**
* Running on a real robot.
*/
REAL,
/**
* Running a physics simulator.
*/
SIM,
/**
* Replaying from a log file.
*/
REPLAY
}

// Mode
public static final Mode simMode = Mode.SIM;
// public static final Mode simMode = Mode.REPLAY;
public static final Mode currentMode = RobotBase.isReal() ? Mode.REAL : simMode;

// Logging
public static final long MAX_LOG_TIME_WAIT = 10;
public static final boolean ENABLE_LOGGING = true;

//Debugs
public static final boolean DEBUG = true;
public static final boolean ARM_DEBUG = true;

//Speeds
public static final double ROLLER_SPEED = 0.25;
public static final double TILT_SPEED = -0.5; // Arm motor is inverted - use negative speed
public static final double INTAKE_SPEED = -0.5;

//Timeouts
public static final double SPIN_TIMEOUT = 5;
public static final double TILT_TIMEOUT = 5;

//Angles
public static final Rotation2d TILT_MIN_ANGLE = Rotation2d.fromDegrees(45);
public static final Rotation2d TILT_MAX_ANGLE = Rotation2d.fromDegrees(90);

public static final double TILT_LENGTH = 0.2;
public static final double TILT_INERTIA = 0.5;
public static final double TILT_GEARING = 45.0;
public static final boolean TILT_SIMULATE_GRAVITY = false;
public static final int NEO_CURRENT_LIMIT = 20;

}