Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates for ARL #23

Open
wants to merge 2 commits into
base: Dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2023",
"teamNumber": 6413
"teamNumber": 9986
}
14 changes: 10 additions & 4 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import frc.robot.commands.QuickAuto;
import frc.robot.commands.Autos.BalanceAuto;
import frc.robot.commands.Autos.DriveAndBalance;
import frc.robot.commands.Autos.ScoreDriveCommunityBalance;
import frc.robot.subsystems.drive.Drive;
import frc.robot.subsystems.drive.ModuleIOSim;
import frc.robot.subsystems.drive.ModuleIOSparkMax;
Expand Down Expand Up @@ -107,17 +108,19 @@ public RobotContainer() {

}

m_Chooser.addOption("FullAuto", new AutoDriver(drive, gyro, pose, Trajectories.test, true));
// m_Chooser.addOption("FullAuto", new AutoDriver(drive, gyro, pose, Trajectories.test, true));
m_Chooser.addOption("Score Drive out of Community then Balance", new ScoreDriveCommunityBalance(drive, gyro));
m_Chooser.addOption("Score and Balance", new DriveAndBalance(drive, gyro));
// Set up auto routines
autoChooser.addDefaultOption("Do Nothing", new InstantCommand());
// autoChooser.addDefaultOption("Do Nothing", new InstantCommand());
// autoChooser.addOption("FullAuto", new AutoDriver(drive, gyro, pose, Trajectories.test, true));
// SmartDashboard.putData(m_Chooser);
Shuffleboard.getTab("Auto").add(autoChooser.getSendableChooser());




SmartDashboard.putData("m_chooser", m_Chooser);
// Configure the button bindings
configureButtonBindings();
}
Expand Down Expand Up @@ -148,7 +151,10 @@ private void configureButtonBindings() {
public Command getAutonomousCommand() {
// return autoChooser.get();
// return new QuickAuto(drive, gyro, 4);
return new DriveAndBalance(drive, gyro);
// return new DriveAndBalance(drive, gyro);
// return new ScoreDriveCommunityBalance(drive, gyro);
return m_Chooser.getSelected();


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

package frc.robot.commands.Autos;

import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import frc.robot.commands.QuickAuto;
import frc.robot.subsystems.drive.Drive;
import frc.robot.subsystems.gyro.Gyro;

// NOTE: Consider using this command inline, rather than writing a subclass. For more
// information, see:
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
public class ScoreDriveCommunityBalance extends SequentialCommandGroup {
/** Creates a new ScoreDriveCommunityBalance. */
public final Drive driveTrainSubsystem;
public final Gyro gyroSubsystem;

public ScoreDriveCommunityBalance(Drive drive, Gyro gyro) {
driveTrainSubsystem = drive;
gyroSubsystem = gyro;
addRequirements(driveTrainSubsystem, gyroSubsystem);
// Add your commands in the addCommands() call, e.g.
// addCommands(new FooCommand(), new BarCommand());
addCommands(
new QuickAuto(drive, gyro, 0.5, 0.5),
new QuickAuto(drive, gyro, -0.5, 1),
new QuickAuto(drive, gyro, 0.5, 5),
new QuickAuto(drive, gyro, -0.5, 3),
new BalanceAuto(drive, gyro, 11)
);
}
}