-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConstants.java
More file actions
148 lines (118 loc) · 4.79 KB
/
Constants.java
File metadata and controls
148 lines (118 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// Copyright 2021-2025 FRC 6328
// http://github.com/Mechanical-Advantage
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 3 as published by the Free Software Foundation or
// available in the root directory of this project.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
package frc.robot;
import static edu.wpi.first.units.Units.*;
import com.ctre.phoenix6.CANBus;
import edu.wpi.first.units.measure.AngularVelocity;
import edu.wpi.first.wpilibj.RobotBase;
/**
* This class defines the runtime mode used by AdvantageKit. The mode is always "real" when running
* on a roboRIO. Change the value of "simMode" to switch between "sim" (physics sim) and "replay"
* (log replay from a file).
*/
public final class Constants {
public static final Mode simMode = Mode.SIM;
public static final Mode currentMode = RobotBase.isReal() ? Mode.REAL : simMode;
public static enum Mode {
/** Running on a real robot. */
REAL,
/** Running a physics simulator. */
SIM,
/** Replaying from a log file. */
REPLAY
}
public static final class FeatureFlags {
/** Enable to print loop timing when total exceeds 20ms. */
public static final boolean PROFILING_ENABLED = false;
/** Set to false to disable the hopper subsystem entirely. */
public static final boolean kHopperEnabled = false;
}
public final class RobotConstants {
public static final double kNominalVoltage = 12.0;
}
public static final class MotorConstants {
public static final class NEOConstants {
public static final AngularVelocity kFreeSpeed = RPM.of(5676);
public static final int kDefaultSupplyCurrentLimit = 60;
public static final int kDefaultStatorCurrentLimit = 100;
}
public static final class NEO550Constants {
public static final AngularVelocity kFreeSpeed = RPM.of(11000);
public static final int kDefaultSupplyCurrentLimit = 10;
}
public static final class NEOVortexConstants {
public static final AngularVelocity kFreeSpeed = RPM.of(6784);
public static final int kDefaultSupplyCurrentLimit = 60;
public static final int kDefaultStatorCurrentLimit = 100;
}
public static final class KrakenX60Constants {
public static final AngularVelocity kFreeSpeed = RPM.of(6000);
public static final int kDefaultSupplyCurrentLimit = 60;
public static final int kDefaultStatorCurrentLimit = 100;
}
}
public static final class DIOPorts {
// max length is 8
public static final int[] autonomousModeSelector = {0, 1, 2};
public static final int allianceColorSelector = 3;
public static final int turretAbsEncoder = 4;
}
public static final class OIPorts {
public static final int defaultDriver = 0;
public static final int defaultOperator = 1;
}
public static final class CANBusPorts {
public static final class CAN2 {
public static final CANBus bus = CANBus.roboRIO();
// Drivetrain
public static final int gyro = 0;
// Launcher
public static final int turret = 12;
public static final int hood = 13;
public static final int flywheelLeader = 14;
public static final int flywheelFollower = 15;
// Feeder
public static final int spindexer = 16;
public static final int kicker = 17;
// Intake
public static final int intakeRollerLower = 22;
public static final int intakeRollerUpper = 23;
}
public static final class CANHD {
// CAN bus that the devices are located on;
// All swerve devices must share the same CAN bus
public static final CANBus bus = new CANBus("canivore");
// Drivetrain
public static final int backLeftDrive = 10;
public static final int backRightDrive = 18;
public static final int frontRightDrive = 20;
public static final int frontLeftDrive = 28;
public static final int backLeftTurn = 11;
public static final int backRightTurn = 19;
public static final int frontRightTurn = 21;
public static final int frontLeftTurn = 29;
public static final int backRightTurnAbsEncoder = 31;
public static final int frontRightTurnAbsEncoder = 33;
public static final int frontLeftTurnAbsEncoder = 43;
public static final int backLeftTurnAbsEncoder = 45;
}
}
public static final class PneumaticChannels {
// hopper
public static final int hopperForward = 14;
public static final int hopperReverse = 15;
// intake arm
public static final int intakeArmForward = 0;
public static final int intakeArmReverse = 1;
}
}