Skip to content

Commit 33d2388

Browse files
committed
Slight Refactoring
1 parent 1a92784 commit 33d2388

File tree

2 files changed

+7
-100
lines changed

2 files changed

+7
-100
lines changed

src/main/java/frc/robot/Constants.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,8 @@ public static final class WristConstants{
394394

395395
public static double zeroOffset = 1.0 - ((5.05128918995 - (Math.PI / 2.0)) / (2.0 * Math.PI));
396396

397-
public static double freeHangAngle = 90;
398-
399397
public static enum WristAngleRad {
400-
FREEHANG(Units.degreesToRadians(freeHangAngle)),
398+
FREEHANG(Units.degreesToRadians(90)),
401399
FUNNEL_ANGLE(Units.degreesToRadians(66)),
402400
L1(Units.degreesToRadians(252)), // Needs to be changed
403401
L2L3(Units.degreesToRadians(252)),

src/main/java/frc/robot/RobotContainer.java

Lines changed: 6 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ public RobotContainer() {
106106

107107

108108
// Should get called right after subsystems are instantiated
109-
addAllProfiledSubsystemsToArray();
110109

111110

112111
constructorThings();
@@ -248,28 +247,17 @@ private void registerNamedCommands(){
248247

249248
private Command robotGoToHeightCommandCreator(ElevatorHeight height){
250249

251-
Command command;
252-
253-
boolean elevatorIsAlreadyAtTheBottomAndWeAreTryingToMoveThere = false;
254-
// height == ElevatorHeight.HOME &&
255-
// elevator.getCurrentGoal() == ElevatorHeight.HOME;
256250

251+
Command command;
257252

258-
if(elevatorIsAlreadyAtTheBottomAndWeAreTryingToMoveThere){
259-
// Should end immediately
260-
command = Commands.sequence(
261-
new ElevatorGoToPositionPositionCommand(elevator, height),
262-
new WristGoToPositionCommand(wrist, getEndWristAngleForGivenElevatorHeight(height))
263-
).withInterruptBehavior(InterruptionBehavior.kCancelSelf);
264-
}else{
253+
//INEFFICIENT FOR GETTING FROM CORAL STATION
265254
command = Commands.sequence(
266255
new WristGoToPositionCommand(wrist, WristAngleRad.L2L3),
267256
new ElevatorGoToPositionPositionCommand(elevator, height),
268257
new WristGoToPositionCommand(wrist, getEndWristAngleForGivenElevatorHeight(height))
269258
).withInterruptBehavior(InterruptionBehavior.kCancelSelf);
270-
}
271-
272259

260+
273261
return command;
274262

275263
}
@@ -295,49 +283,6 @@ private WristAngleRad getEndWristAngleForGivenElevatorHeight(ElevatorHeight heig
295283
}
296284

297285

298-
299-
300-
301-
302-
303-
304-
305-
306-
307-
308-
309-
310-
311-
312-
313-
314-
315-
316-
317-
318-
319-
320-
321-
322-
323-
324-
325-
326-
327-
328-
329-
330-
331-
332-
333-
334-
335-
336-
337-
338-
339-
340-
341286
// private void testingButtonBindings() {
342287

343288
// configureDriveBindings();
@@ -383,47 +328,11 @@ public Command getAutonomousCommand() {
383328
}
384329

385330

386-
387-
388-
389-
390-
391-
392-
393-
394-
395-
396-
397-
398-
399-
400-
401-
402-
403-
404-
405-
406-
407-
408-
409-
410-
411-
412-
413-
414-
private void addAllProfiledSubsystemsToArray(){
415-
subsystems = new IProfiledReset[]{
416-
wrist,
417-
manipulator,
418-
elevator
419-
};
420-
}
421-
422331
// Should get called in teleopInit, and maybe autonomousInit
423332
public void ResetProfiledSubsystemsOnEnable(){
424-
for (IProfiledReset sub : subsystems) {
425-
sub.ProfileReset();
426-
}
333+
wrist.ProfileReset();
334+
elevator.ProfileReset();
335+
manipulator.ProfileReset();
427336
}
428337

429338

0 commit comments

Comments
 (0)