|
4 | 4 |
|
5 | 5 | package frc.robot; |
6 | 6 |
|
| 7 | +import java.io.File; |
| 8 | + |
| 9 | +import edu.wpi.first.math.geometry.Translation3d; |
| 10 | +import edu.wpi.first.math.util.Units; |
| 11 | +import edu.wpi.first.wpilibj.Filesystem; |
| 12 | +import swervelib.math.Matter; |
| 13 | + |
7 | 14 | /** |
8 | 15 | * The Constants class provides a convenient place for teams to hold robot-wide numerical or boolean |
9 | 16 | * constants. This class should not be used for any other purpose. All constants should be declared |
|
13 | 20 | * constants are needed, to reduce verbosity. |
14 | 21 | */ |
15 | 22 | public final class Constants { |
16 | | - public static class OperatorConstants { |
| 23 | + public static final double ROBOT_MASS = (148 - 20.3) * 0.453592; // 32lbs * kg per pound |
| 24 | + public static final Matter CHASSIS = new Matter(new Translation3d(0, 0, Units.inchesToMeters(8)), ROBOT_MASS); |
| 25 | + public static final double LOOP_TIME = 0.13; //s, 20ms + 110ms sprk max velocity lag |
| 26 | + public static final double MAX_SPEED = Units.feetToMeters(14.5); |
| 27 | + |
| 28 | + public static final class DrivebaseConstants |
| 29 | + { |
| 30 | + |
| 31 | + // Hold time on motor brakes when disabled |
| 32 | + public static final double WHEEL_LOCK_TIME = 10; // seconds |
| 33 | + } |
| 34 | + |
| 35 | + |
| 36 | + public static class SwerveConstants { |
| 37 | + public static final double kMaximumSpeed = Units.feetToMeters(4.5); |
| 38 | + public static final File kSwerveJsonDirectory = new File(Filesystem.getDeployDirectory(),"swerve"); |
| 39 | + } |
| 40 | + |
| 41 | + public static class OperatorConstants |
| 42 | + { |
17 | 43 | public static final int kDriverControllerPort = 0; |
| 44 | + |
| 45 | + // Joystick Deadband |
| 46 | + public static final double DEADBAND = 0.1; |
| 47 | + public static final double LEFT_Y_DEADBAND = 0.1; |
| 48 | + public static final double RIGHT_X_DEADBAND = 0.1; |
| 49 | + public static final double TURN_CONSTANT = 6; |
18 | 50 | } |
19 | 51 | } |
0 commit comments