2020import frc .robot .Constants .IntakeConstants ;
2121import frc .robot .commands .auto .AutoCommandInterface ;
2222import frc .robot .commands .auto .TestBalanceCommand ;
23+ import frc .robot .commands .drive .DriveAutonCommand ;
2324import frc .robot .commands .drive .DriveTeleopCommand ;
2425import frc .robot .commands .drive .InterruptDriveCommand ;
2526import frc .robot .commands .drive .LockZeroCommand ;
2627import frc .robot .commands .drive .ZeroGyroCommand ;
27- import frc .robot .commands .drive .xLockCommand ;
2828import frc .robot .commands .elbow .ElbowHoldPosCommand ;
2929import frc .robot .commands .elbow .JogElbowCommand ;
3030import frc .robot .commands .elevator .AdjustElevatorCommand ;
4242import frc .robot .commands .intake .IntakeExtendCommand ;
4343import frc .robot .commands .intake .IntakeOpenLoopCommand ;
4444import frc .robot .commands .robotState .AutoPlaceCommand ;
45- import frc .robot .commands .robotState .AutoPlaceCommandGroup ;
4645import frc .robot .commands .robotState .FloorPickupCommand ;
4746import frc .robot .commands .robotState .ManualScoreCommand ;
4847import frc .robot .commands .robotState .RecoverGamepieceCommand ;
@@ -104,10 +103,12 @@ public class RobotContainer {
104103 private SuppliedValueWidget <Boolean > allianceColor ;
105104 private Alliance alliance = Alliance .Invalid ;
106105 private SuppliedValueWidget <Boolean > currGamePiece ;
106+ private boolean isEvent = false ;
107107
108108 // Paths
109109 // private GrabCubeBalanceCommand testpath;
110110 private TestBalanceCommand balancepath ;
111+ private DriveAutonCommand fiveMeterTest ;
111112 // private CommunityToDockCommandGroup communityToDockCommandGroup;
112113 // private TwoPieceWithDockAutoCommandGroup twoPieceWithDockAutoCommandGroup;
113114 // private TwoPieceAutoPlacePathCommandGroup twoPieceAutoPlacePathCommandGroup;
@@ -120,6 +121,7 @@ public class RobotContainer {
120121 public RobotContainer () {
121122 DigitalInput eventFlag = new DigitalInput (10 );
122123 boolean isEvent = eventFlag .get ();
124+ this .isEvent = isEvent ;
123125 if (isEvent && Constants .isCompBot ) {
124126 // must be set before the first call to LoggerFactory.getLogger();
125127 System .setProperty (ContextInitializer .CONFIG_FILE_PROPERTY , "logback-event.xml" );
@@ -192,6 +194,12 @@ public void setVisionEnabled(boolean isEnabled) {
192194 driveSubsystem .visionUpdates = isEnabled ;
193195 }
194196
197+ public void autoStowTele () {
198+ if (elevatorSubsystem .hasZeroed () && isEvent ) {
199+ // robotStateSubsystem.toStow();
200+ }
201+ }
202+
195203 public void setDisabled (boolean isDisabled ) {
196204 robotStateSubsystem .setDisabled (isDisabled );
197205 }
@@ -250,6 +258,7 @@ private void configurePaths() {
250258 // elevatorSubsystem,
251259 // "TestAutoDrivePathOne",
252260 // "TestAutoDrivePathTwo");
261+ fiveMeterTest = new DriveAutonCommand (driveSubsystem , "straightPathX" , true , true );
253262 balancepath =
254263 new TestBalanceCommand (
255264 driveSubsystem ,
@@ -329,22 +338,28 @@ private void configureDriverButtonBindings() {
329338 false,
330339 robotStateSubsystem.getTargetCol(),
331340 true));*/
341+ // new JoystickButton(driveJoystick, Trim.RIGHT_X_POS.id) // 3578
342+ // .onTrue(
343+ // new AutoPlaceCommandGroup(
344+ // driveSubsystem, robotStateSubsystem, armSubsystem, handSubsystem));
332345 new JoystickButton (driveJoystick , Trim .RIGHT_X_POS .id ) // 3578
333346 .onTrue (
334- new AutoPlaceCommandGroup (
335- driveSubsystem , robotStateSubsystem , armSubsystem , handSubsystem ));
336- new JoystickButton (driveJoystick , Trim .RIGHT_X_POS .id ) // 3578
337- .onTrue (
338- new AutoPlaceCommand (driveSubsystem , robotStateSubsystem , armSubsystem , handSubsystem ))
347+ new AutoPlaceCommand (
348+ driveSubsystem , robotStateSubsystem , armSubsystem , handSubsystem , false , 0.0 ))
339349 .onFalse (new InterruptDriveCommand (driveSubsystem ));
340350 // TESTING AT
341351 // LAKEVIEW PRACTICE FIELD
342352
343353 // new JoystickButton(driveJoystick, InterlinkButton.X.id)
344354 // .onTrue(new ZeroElbowCommand(elbowSubsystem));
345355
346- new JoystickButton (driveJoystick , InterlinkButton .X .id )
347- .onTrue (new xLockCommand (driveSubsystem ));
356+ new JoystickButton (driveJoystick , InterlinkButton .X .id ).onTrue (fiveMeterTest );
357+
358+ // new JoystickButton(driveJoystick, InterlinkButton.X.id)
359+ // .onTrue(new xLockCommand(driveSubsystem));
360+
361+ // new JoystickButton(driveJoystick, InterlinkButton.X.id)
362+ // .onTrue(new AutonZeroElevatorCommand(elevatorSubsystem));
348363
349364 // Hand
350365 /*new JoystickButton(driveJoystick, Shoulder.LEFT_DOWN.id)
@@ -701,7 +716,7 @@ private void configurePitImportantDashboard() {
701716 ShuffleboardTab pitImportantTab = Shuffleboard .getTab ("PitImportant" );
702717 pitImportantTab
703718 .add (
704- "HealthCheck Drive " ,
719+ "HealthCheck" ,
705720 new ShuffleBoardHealthCheckCommandGroup (
706721 elbowSubsystem ,
707722 shoulderSubsystem ,
@@ -763,7 +778,7 @@ public void setAllianceColor(Alliance alliance) {
763778 Map .of (
764779 "colorWhenTrue" , alliance == Alliance .Red ? "red" : "blue" , "colorWhenFalse" , "black" ));
765780 robotStateSubsystem .setAllianceColor (alliance );
766- // testpath .generateTrajectory();
781+ fiveMeterTest .generateTrajectory ();
767782 balancepath .generateTrajectory ();
768783 // communityToDockCommandGroup.generateTrajectory();
769784 // twoPieceWithDockAutoCommandGroup.generateTrajectory();
0 commit comments