From 7ea63eff501f393424c7ac75fb5273fd1ccd606e Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:25:10 -0700 Subject: [PATCH 01/15] Auton Ruiner Shoot --- .../org/carlmontrobotics/RobotContainer.java | 2 + .../commands/AutonRuinerShoot.java | 56 +++++++++++++++++++ .../subsystems/IntakeShooter.java | 4 +- 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java diff --git a/src/main/java/org/carlmontrobotics/RobotContainer.java b/src/main/java/org/carlmontrobotics/RobotContainer.java index aa4bbc5e..bc65bac4 100644 --- a/src/main/java/org/carlmontrobotics/RobotContainer.java +++ b/src/main/java/org/carlmontrobotics/RobotContainer.java @@ -348,6 +348,8 @@ private void registerAutoCommands(){ NamedCommands.registerCommand("SwitchRPMShoot", new SwitchRPMShootNEO(intakeShooter)); + NamedCommands.registerCommand("AutonRuinerShoot", new AutonRuinerShoot(intakeShooter)); + NamedCommands.registerCommand("PassToOuttake", new PassToOuttake(intakeShooter)); NamedCommands.registerCommand("StopIntake", new InstantCommand(intakeShooter::stopIntake)); diff --git a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java new file mode 100644 index 00000000..10c9cb25 --- /dev/null +++ b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java @@ -0,0 +1,56 @@ +package org.carlmontrobotics.commands; + +import static org.carlmontrobotics.Constants.Armc.SMART_CURRENT_LIMIT_TIMEOUT; +import static org.carlmontrobotics.Constants.Effectorc.*; +import org.carlmontrobotics.subsystems.Arm; +import org.carlmontrobotics.subsystems.IntakeShooter; + +import edu.wpi.first.wpilibj.Timer; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +import edu.wpi.first.wpilibj2.command.Command; + +public class AutonRuinerShoot extends Command { + private IntakeShooter intakeShooter; + private double rpmAmount; + private Timer timer = new Timer(); + private static Timer timer2 = new Timer(); + + public AutonRuinerShoot(IntakeShooter intakeShooter) { + this.intakeShooter = intakeShooter; + timer2.stop(); + timer2.reset(); + addRequirements(intakeShooter); + } + + @Override + public void initialize() { + intakeShooter.setMaxOuttake(0.5); + timer.reset(); + + } + + @Override + public void execute() { + rpmAmount = RPM_SELECTOR[Arm.getSelector()]; + if (intakeShooter.getOuttakeRPM() >= rpmAmount) { + intakeShooter.setMaxIntake(1); + timer.start(); + + } + } + + @Override + public void end(boolean interrupted) { + intakeShooter.stopIntake(); + intakeShooter.stopOuttake(); + intakeShooter.resetCurrentLimit(); + timer.stop(); + + } + + @Override + public boolean isFinished() { + return (!intakeShooter.intakeDetectsNote() && !intakeShooter.outtakeDetectsNote()) + || timer.get() > SMART_CURRENT_LIMIT_TIMEOUT; + } +} diff --git a/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java b/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java index 6bd70b3c..aefeb7ef 100644 --- a/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java +++ b/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java @@ -202,8 +202,8 @@ public void setMaxIntake(int direction) { } - public void setMaxOuttake(int direction) { - outtakeMotorVortex.set(1 * direction); + public void setMaxOuttake(double d) { + outtakeMotorVortex.set(1 * d); } public void setMaxOuttakeOverload(int direction) { From f27bee6ac9e4624ca4c722d9f005792d5edb1649 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:37:25 -0700 Subject: [PATCH 02/15] fixed the auto ruiner shoot --- .../commands/AutonRuinerShoot.java | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java index 10c9cb25..d79d78cb 100644 --- a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java +++ b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java @@ -11,46 +11,34 @@ public class AutonRuinerShoot extends Command { private IntakeShooter intakeShooter; - private double rpmAmount; private Timer timer = new Timer(); - private static Timer timer2 = new Timer(); public AutonRuinerShoot(IntakeShooter intakeShooter) { this.intakeShooter = intakeShooter; - timer2.stop(); - timer2.reset(); addRequirements(intakeShooter); + timer.stop(); + timer.reset(); } @Override public void initialize() { intakeShooter.setMaxOuttake(0.5); - timer.reset(); + timer.start(); } @Override public void execute() { - rpmAmount = RPM_SELECTOR[Arm.getSelector()]; - if (intakeShooter.getOuttakeRPM() >= rpmAmount) { - intakeShooter.setMaxIntake(1); - timer.start(); - - } } + @Override public void end(boolean interrupted) { - intakeShooter.stopIntake(); intakeShooter.stopOuttake(); - intakeShooter.resetCurrentLimit(); - timer.stop(); - } @Override public boolean isFinished() { - return (!intakeShooter.intakeDetectsNote() && !intakeShooter.outtakeDetectsNote()) - || timer.get() > SMART_CURRENT_LIMIT_TIMEOUT; + return timer.get() > 15; } } From 8445a1391f86e43b53614adf3d52c2fe7ca8f836 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:41:51 -0700 Subject: [PATCH 03/15] Placeholder commands for auto ruiners, once I am able to register new and improved commands on path planner --- .../pathplanner/autos/Center-Auto Ruiner.auto | 23 +++++++++++++++++-- .../pathplanner/autos/Left-Auto Ruiner.auto | 23 +++++++++++++++++-- .../pathplanner/autos/Right-Auto Ruiner.auto | 23 +++++++++++++++++-- 3 files changed, 63 insertions(+), 6 deletions(-) diff --git a/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto index 0e51d79b..feaf087e 100644 --- a/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto @@ -12,9 +12,28 @@ "data": { "commands": [ { - "type": "path", + "type": "parallel", "data": { - "pathName": "Center-Auto Ruiner" + "commands": [ + { + "type": "path", + "data": { + "pathName": "Center-Auto Ruiner" + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + } + ] } } ] diff --git a/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto index 2f23cea4..34dcbcfc 100644 --- a/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto @@ -12,9 +12,28 @@ "data": { "commands": [ { - "type": "path", + "type": "parallel", "data": { - "pathName": "Left-Auto Ruiner" + "commands": [ + { + "type": "path", + "data": { + "pathName": "Left-Auto Ruiner" + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + } + ] } } ] diff --git a/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto index cde771af..8a6899ee 100644 --- a/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto @@ -12,9 +12,28 @@ "data": { "commands": [ { - "type": "path", + "type": "parallel", "data": { - "pathName": "Right-Auto Ruiner" + "commands": [ + { + "type": "path", + "data": { + "pathName": "Right-Auto Ruiner" + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + } + ] } } ] From d46cabb623a8e731067e7b2021353afc06a1791f Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:47:01 -0700 Subject: [PATCH 04/15] Intake Auton Ruiner --- .../org/carlmontrobotics/RobotContainer.java | 1 + .../commands/IntakeAutonRuiner.java | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/main/java/org/carlmontrobotics/commands/IntakeAutonRuiner.java diff --git a/src/main/java/org/carlmontrobotics/RobotContainer.java b/src/main/java/org/carlmontrobotics/RobotContainer.java index bc65bac4..07c39ed9 100644 --- a/src/main/java/org/carlmontrobotics/RobotContainer.java +++ b/src/main/java/org/carlmontrobotics/RobotContainer.java @@ -349,6 +349,7 @@ private void registerAutoCommands(){ NamedCommands.registerCommand("SwitchRPMShoot", new SwitchRPMShootNEO(intakeShooter)); NamedCommands.registerCommand("AutonRuinerShoot", new AutonRuinerShoot(intakeShooter)); + NamedCommands.registerCommand("IntakeAutonRuiner", new IntakeAutonRuiner(intakeShooter)); NamedCommands.registerCommand("PassToOuttake", new PassToOuttake(intakeShooter)); diff --git a/src/main/java/org/carlmontrobotics/commands/IntakeAutonRuiner.java b/src/main/java/org/carlmontrobotics/commands/IntakeAutonRuiner.java new file mode 100644 index 00000000..b7d0f26d --- /dev/null +++ b/src/main/java/org/carlmontrobotics/commands/IntakeAutonRuiner.java @@ -0,0 +1,52 @@ +package org.carlmontrobotics.commands; + +import static org.carlmontrobotics.Constants.Effectorc.*; +import org.carlmontrobotics.subsystems.IntakeShooter; +import edu.wpi.first.wpilibj.Timer; +import edu.wpi.first.wpilibj2.command.Command; + +public class IntakeAutonRuiner extends Command { + // intake until sees game peice or 4sec has passed + private Timer timer = new Timer(); + private final IntakeShooter intake; + int index = 0; + + public IntakeAutonRuiner(IntakeShooter intake) { + addRequirements(this.intake = intake); + + } + + @Override + public void initialize() { + intake.setRPMIntake(INTAKE_RPM); + timer.reset(); + timer.start(); + intake.resetCurrentLimit(); + index = 0; + + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + // Intake Led + if (intake.intakeDetectsNote() && !intake.outtakeDetectsNote()) { + index++; + } + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) { + intake.stopIntake(); + timer.stop(); + index = 0; + } + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return timer.get() > 15; + + } +} From 977aa6b774cbc00ec2a340a5bc5eb88c42f47c61 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:20:20 -0700 Subject: [PATCH 05/15] Auton Ruiners complete --- src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto | 4 ++-- src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto | 4 ++-- src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto index feaf087e..19b15e9e 100644 --- a/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto @@ -24,13 +24,13 @@ { "type": "named", "data": { - "name": "Intake" + "name": "AutonRuinerShoot" } }, { "type": "named", "data": { - "name": "SwitchRPMShoot" + "name": "IntakeAutonRuiner" } } ] diff --git a/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto index 34dcbcfc..281380aa 100644 --- a/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto @@ -24,13 +24,13 @@ { "type": "named", "data": { - "name": "Intake" + "name": "AutonRuinerShoot" } }, { "type": "named", "data": { - "name": "SwitchRPMShoot" + "name": "IntakeAutonRuiner" } } ] diff --git a/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto index 8a6899ee..17954875 100644 --- a/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto @@ -2,8 +2,8 @@ "version": 1.0, "startingPose": { "position": { - "x": 0.5, - "y": 2.08 + "x": 0.8442899328546756, + "y": 2.7050989470935694 }, "rotation": 0 }, @@ -24,13 +24,13 @@ { "type": "named", "data": { - "name": "Intake" + "name": "AutonRuinerShoot" } }, { "type": "named", "data": { - "name": "SwitchRPMShoot" + "name": "IntakeAutonRuiner" } } ] From 99990fea736cce623c0217bc451e7e380e0d2729 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:45:54 -0700 Subject: [PATCH 06/15] Fixed Auto Ruiners by creating one commnad --- .../org/carlmontrobotics/RobotContainer.java | 1 + .../commands/AutonRuinerShootAndIntake.java | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java diff --git a/src/main/java/org/carlmontrobotics/RobotContainer.java b/src/main/java/org/carlmontrobotics/RobotContainer.java index 07c39ed9..3d898b0c 100644 --- a/src/main/java/org/carlmontrobotics/RobotContainer.java +++ b/src/main/java/org/carlmontrobotics/RobotContainer.java @@ -350,6 +350,7 @@ private void registerAutoCommands(){ NamedCommands.registerCommand("AutonRuinerShoot", new AutonRuinerShoot(intakeShooter)); NamedCommands.registerCommand("IntakeAutonRuiner", new IntakeAutonRuiner(intakeShooter)); + NamedCommands.registerCommand("AutonRuinerShootAndIntake", new IntakeAutonRuiner(intakeShooter)); NamedCommands.registerCommand("PassToOuttake", new PassToOuttake(intakeShooter)); diff --git a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java new file mode 100644 index 00000000..142f4d93 --- /dev/null +++ b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java @@ -0,0 +1,47 @@ +package org.carlmontrobotics.commands; + +import static org.carlmontrobotics.Constants.Armc.SMART_CURRENT_LIMIT_TIMEOUT; +import static org.carlmontrobotics.Constants.Effectorc.*; +import org.carlmontrobotics.subsystems.Arm; +import org.carlmontrobotics.subsystems.IntakeShooter; + +import edu.wpi.first.wpilibj.Timer; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; +import edu.wpi.first.wpilibj2.command.Command; + +public class AutonRuinerShootAndIntake extends Command { + private IntakeShooter intakeShooter; + private Timer timer = new Timer(); + + public AutonRuinerShootAndIntake(IntakeShooter intakeShooter) { + this.intakeShooter = intakeShooter; + addRequirements(intakeShooter); + timer.stop(); + timer.reset(); + } + + @Override + public void initialize() { + intakeShooter.setRPMIntake(INTAKE_RPM); + intakeShooter.setMaxOuttake(0.5); + timer.reset(); + timer.start(); + + } + + @Override + public void execute() { + } + + @Override + public void end(boolean interrupted) { + intakeShooter.stopOuttake(); + intakeShooter.stopIntake(); + + } + + @Override + public boolean isFinished() { + return timer.get() > 15; + } +} From 9da69ea2c36201327b8b582fae3d14801ae77bda Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:47:49 -0700 Subject: [PATCH 07/15] AutoPaths for Auto Ruiners --- src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto | 8 +------- src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto | 8 +------- src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto | 8 +------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto index 19b15e9e..98788499 100644 --- a/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Center-Auto Ruiner.auto @@ -24,13 +24,7 @@ { "type": "named", "data": { - "name": "AutonRuinerShoot" - } - }, - { - "type": "named", - "data": { - "name": "IntakeAutonRuiner" + "name": "AutonRuinerShootAndIntake" } } ] diff --git a/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto index 281380aa..bed0d378 100644 --- a/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Left-Auto Ruiner.auto @@ -24,13 +24,7 @@ { "type": "named", "data": { - "name": "AutonRuinerShoot" - } - }, - { - "type": "named", - "data": { - "name": "IntakeAutonRuiner" + "name": "AutonRuinerShootAndIntake" } } ] diff --git a/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto b/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto index 17954875..1db819a8 100644 --- a/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto +++ b/src/main/deploy/pathplanner/autos/Right-Auto Ruiner.auto @@ -24,13 +24,7 @@ { "type": "named", "data": { - "name": "AutonRuinerShoot" - } - }, - { - "type": "named", - "data": { - "name": "IntakeAutonRuiner" + "name": "AutonRuinerShootAndIntake" } } ] From e7fd6b59c14a2cd8b5eac7cfe19a57ed36596f88 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:28:13 -0700 Subject: [PATCH 08/15] Fixed some autopath --- .../deploy/pathplanner/autos/Left Shoot.auto | 6 +-- .../pathplanner/autos/New New Auto.auto | 18 --------- .../Preloaded Left-Pickup Subwoofer.auto | 4 +- .../pathplanner/autos/Shoot on Right.auto | 38 ------------------- .../paths/Left-Pickup For Left Subwoofer.path | 2 +- .../pathplanner/paths/Right-Pickup.path | 2 +- 6 files changed, 7 insertions(+), 63 deletions(-) delete mode 100644 src/main/deploy/pathplanner/autos/New New Auto.auto delete mode 100644 src/main/deploy/pathplanner/autos/Shoot on Right.auto diff --git a/src/main/deploy/pathplanner/autos/Left Shoot.auto b/src/main/deploy/pathplanner/autos/Left Shoot.auto index 46e672fe..4c5c106e 100644 --- a/src/main/deploy/pathplanner/autos/Left Shoot.auto +++ b/src/main/deploy/pathplanner/autos/Left Shoot.auto @@ -2,10 +2,10 @@ "version": 1.0, "startingPose": { "position": { - "x": 0.7023114046228096, - "y": 6.71281009228685 + "x": 1.2933990244570825, + "y": 7.102190285805508 }, - "rotation": 65.7722546820459 + "rotation": -1.9561248701734877 }, "command": { "type": "sequential", diff --git a/src/main/deploy/pathplanner/autos/New New Auto.auto b/src/main/deploy/pathplanner/autos/New New Auto.auto deleted file mode 100644 index d19fce7a..00000000 --- a/src/main/deploy/pathplanner/autos/New New Auto.auto +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 1.0, - "y": 6.86 - }, - "rotation": 0 - }, - "command": { - "type": "sequential", - "data": { - "commands": [] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Preloaded Left-Pickup Subwoofer.auto b/src/main/deploy/pathplanner/autos/Preloaded Left-Pickup Subwoofer.auto index c55e1a22..6e74b5bd 100644 --- a/src/main/deploy/pathplanner/autos/Preloaded Left-Pickup Subwoofer.auto +++ b/src/main/deploy/pathplanner/autos/Preloaded Left-Pickup Subwoofer.auto @@ -2,8 +2,8 @@ "version": 1.0, "startingPose": { "position": { - "x": 0.7308159060762569, - "y": 6.641548838653233 + "x": 2.0, + "y": 7.0 }, "rotation": 60.25511870305776 }, diff --git a/src/main/deploy/pathplanner/autos/Shoot on Right.auto b/src/main/deploy/pathplanner/autos/Shoot on Right.auto deleted file mode 100644 index 82273cb0..00000000 --- a/src/main/deploy/pathplanner/autos/Shoot on Right.auto +++ /dev/null @@ -1,38 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 0.7, - "y": 6.69 - }, - "rotation": 147.0 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "parallel", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, - { - "type": "named", - "data": { - "name": "SwitchRPMShoot" - } - } - ] - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Left-Pickup For Left Subwoofer.path b/src/main/deploy/pathplanner/paths/Left-Pickup For Left Subwoofer.path index 7de2e6ad..5e9eb01f 100644 --- a/src/main/deploy/pathplanner/paths/Left-Pickup For Left Subwoofer.path +++ b/src/main/deploy/pathplanner/paths/Left-Pickup For Left Subwoofer.path @@ -55,7 +55,7 @@ }, "goalEndState": { "velocity": 0.0, - "rotation": 151.3175833489299, + "rotation": 60.09226463401354, "rotateFast": false }, "reversed": false, diff --git a/src/main/deploy/pathplanner/paths/Right-Pickup.path b/src/main/deploy/pathplanner/paths/Right-Pickup.path index 2d4967ce..db0de53c 100644 --- a/src/main/deploy/pathplanner/paths/Right-Pickup.path +++ b/src/main/deploy/pathplanner/paths/Right-Pickup.path @@ -61,7 +61,7 @@ }, "goalEndState": { "velocity": 0.0, - "rotation": -66.12079139727523, + "rotation": -1.0230301886678064, "rotateFast": false }, "reversed": false, From 3992f82d6fa5608cf907b019b90be496553379e3 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Fri, 14 Jun 2024 10:39:24 -0700 Subject: [PATCH 09/15] 3 piece auton --- .../Preloaded Right Auton 2 piece total.auto | 106 ++++++++++++ .../Preloaded Right Auton 3 piece total.auto | 156 ++++++++++++++++++ .../paths/Preloaded Right-Pickup 2.path | 58 +++++++ .../paths/Preloaded Right-Pickup.path | 16 +- .../paths/Preloaded Right-Shoot 2.path | 58 +++++++ .../paths/Preloaded Right-Shoot.path | 6 +- .../org/carlmontrobotics/RobotContainer.java | 4 +- 7 files changed, 390 insertions(+), 14 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/Preloaded Right Auton 2 piece total.auto create mode 100644 src/main/deploy/pathplanner/autos/Preloaded Right Auton 3 piece total.auto create mode 100644 src/main/deploy/pathplanner/paths/Preloaded Right-Pickup 2.path create mode 100644 src/main/deploy/pathplanner/paths/Preloaded Right-Shoot 2.path diff --git a/src/main/deploy/pathplanner/autos/Preloaded Right Auton 2 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Right Auton 2 piece total.auto new file mode 100644 index 00000000..c2b95917 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Preloaded Right Auton 2 piece total.auto @@ -0,0 +1,106 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 0.7371441255109025, + "y": 4.39519602333928 + }, + "rotation": -57.09475707701205 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Preloaded Right-Pickup" + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "path", + "data": { + "pathName": "Preloaded Right-Shoot" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Preloaded Right Auton 3 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Right Auton 3 piece total.auto new file mode 100644 index 00000000..671acfc8 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Preloaded Right Auton 3 piece total.auto @@ -0,0 +1,156 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 0.7371441255109025, + "y": 4.39519602333928 + }, + "rotation": -57.09475707701205 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Preloaded Right-Pickup" + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "path", + "data": { + "pathName": "Preloaded Right-Shoot" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Preloaded Right-Pickup 2" + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "path", + "data": { + "pathName": "Preloaded Right-Shoot 2" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Preloaded Right-Pickup 2.path b/src/main/deploy/pathplanner/paths/Preloaded Right-Pickup 2.path new file mode 100644 index 00000000..34e5c96c --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Preloaded Right-Pickup 2.path @@ -0,0 +1,58 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 0.8108009573052709, + "y": 4.391924892990533 + }, + "prevControl": null, + "nextControl": { + "x": 0.9568738473158196, + "y": 3.52522574559461 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.8363450321182127, + "y": 5.394958737729634 + }, + "prevControl": { + "x": 2.8266068394483854, + "y": 5.404696930403704 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.5, + "rotationDegrees": 30.311213226407045, + "rotateFast": false + } + ], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 1.0, + "maxAcceleration": 1.0, + "maxAngularVelocity": 520.0, + "maxAngularAcceleration": 710.0 + }, + "goalEndState": { + "velocity": 0.0, + "rotation": 68.80594351845765, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": -62.703121008326576, + "velocity": 0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Preloaded Right-Pickup.path b/src/main/deploy/pathplanner/paths/Preloaded Right-Pickup.path index 1cb00e10..f932715f 100644 --- a/src/main/deploy/pathplanner/paths/Preloaded Right-Pickup.path +++ b/src/main/deploy/pathplanner/paths/Preloaded Right-Pickup.path @@ -3,13 +3,13 @@ "waypoints": [ { "anchor": { - "x": 0.9873564191572831, - "y": 4.589224734005024 + "x": 0.7371441255109025, + "y": 4.39519602333928 }, "prevControl": null, "nextControl": { - "x": 2.3902783513794343, - "y": 4.323327781515613 + "x": 2.140066057733054, + "y": 4.12929907084987 }, "isLocked": false, "linkedName": null @@ -20,8 +20,8 @@ "y": 4.062870619379916 }, "prevControl": { - "x": 1.8995004656675984, - "y": 4.061891457116247 + "x": 0.9484516266329833, + "y": 4.374065273227072 }, "nextControl": null, "isLocked": false, @@ -39,13 +39,13 @@ }, "goalEndState": { "velocity": 0.0, - "rotation": 180.0, + "rotation": -0.65601236607358, "rotateFast": false }, "reversed": false, "folder": null, "previewStartingState": { - "rotation": 119.16761337957783, + "rotation": -56.502642156984386, "velocity": 0 }, "useDefaultConstraints": false diff --git a/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot 2.path b/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot 2.path new file mode 100644 index 00000000..3a21a837 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot 2.path @@ -0,0 +1,58 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 2.8363450321182127, + "y": 5.394958737729634 + }, + "prevControl": null, + "nextControl": { + "x": 2.602628408103792, + "y": 3.8271097182763767 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.7815863793056181, + "y": 4.411401278318571 + }, + "prevControl": { + "x": 0.7718481866357909, + "y": 4.4211394709926415 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.4, + "rotationDegrees": -32.4123066186249, + "rotateFast": false + } + ], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 1.0, + "maxAcceleration": 1.0, + "maxAngularVelocity": 520.0, + "maxAngularAcceleration": 710.0 + }, + "goalEndState": { + "velocity": 0.0, + "rotation": -59.7435628364707, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 69.64677085151882, + "velocity": 0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot.path b/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot.path index 3f0b9006..5a3c7155 100644 --- a/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot.path +++ b/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot.path @@ -20,8 +20,8 @@ "y": 4.546467981824852 }, "prevControl": { - "x": 2.170293229475348, - "y": 4.0333869556628 + "x": 1.920466131794555, + "y": 4.215584647385511 }, "nextControl": null, "isLocked": false, @@ -51,7 +51,7 @@ "reversed": false, "folder": null, "previewStartingState": { - "rotation": 180.0, + "rotation": 1.38468903014112, "velocity": 0 }, "useDefaultConstraints": false diff --git a/src/main/java/org/carlmontrobotics/RobotContainer.java b/src/main/java/org/carlmontrobotics/RobotContainer.java index 3d898b0c..052b3abd 100644 --- a/src/main/java/org/carlmontrobotics/RobotContainer.java +++ b/src/main/java/org/carlmontrobotics/RobotContainer.java @@ -109,9 +109,7 @@ public class RobotContainer { // "Preloaded Left-Pickup Subwoofer", // "Preloaded Right-Pickup Subwoofer", - "Left-Amp", - "Shoot on Right", - "Shoot Center" + "Left-Amp", }; DigitalInput[] autoSelectors = new DigitalInput[Math.min(autoNames.length, 10)]; From 2bce99c6a35727e8cb53a3723a5f717661e8d181 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Fri, 14 Jun 2024 22:51:54 -0700 Subject: [PATCH 10/15] 3 piece auto added to auto selector --- src/main/java/org/carlmontrobotics/RobotContainer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/carlmontrobotics/RobotContainer.java b/src/main/java/org/carlmontrobotics/RobotContainer.java index 052b3abd..cd0cfc22 100644 --- a/src/main/java/org/carlmontrobotics/RobotContainer.java +++ b/src/main/java/org/carlmontrobotics/RobotContainer.java @@ -106,6 +106,7 @@ public class RobotContainer { "Left-Shoot For Left Subwoofer", "Right-Shoot For Right Subwoofer", + "Preloaded Right Auton 3 piece total", // "Preloaded Left-Pickup Subwoofer", // "Preloaded Right-Pickup Subwoofer", From 0b0c1337dd13177b526cf792ee9d2782a96844c4 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Wed, 19 Jun 2024 23:58:29 -0700 Subject: [PATCH 11/15] Working 4 piece auton(should work according to sim) --- .../autos/Left Auton 4 piece total.auto | 194 +++++++++++++++++ .../Preloaded Center Auton 3 piece total.auto | 150 +++++++++++++ .../Preloaded Center Auton 4 piece total.auto | 200 ++++++++++++++++++ .../Preloaded Left Auton 3 piece total.auto | 144 +++++++++++++ .../pathplanner/autos/Test 4 piece.auto | 37 ++++ .../pathplanner/paths/Center-Pickup 2.path | 74 +++++++ .../pathplanner/paths/Center-Pickup 3.path | 74 +++++++ .../pathplanner/paths/Center-Pickup.path | 10 +- .../Preloaded Left-Pickup Subwoofer 2.path | 89 ++++++++ .../Preloaded Left-Pickup Subwoofer 3.path | 79 +++++++ .../paths/Preloaded Right-Shoot.path | 8 +- .../org/carlmontrobotics/RobotContainer.java | 5 + 12 files changed, 1055 insertions(+), 9 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/Left Auton 4 piece total.auto create mode 100644 src/main/deploy/pathplanner/autos/Preloaded Center Auton 3 piece total.auto create mode 100644 src/main/deploy/pathplanner/autos/Preloaded Center Auton 4 piece total.auto create mode 100644 src/main/deploy/pathplanner/autos/Preloaded Left Auton 3 piece total.auto create mode 100644 src/main/deploy/pathplanner/autos/Test 4 piece.auto create mode 100644 src/main/deploy/pathplanner/paths/Center-Pickup 2.path create mode 100644 src/main/deploy/pathplanner/paths/Center-Pickup 3.path create mode 100644 src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 2.path create mode 100644 src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path diff --git a/src/main/deploy/pathplanner/autos/Left Auton 4 piece total.auto b/src/main/deploy/pathplanner/autos/Left Auton 4 piece total.auto new file mode 100644 index 00000000..48d4e0ac --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Left Auton 4 piece total.auto @@ -0,0 +1,194 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 0.7308159060762569, + "y": 6.641548838653233 + }, + "rotation": 64.817265461845 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Preloaded Left-Pickup Subwoofer" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Preloaded Left-Pickup Subwoofer 2" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Preloaded Left-Pickup Subwoofer 3" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Preloaded Center Auton 3 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Center Auton 3 piece total.auto new file mode 100644 index 00000000..367be975 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Preloaded Center Auton 3 piece total.auto @@ -0,0 +1,150 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 1.3756161320151827, + "y": 5.55076982040085 + }, + "rotation": 0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Pickup" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Pickup 2" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Preloaded Center Auton 4 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Center Auton 4 piece total.auto new file mode 100644 index 00000000..e1e0b353 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Preloaded Center Auton 4 piece total.auto @@ -0,0 +1,200 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 1.3756161320151827, + "y": 5.55076982040085 + }, + "rotation": 0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Pickup" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Pickup 2" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Pickup 3" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Preloaded Left Auton 3 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Left Auton 3 piece total.auto new file mode 100644 index 00000000..e7a1f48e --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Preloaded Left Auton 3 piece total.auto @@ -0,0 +1,144 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 0.7308159060762569, + "y": 6.641548838653233 + }, + "rotation": 64.817265461845 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Preloaded Left-Pickup Subwoofer" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "path", + "data": { + "pathName": "Preloaded Left-Pickup Subwoofer 2" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "SwitchRPMShoot" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + } + ] + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Test 4 piece.auto b/src/main/deploy/pathplanner/autos/Test 4 piece.auto new file mode 100644 index 00000000..a54cfcd2 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Test 4 piece.auto @@ -0,0 +1,37 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 1.3756161320151827, + "y": 5.55076982040085 + }, + "rotation": 0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Center-Pickup" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Pickup 2" + } + }, + { + "type": "path", + "data": { + "pathName": "Center-Pickup 3" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Center-Pickup 2.path b/src/main/deploy/pathplanner/paths/Center-Pickup 2.path new file mode 100644 index 00000000..8ac48a6c --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Center-Pickup 2.path @@ -0,0 +1,74 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 1.408287396727466, + "y": 5.525086266457521 + }, + "prevControl": null, + "nextControl": { + "x": 2.057289618731077, + "y": 6.174014151112526 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.8752978027901492, + "y": 7.0894042618452975 + }, + "prevControl": { + "x": 2.476031903427983, + "y": 6.709614747817872 + }, + "nextControl": { + "x": 3.066893432653555, + "y": 7.271653763422683 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.408287396727466, + "y": 5.525086266457521 + }, + "prevControl": { + "x": 1.784620224044719, + "y": 5.920821141760907 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.65, + "rotationDegrees": 45.189322306802794, + "rotateFast": false + } + ], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0.0, + "rotation": 0.0, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 0, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Center-Pickup 3.path b/src/main/deploy/pathplanner/paths/Center-Pickup 3.path new file mode 100644 index 00000000..d9d37ad5 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Center-Pickup 3.path @@ -0,0 +1,74 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 1.408287396727466, + "y": 5.525086266457521 + }, + "prevControl": null, + "nextControl": { + "x": 1.6093327560320605, + "y": 4.54773597566175 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.6318429861059016, + "y": 4.031611764291145 + }, + "prevControl": { + "x": 2.076766004065816, + "y": 4.304281158977501 + }, + "nextControl": { + "x": 2.869184195324344, + "y": 3.9150231001136646 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.408287396727466, + "y": 5.525086266457521 + }, + "prevControl": { + "x": 1.7359292607078698, + "y": 4.167946461634323 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.8, + "rotationDegrees": 1.2122818297624824, + "rotateFast": false + } + ], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0.0, + "rotation": 0.0, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 0, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Center-Pickup.path b/src/main/deploy/pathplanner/paths/Center-Pickup.path index dcf51460..f0909276 100644 --- a/src/main/deploy/pathplanner/paths/Center-Pickup.path +++ b/src/main/deploy/pathplanner/paths/Center-Pickup.path @@ -16,16 +16,16 @@ }, { "anchor": { - "x": 3.256945750532723, + "x": 3.0700616561375482, "y": 5.525086266457521 }, "prevControl": { - "x": 2.7918205615572567, - "y": 5.450666236221447 + "x": 2.5928902154412907, + "y": 5.541031627728612 }, "nextControl": { - "x": 3.5180556875108673, - "y": 5.566863856374024 + "x": 3.334345163811631, + "y": 5.516254857767795 }, "isLocked": false, "linkedName": null diff --git a/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 2.path b/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 2.path new file mode 100644 index 00000000..63173fd3 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 2.path @@ -0,0 +1,89 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 0.7308159060762569, + "y": 6.641548838653233 + }, + "prevControl": null, + "nextControl": { + "x": 2.912280633728115, + "y": 5.66086343368397 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.9018362362489887, + "y": 5.58775265133009 + }, + "prevControl": { + "x": 3.209354013768373, + "y": 5.401768845764475 + }, + "nextControl": { + "x": 1.1576218572349894, + "y": 6.64263679672179 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.7308159060762569, + "y": 6.641548838653233 + }, + "prevControl": { + "x": 0.7322289902512815, + "y": 6.641990267909317 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.05, + "rotationDegrees": 59.00363812391654, + "rotateFast": true + }, + { + "waypointRelativePos": 0.65, + "rotationDegrees": -36.35534131450031, + "rotateFast": false + }, + { + "waypointRelativePos": 0.3, + "rotationDegrees": -19.256228562276885, + "rotateFast": false + }, + { + "waypointRelativePos": 1.3, + "rotationDegrees": 66.39996651332388, + "rotateFast": false + } + ], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 2.0, + "maxAcceleration": 2.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0.0, + "rotation": 61.92751306414704, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 59.184294248270795, + "velocity": 0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path b/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path new file mode 100644 index 00000000..86ada0ba --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path @@ -0,0 +1,79 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 0.7308159060762569, + "y": 6.641548838653233 + }, + "prevControl": null, + "nextControl": { + "x": 2.427340940091133, + "y": 6.193490536447265 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.495508288762723, + "y": 4.060826342293255 + }, + "prevControl": { + "x": 2.5388393520297092, + "y": 3.6616553352276853 + }, + "nextControl": { + "x": 2.174147930739516, + "y": 7.021236913173708 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.7308159060762569, + "y": 6.641548838653233 + }, + "prevControl": { + "x": 0.7322289902512815, + "y": 6.641990267909317 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.15, + "rotationDegrees": 59.00363812391654, + "rotateFast": true + }, + { + "waypointRelativePos": 0.65, + "rotationDegrees": -36.35534131450031, + "rotateFast": false + } + ], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 2.0, + "maxAcceleration": 2.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0.0, + "rotation": 61.92751306414704, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 59.184294248270795, + "velocity": 0 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot.path b/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot.path index 5a3c7155..d655f89a 100644 --- a/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot.path +++ b/src/main/deploy/pathplanner/paths/Preloaded Right-Shoot.path @@ -16,12 +16,12 @@ }, { "anchor": { - "x": 1.030113171337454, - "y": 4.546467981824852 + "x": 0.7426336086361384, + "y": 4.421139470985942 }, "prevControl": { - "x": 1.920466131794555, - "y": 4.215584647385511 + "x": 1.6329865690932401, + "y": 4.090256136546601 }, "nextControl": null, "isLocked": false, diff --git a/src/main/java/org/carlmontrobotics/RobotContainer.java b/src/main/java/org/carlmontrobotics/RobotContainer.java index cd0cfc22..e39ceb94 100644 --- a/src/main/java/org/carlmontrobotics/RobotContainer.java +++ b/src/main/java/org/carlmontrobotics/RobotContainer.java @@ -106,6 +106,11 @@ public class RobotContainer { "Left-Shoot For Left Subwoofer", "Right-Shoot For Right Subwoofer", + "Test 4 piece", + "Left Auton 4 piece total", + "Preloaded Center Auton 4 piece total", + "Preloaded Left Auton 3 piece total", + "Preloaded Center Auton 3 piece total", "Preloaded Right Auton 3 piece total", // "Preloaded Left-Pickup Subwoofer", // "Preloaded Right-Pickup Subwoofer", From 68f72f80afd44f1b5c42183edea8dca6a77e9f42 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:06:37 -0700 Subject: [PATCH 12/15] Fixed PR comments --- .../autos/Left Auton 4 piece total.auto | 117 +++++++++--------- .../Preloaded Center Auton 3 piece total.auto | 20 +-- .../Preloaded Center Auton 4 piece total.auto | 111 ++++++++--------- .../Preloaded Left Auton 3 piece total.auto | 20 +-- .../Preloaded Right Auton 3 piece total.auto | 74 +++++------ .../pathplanner/paths/Center-Auto Ruiner.path | 48 ++++--- .../pathplanner/paths/Left-Auto Ruiner.path | 11 +- .../paths/Left-Pickup For Left Subwoofer.path | 20 +-- .../Preloaded Left-Pickup Subwoofer 2.path | 12 +- .../pathplanner/paths/Right-Auto Ruiner.path | 83 ++++++++----- .../org/carlmontrobotics/RobotContainer.java | 9 +- .../commands/AutonRuinerShoot.java | 44 ------- .../commands/AutonRuinerShootAndIntake.java | 10 +- .../commands/IntakeAutonRuiner.java | 52 -------- .../subsystems/IntakeShooter.java | 6 +- 15 files changed, 295 insertions(+), 342 deletions(-) delete mode 100644 src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java delete mode 100644 src/main/java/org/carlmontrobotics/commands/IntakeAutonRuiner.java diff --git a/src/main/deploy/pathplanner/autos/Left Auton 4 piece total.auto b/src/main/deploy/pathplanner/autos/Left Auton 4 piece total.auto index 48d4e0ac..249c6267 100644 --- a/src/main/deploy/pathplanner/autos/Left Auton 4 piece total.auto +++ b/src/main/deploy/pathplanner/autos/Left Auton 4 piece total.auto @@ -26,12 +26,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } @@ -43,30 +37,37 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Preloaded Left-Pickup Subwoofer" } }, { - "type": "path", + "type": "sequential", "data": { - "pathName": "Preloaded Left-Pickup Subwoofer" + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + } + ] } } ] } }, - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, { "type": "sequential", "data": { @@ -76,12 +77,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } @@ -93,30 +88,37 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Preloaded Left-Pickup Subwoofer 2" } }, { - "type": "path", + "type": "sequential", "data": { - "pathName": "Preloaded Left-Pickup Subwoofer 2" + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + } + ] } } ] } }, - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, { "type": "sequential", "data": { @@ -126,12 +128,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } @@ -143,30 +139,37 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Preloaded Left-Pickup Subwoofer 3" } }, { - "type": "path", + "type": "sequential", "data": { - "pathName": "Preloaded Left-Pickup Subwoofer 3" + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + } + ] } } ] } }, - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, { "type": "sequential", "data": { @@ -176,15 +179,15 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } } ] } diff --git a/src/main/deploy/pathplanner/autos/Preloaded Center Auton 3 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Center Auton 3 piece total.auto index 367be975..2d47d8d8 100644 --- a/src/main/deploy/pathplanner/autos/Preloaded Center Auton 3 piece total.auto +++ b/src/main/deploy/pathplanner/autos/Preloaded Center Auton 3 piece total.auto @@ -43,19 +43,19 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Center-Pickup" } }, { - "type": "path", + "type": "named", "data": { - "pathName": "Center-Pickup" + "name": "Intake" } } ] @@ -93,19 +93,19 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Center-Pickup 2" } }, { - "type": "path", + "type": "named", "data": { - "pathName": "Center-Pickup 2" + "name": "Intake" } } ] diff --git a/src/main/deploy/pathplanner/autos/Preloaded Center Auton 4 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Center Auton 4 piece total.auto index e1e0b353..f9b243e1 100644 --- a/src/main/deploy/pathplanner/autos/Preloaded Center Auton 4 piece total.auto +++ b/src/main/deploy/pathplanner/autos/Preloaded Center Auton 4 piece total.auto @@ -26,12 +26,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } @@ -43,30 +37,37 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Center-Pickup" } }, { - "type": "path", + "type": "sequential", "data": { - "pathName": "Center-Pickup" + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + } + ] } } ] } }, - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, { "type": "sequential", "data": { @@ -76,12 +77,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } @@ -93,30 +88,37 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Center-Pickup 2" } }, { - "type": "path", + "type": "sequential", "data": { - "pathName": "Center-Pickup 2" + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + } + ] } } ] } }, - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, { "type": "sequential", "data": { @@ -126,12 +128,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } @@ -143,30 +139,37 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Center-Pickup 3" } }, { - "type": "path", + "type": "sequential", "data": { - "pathName": "Center-Pickup 3" + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + } + ] } } ] } }, - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, { "type": "sequential", "data": { @@ -176,12 +179,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } diff --git a/src/main/deploy/pathplanner/autos/Preloaded Left Auton 3 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Left Auton 3 piece total.auto index e7a1f48e..a627e577 100644 --- a/src/main/deploy/pathplanner/autos/Preloaded Left Auton 3 piece total.auto +++ b/src/main/deploy/pathplanner/autos/Preloaded Left Auton 3 piece total.auto @@ -43,19 +43,19 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Preloaded Left-Pickup Subwoofer" } }, { - "type": "path", + "type": "named", "data": { - "pathName": "Preloaded Left-Pickup Subwoofer" + "name": "Intake" } } ] @@ -93,19 +93,19 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "Intake" + "pathName": "Preloaded Left-Pickup Subwoofer 2" } }, { - "type": "path", + "type": "named", "data": { - "pathName": "Preloaded Left-Pickup Subwoofer 2" + "name": "Intake" } } ] diff --git a/src/main/deploy/pathplanner/autos/Preloaded Right Auton 3 piece total.auto b/src/main/deploy/pathplanner/autos/Preloaded Right Auton 3 piece total.auto index 671acfc8..ba1c08f1 100644 --- a/src/main/deploy/pathplanner/autos/Preloaded Right Auton 3 piece total.auto +++ b/src/main/deploy/pathplanner/autos/Preloaded Right Auton 3 piece total.auto @@ -26,12 +26,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } @@ -43,7 +37,7 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { @@ -53,20 +47,27 @@ } }, { - "type": "named", + "type": "sequential", "data": { - "name": "Intake" + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + } + ] } } ] } }, - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, { "type": "path", "data": { @@ -82,12 +83,6 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } @@ -99,7 +94,7 @@ } }, { - "type": "parallel", + "type": "deadline", "data": { "commands": [ { @@ -109,20 +104,27 @@ } }, { - "type": "named", + "type": "sequential", "data": { - "name": "Intake" + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "ArmToSubwoofer" + } + } + ] } } ] } }, - { - "type": "named", - "data": { - "name": "ArmToSubwoofer" - } - }, { "type": "path", "data": { @@ -138,15 +140,15 @@ "data": { "name": "SwitchRPMShoot" } - }, - { - "type": "wait", - "data": { - "waitTime": 1.5 - } } ] } + }, + { + "type": "named", + "data": { + "name": "ArmToGround" + } } ] } diff --git a/src/main/deploy/pathplanner/paths/Center-Auto Ruiner.path b/src/main/deploy/pathplanner/paths/Center-Auto Ruiner.path index f5ce9e13..967c8a88 100644 --- a/src/main/deploy/pathplanner/paths/Center-Auto Ruiner.path +++ b/src/main/deploy/pathplanner/paths/Center-Auto Ruiner.path @@ -36,12 +36,12 @@ "y": 0.7869617776272596 }, "prevControl": { - "x": 4.462708374490823, - "y": 0.11639338093491075 + "x": 4.404829487934736, + "y": 1.101052954407271 }, "nextControl": { - "x": 9.291645553665193, - "y": 1.1945743121768773 + "x": 9.53622158727117, + "y": 0.574553367374826 }, "isLocked": false, "linkedName": null @@ -96,16 +96,16 @@ }, { "anchor": { - "x": 7.9882578085766855, - "y": 7.451136064309165 + "x": 7.614890544595903, + "y": 7.342597271192029 }, "prevControl": { - "x": 8.37057976486527, - "y": 7.041954048893445 + "x": 7.988089256952776, + "y": 7.353622739775686 }, "nextControl": { - "x": 7.585454318915502, - "y": 7.8822385448364445 + "x": 7.285264557419584, + "y": 7.332859078519773 }, "isLocked": false, "linkedName": null @@ -116,8 +116,8 @@ "y": 6.962884482874621 }, "prevControl": { - "x": 6.121410342440393, - "y": 6.997030500240731 + "x": 5.962304878346412, + "y": 6.8946404084978985 }, "nextControl": null, "isLocked": false, @@ -126,8 +126,28 @@ ], "rotationTargets": [ { - "waypointRelativePos": 5.6000000000000005, - "rotationDegrees": -7.0, + "waypointRelativePos": 5.7, + "rotationDegrees": 76.37253697709336, + "rotateFast": false + }, + { + "waypointRelativePos": 2.0500000000000003, + "rotationDegrees": 0, + "rotateFast": false + }, + { + "waypointRelativePos": 3.0, + "rotationDegrees": 13.8197149275521, + "rotateFast": false + }, + { + "waypointRelativePos": 4.050000000000001, + "rotationDegrees": 28.524517180426013, + "rotateFast": false + }, + { + "waypointRelativePos": 5.05, + "rotationDegrees": 31.334287515593456, "rotateFast": false } ], diff --git a/src/main/deploy/pathplanner/paths/Left-Auto Ruiner.path b/src/main/deploy/pathplanner/paths/Left-Auto Ruiner.path index 105e6e9c..15394ae1 100644 --- a/src/main/deploy/pathplanner/paths/Left-Auto Ruiner.path +++ b/src/main/deploy/pathplanner/paths/Left-Auto Ruiner.path @@ -8,8 +8,8 @@ }, "prevControl": null, "nextControl": { - "x": 1.8260632958924956, - "y": 5.211754342083749 + "x": 2.79739226145119, + "y": 7.060189683843188 }, "isLocked": false, "linkedName": null @@ -110,9 +110,14 @@ ], "rotationTargets": [ { - "waypointRelativePos": 0.5, + "waypointRelativePos": 0.85, "rotationDegrees": 22.20045635608777, "rotateFast": false + }, + { + "waypointRelativePos": 0.5, + "rotationDegrees": 0, + "rotateFast": false } ], "constraintZones": [], diff --git a/src/main/deploy/pathplanner/paths/Left-Pickup For Left Subwoofer.path b/src/main/deploy/pathplanner/paths/Left-Pickup For Left Subwoofer.path index 5e9eb01f..6881bbf4 100644 --- a/src/main/deploy/pathplanner/paths/Left-Pickup For Left Subwoofer.path +++ b/src/main/deploy/pathplanner/paths/Left-Pickup For Left Subwoofer.path @@ -16,16 +16,16 @@ }, { "anchor": { - "x": 3.579230015602889, - "y": 6.714031713777714 + "x": 2.9337269587943684, + "y": 6.982284142504229 }, "prevControl": { - "x": 3.466140107582353, - "y": 6.996756483829054 + "x": 2.6297483710657295, + "y": 7.000162651926998 }, "nextControl": { - "x": 3.725824594506333, - "y": 6.347545266519105 + "x": 3.17439943471651, + "y": 6.9681289838770155 }, "isLocked": false, "linkedName": null @@ -44,7 +44,13 @@ "linkedName": null } ], - "rotationTargets": [], + "rotationTargets": [ + { + "waypointRelativePos": 0.55, + "rotationDegrees": 0, + "rotateFast": false + } + ], "constraintZones": [], "eventMarkers": [], "globalConstraints": { diff --git a/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 2.path b/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 2.path index 63173fd3..83d484dc 100644 --- a/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 2.path +++ b/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 2.path @@ -16,16 +16,16 @@ }, { "anchor": { - "x": 2.9018362362489887, - "y": 5.58775265133009 + "x": 2.6513193714406413, + "y": 5.589722591070332 }, "prevControl": { - "x": 3.209354013768373, - "y": 5.401768845764475 + "x": 2.9588371489600256, + "y": 5.403738785504717 }, "nextControl": { - "x": 1.1576218572349894, - "y": 6.64263679672179 + "x": 0.9071049924266421, + "y": 6.644606736462032 }, "isLocked": false, "linkedName": null diff --git a/src/main/deploy/pathplanner/paths/Right-Auto Ruiner.path b/src/main/deploy/pathplanner/paths/Right-Auto Ruiner.path index 67633e72..3c66c3dd 100644 --- a/src/main/deploy/pathplanner/paths/Right-Auto Ruiner.path +++ b/src/main/deploy/pathplanner/paths/Right-Auto Ruiner.path @@ -16,16 +16,16 @@ }, { "anchor": { - "x": 7.873369436306303, - "y": 0.7395730439609034 + "x": 8.116213463908409, + "y": 0.886175532730662 }, "prevControl": { - "x": 7.4426164639366315, - "y": 0.5811355233821586 + "x": 7.685460491538737, + "y": 0.7277380121519171 }, "nextControl": { - "x": 9.151657743672557, - "y": 1.2097470021108647 + "x": 9.394501771274664, + "y": 1.3563494908806235 }, "isLocked": false, "linkedName": null @@ -33,15 +33,15 @@ { "anchor": { "x": 7.873369436306303, - "y": 2.4190820233492323 + "y": 2.3079516621666696 }, "prevControl": { - "x": 6.016585752351173, - "y": 1.6221288298304244 + "x": 6.12222005788186, + "y": 1.299856480100275 }, "nextControl": { - "x": 9.078181003584229, - "y": 2.93620118721719 + "x": 9.175908458578483, + "y": 3.057792497554153 }, "isLocked": false, "linkedName": null @@ -52,12 +52,12 @@ "y": 4.0803006143049325 }, "prevControl": { - "x": 6.001895718179572, - "y": 3.3611113758506925 + "x": 5.942839192834933, + "y": 3.539283038444537 }, "nextControl": { - "x": 9.079012384876622, - "y": 4.543617531679508 + "x": 9.020097375900564, + "y": 4.401663085651201 }, "isLocked": false, "linkedName": null @@ -65,15 +65,15 @@ { "anchor": { "x": 7.873369436306303, - "y": 5.806010639799057 + "y": 5.813701022419839 }, "prevControl": { - "x": 6.022251001672011, - "y": 5.1529714820360875 + "x": 5.911144933120088, + "y": 5.866375491665207 }, "nextControl": { - "x": 8.966182066623393, - "y": 6.191534021956934 + "x": 8.961668219896346, + "y": 5.7844864444177295 }, "isLocked": false, "linkedName": null @@ -81,27 +81,27 @@ { "anchor": { "x": 8.116213463908409, - "y": 7.419187268930094 + "y": 7.099142454512667 }, "prevControl": { - "x": 6.405248568351148, - "y": 7.386855034749728 + "x": 8.28973292584782, + "y": 6.806996674491571 }, "nextControl": { - "x": 8.61587362063613, - "y": 7.428629385036548 + "x": 7.861009083425049, + "y": 7.5288169242683685 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 5.144144112362299, - "y": 7.419187268930094 + "x": 4.1607392348829775, + "y": 6.953069564502119 }, "prevControl": { - "x": 7.549033269362834, - "y": 7.339255896104387 + "x": 6.614763787060195, + "y": 7.157571610516888 }, "nextControl": null, "isLocked": false, @@ -110,14 +110,29 @@ ], "rotationTargets": [ { - "waypointRelativePos": 0.2, - "rotationDegrees": -27.46845470186196, + "waypointRelativePos": 0.6000000000000001, + "rotationDegrees": -10.585482314336682, "rotateFast": false }, { - "waypointRelativePos": 4.6000000000000005, - "rotationDegrees": -24.269999999999982, + "waypointRelativePos": 5.0, + "rotationDegrees": 76.91013864205064, "rotateFast": true + }, + { + "waypointRelativePos": 1.9500000000000002, + "rotationDegrees": 25.178604751827088, + "rotateFast": false + }, + { + "waypointRelativePos": 2.9499999999999997, + "rotationDegrees": 7.466482317915436, + "rotateFast": false + }, + { + "waypointRelativePos": 4.050000000000001, + "rotationDegrees": 0, + "rotateFast": false } ], "constraintZones": [], @@ -130,7 +145,7 @@ }, "goalEndState": { "velocity": 1000.0, - "rotation": -163.22542599405483, + "rotation": -178.53119928561424, "rotateFast": false }, "reversed": false, diff --git a/src/main/java/org/carlmontrobotics/RobotContainer.java b/src/main/java/org/carlmontrobotics/RobotContainer.java index e39ceb94..df5aaef2 100644 --- a/src/main/java/org/carlmontrobotics/RobotContainer.java +++ b/src/main/java/org/carlmontrobotics/RobotContainer.java @@ -352,9 +352,12 @@ private void registerAutoCommands(){ NamedCommands.registerCommand("SwitchRPMShoot", new SwitchRPMShootNEO(intakeShooter)); - NamedCommands.registerCommand("AutonRuinerShoot", new AutonRuinerShoot(intakeShooter)); - NamedCommands.registerCommand("IntakeAutonRuiner", new IntakeAutonRuiner(intakeShooter)); - NamedCommands.registerCommand("AutonRuinerShootAndIntake", new IntakeAutonRuiner(intakeShooter)); + // NamedCommands.registerCommand("AutonRuinerShoot", new + // AutonRuinerShoot(intakeShooter)); + // NamedCommands.registerCommand("IntakeAutonRuiner", new + // IntakeAutonRuiner(intakeShooter)); + // NamedCommands.registerCommand("AutonRuinerShootAndIntake", new + // IntakeAutonRuiner(intakeShooter)); NamedCommands.registerCommand("PassToOuttake", new PassToOuttake(intakeShooter)); diff --git a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java deleted file mode 100644 index d79d78cb..00000000 --- a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShoot.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.carlmontrobotics.commands; - -import static org.carlmontrobotics.Constants.Armc.SMART_CURRENT_LIMIT_TIMEOUT; -import static org.carlmontrobotics.Constants.Effectorc.*; -import org.carlmontrobotics.subsystems.Arm; -import org.carlmontrobotics.subsystems.IntakeShooter; - -import edu.wpi.first.wpilibj.Timer; -import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; -import edu.wpi.first.wpilibj2.command.Command; - -public class AutonRuinerShoot extends Command { - private IntakeShooter intakeShooter; - private Timer timer = new Timer(); - - public AutonRuinerShoot(IntakeShooter intakeShooter) { - this.intakeShooter = intakeShooter; - addRequirements(intakeShooter); - timer.stop(); - timer.reset(); - } - - @Override - public void initialize() { - intakeShooter.setMaxOuttake(0.5); - timer.start(); - - } - - @Override - public void execute() { - } - - - @Override - public void end(boolean interrupted) { - intakeShooter.stopOuttake(); - } - - @Override - public boolean isFinished() { - return timer.get() > 15; - } -} diff --git a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java index 142f4d93..4790ca12 100644 --- a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java +++ b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java @@ -5,27 +5,21 @@ import org.carlmontrobotics.subsystems.Arm; import org.carlmontrobotics.subsystems.IntakeShooter; -import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; public class AutonRuinerShootAndIntake extends Command { private IntakeShooter intakeShooter; - private Timer timer = new Timer(); public AutonRuinerShootAndIntake(IntakeShooter intakeShooter) { this.intakeShooter = intakeShooter; addRequirements(intakeShooter); - timer.stop(); - timer.reset(); } @Override public void initialize() { intakeShooter.setRPMIntake(INTAKE_RPM); - intakeShooter.setMaxOuttake(0.5); - timer.reset(); - timer.start(); + intakeShooter.setAutoRuinerOuttake(0.3); } @@ -42,6 +36,6 @@ public void end(boolean interrupted) { @Override public boolean isFinished() { - return timer.get() > 15; + return false; } } diff --git a/src/main/java/org/carlmontrobotics/commands/IntakeAutonRuiner.java b/src/main/java/org/carlmontrobotics/commands/IntakeAutonRuiner.java deleted file mode 100644 index b7d0f26d..00000000 --- a/src/main/java/org/carlmontrobotics/commands/IntakeAutonRuiner.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.carlmontrobotics.commands; - -import static org.carlmontrobotics.Constants.Effectorc.*; -import org.carlmontrobotics.subsystems.IntakeShooter; -import edu.wpi.first.wpilibj.Timer; -import edu.wpi.first.wpilibj2.command.Command; - -public class IntakeAutonRuiner extends Command { - // intake until sees game peice or 4sec has passed - private Timer timer = new Timer(); - private final IntakeShooter intake; - int index = 0; - - public IntakeAutonRuiner(IntakeShooter intake) { - addRequirements(this.intake = intake); - - } - - @Override - public void initialize() { - intake.setRPMIntake(INTAKE_RPM); - timer.reset(); - timer.start(); - intake.resetCurrentLimit(); - index = 0; - - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - // Intake Led - if (intake.intakeDetectsNote() && !intake.outtakeDetectsNote()) { - index++; - } - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - intake.stopIntake(); - timer.stop(); - index = 0; - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return timer.get() > 15; - - } -} diff --git a/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java b/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java index aefeb7ef..986dd0d6 100644 --- a/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java +++ b/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java @@ -202,7 +202,11 @@ public void setMaxIntake(int direction) { } - public void setMaxOuttake(double d) { + public void setMaxOuttake(int d) { + outtakeMotorVortex.set(1 * d); + } + + public void setAutoRuinerOuttake(double d) { outtakeMotorVortex.set(1 * d); } From eb99ad6d5641476ec5134a2a5e560bf247b577bd Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 20 Jun 2024 15:15:20 -0700 Subject: [PATCH 13/15] fixed the 4 piece left --- .../pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path b/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path index 86ada0ba..1433b174 100644 --- a/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path +++ b/src/main/deploy/pathplanner/paths/Preloaded Left-Pickup Subwoofer 3.path @@ -54,6 +54,11 @@ "waypointRelativePos": 0.65, "rotationDegrees": -36.35534131450031, "rotateFast": false + }, + { + "waypointRelativePos": 0.4, + "rotationDegrees": 30.971148807886017, + "rotateFast": false } ], "constraintZones": [], From 54817e972f0e82ea2c84e07f35df4d5adf859b35 Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:06:37 -0700 Subject: [PATCH 14/15] fixed the rest of the PR comments --- src/main/java/org/carlmontrobotics/RobotContainer.java | 4 ++-- .../carlmontrobotics/commands/AutonRuinerShootAndIntake.java | 2 +- .../java/org/carlmontrobotics/subsystems/IntakeShooter.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/carlmontrobotics/RobotContainer.java b/src/main/java/org/carlmontrobotics/RobotContainer.java index df5aaef2..781a1a9a 100644 --- a/src/main/java/org/carlmontrobotics/RobotContainer.java +++ b/src/main/java/org/carlmontrobotics/RobotContainer.java @@ -356,8 +356,8 @@ private void registerAutoCommands(){ // AutonRuinerShoot(intakeShooter)); // NamedCommands.registerCommand("IntakeAutonRuiner", new // IntakeAutonRuiner(intakeShooter)); - // NamedCommands.registerCommand("AutonRuinerShootAndIntake", new - // IntakeAutonRuiner(intakeShooter)); + + NamedCommands.registerCommand("AutonRuinerShootAndIntake", new AutonRuinerShootAndIntake(intakeShooter)); NamedCommands.registerCommand("PassToOuttake", new PassToOuttake(intakeShooter)); diff --git a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java index 4790ca12..e4134966 100644 --- a/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java +++ b/src/main/java/org/carlmontrobotics/commands/AutonRuinerShootAndIntake.java @@ -19,7 +19,7 @@ public AutonRuinerShootAndIntake(IntakeShooter intakeShooter) { @Override public void initialize() { intakeShooter.setRPMIntake(INTAKE_RPM); - intakeShooter.setAutoRuinerOuttake(0.3); + intakeShooter.motorSetOutake(0.3); } diff --git a/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java b/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java index 986dd0d6..2a19c059 100644 --- a/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java +++ b/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java @@ -202,8 +202,8 @@ public void setMaxIntake(int direction) { } - public void setMaxOuttake(int d) { - outtakeMotorVortex.set(1 * d); + public void setMaxOuttake(int direction) { + outtakeMotorVortex.set(1 * direction); } public void setAutoRuinerOuttake(double d) { From 436a15de843e294d98827813c7bd3ba387aba9cc Mon Sep 17 00:00:00 2001 From: Rand0mAsianKid <144396869+Rand0mAsianKid@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:14:33 -0700 Subject: [PATCH 15/15] got rid of set outtake for ruiners --- .../java/org/carlmontrobotics/subsystems/IntakeShooter.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java b/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java index 07ebbd84..f2835fb9 100644 --- a/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java +++ b/src/main/java/org/carlmontrobotics/subsystems/IntakeShooter.java @@ -203,10 +203,6 @@ public void setMaxOuttake(int direction) { outtakeMotorVortex.set(1 * direction); } - public void setAutoRuinerOuttake(double d) { - outtakeMotorVortex.set(1 * d); - } - public void setMaxOuttakeOverload(int direction) { outtakeMotorVortex.setSmartCurrentLimit(80); outtakeMotorVortex.set(1 * direction);