From aee289b92f6a5de50563ad95371f6b15a79b0dfe Mon Sep 17 00:00:00 2001 From: TheRealGreydon Date: Fri, 16 Oct 2026 23:19:10 -0400 Subject: [PATCH] PADC --- src/main/deploy/pathplanner/autos/PADC.auto | 128 ++++++++++++++++++ .../deploy/pathplanner/paths/PADC Path 1.path | 54 ++++++++ .../deploy/pathplanner/paths/PADC Path 2.path | 84 ++++++++++++ .../deploy/pathplanner/paths/POFR Path.path | 54 ++++++++ src/main/java/frc/robot/RobotContainer.java | 3 +- .../frc/robot/subsystems/IntakeSubsystem.java | 5 + 6 files changed, 327 insertions(+), 1 deletion(-) create mode 100644 src/main/deploy/pathplanner/autos/PADC.auto create mode 100644 src/main/deploy/pathplanner/paths/PADC Path 1.path create mode 100644 src/main/deploy/pathplanner/paths/PADC Path 2.path create mode 100644 src/main/deploy/pathplanner/paths/POFR Path.path diff --git a/src/main/deploy/pathplanner/autos/PADC.auto b/src/main/deploy/pathplanner/autos/PADC.auto new file mode 100644 index 0000000..0500833 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/PADC.auto @@ -0,0 +1,128 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "PADC Path 1" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "deadline", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 17.75 + } + }, + { + "type": "named", + "data": { + "name": "Ultrashooter" + } + } + ] + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake" + } + }, + { + "type": "named", + "data": { + "name": "Spin Off" + } + } + ] + } + } + ] + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 5.0 + } + }, + { + "type": "named", + "data": { + "name": "Deploy" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.0 + } + }, + { + "type": "named", + "data": { + "name": "Intake" + } + } + ] + } + }, + { + "type": "sequential", + "data": { + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 8.0 + } + }, + { + "type": "path", + "data": { + "pathName": "PADC Path 2" + } + } + ] + } + } + ] + } + } + ] + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/PADC Path 1.path b/src/main/deploy/pathplanner/paths/PADC Path 1.path new file mode 100644 index 0000000..21cffe9 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/PADC Path 1.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.582922222222222, + "y": 4.064233333333333 + }, + "prevControl": null, + "nextControl": { + "x": 2.2971011046886955, + "y": 4.3924620495539415 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.16, + "y": 4.064 + }, + "prevControl": { + "x": 4.149634897846495, + "y": 3.9482331080517086 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 360.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 178.352 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/PADC Path 2.path b/src/main/deploy/pathplanner/paths/PADC Path 2.path new file mode 100644 index 0000000..5e624f0 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/PADC Path 2.path @@ -0,0 +1,84 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 2.16, + "y": 4.064 + }, + "prevControl": null, + "nextControl": { + "x": 2.299908956381313, + "y": 4.78833166567235 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.6925, + "y": 5.9643999999999995 + }, + "prevControl": { + "x": 2.3024623015038452, + "y": 5.932763515422636 + }, + "nextControl": { + "x": -0.019201968110784673, + "y": 6.053179638973866 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.5524, + "y": 5.9643999999999995 + }, + "prevControl": { + "x": 1.011474512820477, + "y": 5.850705612296633 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 1.18, + "maxWaypointRelativePos": 2.0, + "constraints": { + "maxVelocity": 0.2, + "maxAcceleration": 0.1, + "maxAngularVelocity": 360.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 360.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 180.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 178.352 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/POFR Path.path b/src/main/deploy/pathplanner/paths/POFR Path.path new file mode 100644 index 0000000..6a7cc29 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/POFR Path.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6316444444444445, + "y": 0.6439333333333332 + }, + "prevControl": null, + "nextControl": { + "x": 2.455880964242888, + "y": 0.053867105905050616 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.296655555555556, + "y": 5.457688888888888 + }, + "prevControl": { + "x": 2.9026975888729534, + "y": 6.527259374028039 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 360.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 140.4403320310055 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 0.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 188c468..d1386ac 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -58,7 +58,8 @@ public class RobotContainer { NamedCommands.registerCommand("Deploy", intakeSubsystem.deploy()); NamedCommands.registerCommand("Spin Off", hopperSubsystem.spinOff()); NamedCommands.registerCommand("Ultrashooter", new UltraShooterCommand(hopperSubsystem, turretSubsystem, driveSubsystem)); - + NamedCommands.registerCommand("Intake", intakeSubsystem.intakeNR()); + NamedCommands.registerCommand("ChassisAlignShoot", new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem)); NamedCommands.registerCommand("RunIntake", intakeSubsystem.intake(m_driverController.getHID())); NamedCommands.registerCommand("TurretShoot", new AutoTurretShootCommand(hopperSubsystem, turretSubsystem, intakeSubsystem, driveSubsystem)); diff --git a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java index 322c59f..40e8175 100644 --- a/src/main/java/frc/robot/subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/subsystems/IntakeSubsystem.java @@ -68,6 +68,11 @@ public class IntakeSubsystem extends TestableSubsystem { }); } + public Command intakeNR() { + return this.runOnce(() -> + {if (intakeMotor.get() == 0) {setSpeed(-.45);} else {intakeMotor.stopMotor();}}); + } + public Command reverseIntake() { return this.runEnd(() -> setSpeed(.45), () -> { intakeMotor.stopMotor();