-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigs.java
More file actions
270 lines (199 loc) · 8.94 KB
/
Configs.java
File metadata and controls
270 lines (199 loc) · 8.94 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
package frc.robot;
import com.ctre.phoenix6.configs.CANcoderConfiguration;
import com.ctre.phoenix6.configs.TalonFXConfiguration;
import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.configs.ExternalFeedbackConfigs;
import com.ctre.phoenix6.configs.TalonFXConfiguration;
import com.ctre.phoenix6.signals.FeedbackSensorSourceValue;
import com.ctre.phoenix6.signals.NeutralModeValue;
public class Configs {
// Deployed by GradleRIO FileArtifact in build.gradle
public static final String DEPLOY_METADATA_PATH = "/home/lvuser/537metadata.txt";
// NetworkTables locations (Elastic can display String topics easily)
public static final String NT_TABLE = "Build537";
public static final String NT_RAW_KEY = "DeployMetadataRaw"; // full file contents
public static final String NT_STATUS_KEY = "DeployMetadataStatus"; // diag/status text
public static final String NT_PREFIX_PARSED = "DeployMetadata/"; // per-field entries
public static final TalonFXConfiguration TURRET_CONFIG = new TalonFXConfiguration();
public static final CANcoderConfiguration PITCH_CANCODER_CONFIG = new CANcoderConfiguration();
static {
TURRET_CONFIG
.Feedback.SensorToMechanismRatio = Constants.Turret.ENCODER_FACTOR;
TURRET_CONFIG
.CurrentLimits
.SupplyCurrentLimit = Constants.Turret.TURRET_MOTOR_CURRENT_LIMIT;
TURRET_CONFIG
.CurrentLimits
.SupplyCurrentLowerLimit = Constants.Turret.CURRENT_LOWER_LIMIT;
TURRET_CONFIG
.CurrentLimits
.SupplyCurrentLowerTime = Constants.Turret.CURRENT_LOWER_TIME;
TURRET_CONFIG
.MotorOutput.Inverted = Constants.Turret.MOTOR_INVERTED ? InvertedValue.Clockwise_Positive : InvertedValue.CounterClockwise_Positive;
TURRET_CONFIG
.Slot0
.kP = Constants.Turret.KP;
TURRET_CONFIG
.Slot0
.kI = Constants.Turret.KI;
TURRET_CONFIG
.Slot0
.kD = Constants.Turret.KD;
TURRET_CONFIG
.Slot0
.kS = Constants.Turret.KS;
TURRET_CONFIG
.Slot0
.kV = Constants.Turret.KV;
TURRET_CONFIG
.Slot0
.kA = Constants.Turret.KA;
TURRET_CONFIG
.MotorOutput
.NeutralMode = NeutralModeValue.Brake;
}
public static final class Shooter {
public static final TalonFXConfiguration SHOOTER_CONFIGURATION = new TalonFXConfiguration();
static {
SHOOTER_CONFIGURATION
.Feedback.SensorToMechanismRatio = Constants.Shooter.ENCODER_FACTOR;
SHOOTER_CONFIGURATION
.CurrentLimits
.SupplyCurrentLimit = Constants.Shooter.CURRENT_LIMIT;
SHOOTER_CONFIGURATION
.CurrentLimits
.SupplyCurrentLowerTime = Constants.Shooter.CURRENT_LOWER_TIME;
SHOOTER_CONFIGURATION
.CurrentLimits
.SupplyCurrentLowerLimit = Constants.Shooter.CURRENT_LOWER_LIMIT;
SHOOTER_CONFIGURATION
.Slot0
.kI = Constants.Shooter.KI;
SHOOTER_CONFIGURATION
.Slot0
.kP = Constants.Shooter.KP;
SHOOTER_CONFIGURATION
.Slot0
.kD = Constants.Shooter.KD;
SHOOTER_CONFIGURATION
.Slot0
.kS = Constants.Shooter.KS;
SHOOTER_CONFIGURATION
.Slot0
.kV = Constants.Shooter.KV;
SHOOTER_CONFIGURATION
.Slot0
.kA = Constants.Shooter.KA;
SHOOTER_CONFIGURATION
.MotorOutput
.Inverted = Constants.Shooter.MOTOR_INVERTED ? InvertedValue.Clockwise_Positive : InvertedValue.CounterClockwise_Positive;
SHOOTER_CONFIGURATION
.MotorOutput
.NeutralMode = NeutralModeValue.Coast;
}
}
public static final TalonFXConfiguration KICKER_CONFIG = new TalonFXConfiguration();
static {
KICKER_CONFIG
.CurrentLimits
.SupplyCurrentLimit = Constants.Transfer.CURRENT_LIMIT;
KICKER_CONFIG
.CurrentLimits
.SupplyCurrentLowerLimit = Constants.Transfer.CURRENT_LOWER_LIMIT;
KICKER_CONFIG
.CurrentLimits
.SupplyCurrentLowerTime = Constants.Transfer.CURRENT_LOWER_TIME;
KICKER_CONFIG
.MotorOutput
.Inverted = Constants.Transfer.KICKER_INVERTED ? InvertedValue.Clockwise_Positive : InvertedValue.CounterClockwise_Positive;
KICKER_CONFIG
.MotorOutput
.NeutralMode = NeutralModeValue.Brake;
}
public static final TalonFXConfiguration FEEDER_CONFIG = new TalonFXConfiguration();
static {
FEEDER_CONFIG
.CurrentLimits
.SupplyCurrentLimit = Constants.Transfer.CURRENT_LIMIT;
FEEDER_CONFIG
.CurrentLimits
.SupplyCurrentLowerLimit = Constants.Transfer.CURRENT_LOWER_LIMIT;
FEEDER_CONFIG
.CurrentLimits
.SupplyCurrentLowerTime = Constants.Transfer.CURRENT_LOWER_TIME;
FEEDER_CONFIG
.MotorOutput
.Inverted = Constants.Transfer.FEEDER_INVERTED ? InvertedValue.Clockwise_Positive : InvertedValue.CounterClockwise_Positive;
FEEDER_CONFIG
.MotorOutput
.NeutralMode = NeutralModeValue.Coast;
}
public static class Intake {
public static TalonFXConfiguration INTAKE_CONFIGURATION = new TalonFXConfiguration();
static {
INTAKE_CONFIGURATION
.Feedback.SensorToMechanismRatio = Constants.IntakeRoller.ENCODER_FACTOR;
INTAKE_CONFIGURATION
.CurrentLimits
.SupplyCurrentLimit = Constants.IntakeRoller.CURRENT_LIMIT;
INTAKE_CONFIGURATION
.CurrentLimits
.SupplyCurrentLowerLimit = Constants.IntakeRoller.CURRENT_LOWER_LIMIT;
INTAKE_CONFIGURATION
.CurrentLimits
.SupplyCurrentLowerTime = Constants.IntakeRoller.CURRENT_LOWER_TIME;
INTAKE_CONFIGURATION
.MotorOutput
.NeutralMode = NeutralModeValue.Coast;
INTAKE_CONFIGURATION
.MotorOutput
.Inverted = Constants.IntakeRoller.MOTOR_INVERTED;
}
}
public static class IntakePivot {
public static TalonFXConfiguration INTAKE_PIVOT_CONFIGURATION = new TalonFXConfiguration();
static {
INTAKE_PIVOT_CONFIGURATION
.Feedback.RotorToSensorRatio = Constants.IntakePivot.ROTOR_TO_SENSOR_RATIO;
INTAKE_PIVOT_CONFIGURATION
.Feedback.SensorToMechanismRatio = Constants.IntakePivot.SENSOR_TO_MECHANISM_RATIO;
INTAKE_PIVOT_CONFIGURATION
.Feedback.FeedbackRemoteSensorID = Constants.IntakePivot.CANCODER_ID;
INTAKE_PIVOT_CONFIGURATION
.Feedback.FeedbackSensorSource = FeedbackSensorSourceValue.RemoteCANcoder;
INTAKE_PIVOT_CONFIGURATION
.CurrentLimits
.SupplyCurrentLimit = Constants.IntakePivot.CURRENT_LIMIT;
INTAKE_PIVOT_CONFIGURATION
.CurrentLimits
.SupplyCurrentLowerLimit = Constants.IntakePivot.CURRENT_LOWER_LIMIT;
INTAKE_PIVOT_CONFIGURATION
.CurrentLimits
.SupplyCurrentLowerTime = Constants.IntakePivot.CURRENT_LOWER_TIME;
INTAKE_PIVOT_CONFIGURATION
.Slot0
.kP = Constants.IntakePivot.KP;
INTAKE_PIVOT_CONFIGURATION
.Slot0
.kI = Constants.IntakePivot.KI;
INTAKE_PIVOT_CONFIGURATION
.Slot0
.kD = Constants.IntakePivot.KD;
INTAKE_PIVOT_CONFIGURATION
.Slot0
.kS = Constants.IntakePivot.KS;
INTAKE_PIVOT_CONFIGURATION
.Slot0
.kV = Constants.IntakePivot.KV;
INTAKE_PIVOT_CONFIGURATION
.Slot0
.kA = Constants.IntakePivot.KA;
INTAKE_PIVOT_CONFIGURATION
.MotorOutput
.NeutralMode = NeutralModeValue.Brake;
INTAKE_PIVOT_CONFIGURATION
.MotorOutput
.Inverted = Constants.IntakePivot.MOTOR_INVERTED;
}
}
}