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

Auton comp changes #39

Merged
merged 7 commits into from
Mar 26, 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
2 changes: 1 addition & 1 deletion src/main/deploy/pathplanner/autos/4-Center-Stays.auto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 1.0,
"startingPose": {
"position": {
"x": 1.3470318873095533,
"x": 1.4,
"y": 5.5216374597852385
},
"rotation": 0
Expand Down
4 changes: 2 additions & 2 deletions src/main/deploy/pathplanner/paths/CenterNote-Center.path
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"waypoints": [
{
"anchor": {
"x": 1.3470318873095533,
"x": 1.4,
"y": 5.5216374597852385
},
"prevControl": null,
"nextControl": {
"x": 2.3470318873095533,
"x": 2.4,
"y": 5.5216374597852385
},
"isLocked": false,
Expand Down
6 changes: 3 additions & 3 deletions src/main/deploy/pathplanner/paths/Middle5thNote-Right.path
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
{
"anchor": {
"x": 8.05,
"y": 0.7104198823782273
"y": 0.6
},
"prevControl": {
"x": 7.050000000000001,
"y": 0.7104198823782273
"y": 0.6
},
"nextControl": {
"x": 9.049999999999988,
"y": 0.7104198823782273
"y": 0.6
},
"isLocked": false,
"linkedName": null
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import edu.wpi.first.math.MathUtil;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj.XboxController.Button;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
Expand Down Expand Up @@ -65,8 +64,8 @@ public class RobotContainer {
public RobotContainer() {
NamedCommands.registerCommand("Shoot",
new SequentialCommandGroup(
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, ShooterConstants.kShooterOnTime),
new ParallelDeadlineGroup(new WaitCommand(0.25), new NoteOuttakeCommand(m_intakeSubsystem)),
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, 1.5),
new ParallelDeadlineGroup(new WaitCommand(0.50), new NoteOuttakeCommand(m_intakeSubsystem)),
new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime)));

NamedCommands.registerCommand("Intake",
Expand Down Expand Up @@ -217,6 +216,11 @@ private void configureBindings() {
}).onTrue(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Shooting, ShooterConstants.kShooterOnTime))
.onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, ShooterConstants.kShooterOffTime));

new Trigger(() -> {
return m_operatorController.getXButtonPressed() == true;
}).onTrue(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Amp, 0.1))
.onFalse(new ShooterSetSpeedCommand(m_shooterSubsystem, ShootSpeed.Off, 0.02));

// Climber Up, Operator Controller Right Bumper + A Button
new Trigger(() -> {
return m_operatorController.getAButton() && m_operatorController.getRightBumper();
Expand Down
1 change: 0 additions & 1 deletion src/main/java/frc/robot/commands/NoteOuttakeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package frc.robot.commands;

import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.subsystems.IntakeSubsystem;

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/subsystems/ShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public void setShootingSpeed(ShootSpeed speed) {
m_topSpeed = ShooterConstants.kShooterSpeedTop;
m_bottomSpeed = ShooterConstants.kShooterSpeedBottom;
break;
case Amp:
m_topSpeed = 0.2;
m_bottomSpeed = 0.3;
case Prep:
m_topSpeed = ShooterConstants.kPrepShooterSpeed;
m_bottomSpeed = ShooterConstants.kPrepShooterSpeed;
Expand Down Expand Up @@ -70,6 +73,7 @@ public void periodic() {
public static enum ShootSpeed {
Shooting,
Prep,
Amp,
Off
}
}
Loading