Skip to content

Commit

Permalink
custom auto added to selection
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaCentaureye committed Jan 7, 2024
1 parent b473f2c commit 5f6b555
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@

import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.button.Trigger;
import frc.robot.Constants.OperatorConstants;
import frc.robot.commands.CircleAutoCmd;
import frc.robot.commands.CommandFactory;
import frc.robot.commands.CustomTestCmd;
import frc.robot.commands.StraightAutoCmd;
import frc.robot.commands.SwerveJoystickCmd;
import frc.robot.subsystems.SwerveSubsystem;
Expand All @@ -31,7 +33,9 @@ public class RobotContainer {

private final Command m_circleAuto = new CircleAutoCmd(m_swerveSubsystem);

SendableChooser<Command> m_chooser = new SendableChooser<>();
private final Command m_customAuto = new CustomTestCmd(m_swerveSubsystem);

public SendableChooser<Command> m_chooser = new SendableChooser<>();

public RobotContainer() {
commandFactory = new CommandFactory(m_swerveSubsystem);
Expand All @@ -58,8 +62,10 @@ public RobotContainer() {

m_chooser.addOption("Circle Auto", m_circleAuto);

m_chooser.addOption("Custom Auto", m_customAuto);

// Put the chooser on the dashboard
Shuffleboard.getTab("Auto Options").add(m_chooser);
SmartDashboard.putData("Auto Options", m_chooser);
}

private void configureBindings() {
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/frc/robot/commands/CustomTestCmd.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package frc.robot.commands;

import frc.robot.commands.DriveStraightCmd;
import frc.robot.commands.RotateDegreesCmd;
import frc.robot.subsystems.SwerveSubsystem;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;

public class CustomTestCmd extends SequentialCommandGroup{

public CustomTestCmd(SwerveSubsystem swerveSubsystem) {
addCommands(
new DriveStraightCmd(0.0, 2.0, swerveSubsystem),
new RotateDegreesCmd(180.0, true, swerveSubsystem),
new DriveStraightCmd(0.0, 2.0, swerveSubsystem)
);
}



}

0 comments on commit 5f6b555

Please sign in to comment.