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

Setup novice mode #63

Merged
merged 1 commit into from
Feb 3, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import competition.subsystems.collector.commands.EjectCollectorCommand;
import competition.subsystems.collector.commands.IntakeCollectorCommand;
import competition.subsystems.drive.DriveSubsystem;
import competition.subsystems.oracle.SwerveAccordingToOracleCommand;
import competition.subsystems.oracle.DynamicOracle;
import competition.subsystems.oracle.ManualRobotKnowledgeSubsystem;
Expand All @@ -16,6 +17,7 @@
import competition.subsystems.shooter.commands.WarmUpShooterCommand;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import xbot.common.controls.sensors.XXboxController.XboxButton;
import xbot.common.subsystems.drive.SwerveSimpleTrajectoryCommand;
import xbot.common.subsystems.pose.commands.SetRobotHeadingCommand;
Expand Down Expand Up @@ -65,7 +67,8 @@ public void setupMobilityComands(
OperatorInterface operatorInterface,
Provider<SwerveSimpleTrajectoryCommand> swerveCommandProvider,
SetRobotHeadingCommand resetHeading,
DynamicOracle oracle
DynamicOracle oracle,
DriveSubsystem drive
)
{
double typicalVelocity = 2.5;
Expand All @@ -76,6 +79,12 @@ public void setupMobilityComands(
operatorInterface.driverGamepad.getXboxButton(XboxButton.A).onTrue(resetHeading);
LowResField fieldWithObstacles = oracle.getFieldWithObstacles();

var noviceMode = new InstantCommand(() -> drive.setNoviceMode(true));
var expertMode = new InstantCommand(() -> drive.setNoviceMode(false));

operatorInterface.driverGamepad.getXboxButton(XboxButton.LeftStick).onTrue(noviceMode);
operatorInterface.driverGamepad.getXboxButton(XboxButton.RightStick).onTrue(expertMode);

// Where are some cool places we may want to go..
// 1) Where there are Notes!
var goToTopSpike = createAndConfigureTypicalSwerveCommand(
Expand Down
Loading