diff --git a/src/main/deploy/pathplanner/autos/HubFarRight-Score-Push.auto b/src/main/deploy/pathplanner/autos/HubFarRight-Score-Push.auto new file mode 100644 index 0000000..cb5b903 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/HubFarRight-Score-Push.auto @@ -0,0 +1,62 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Intake Extended" + } + }, + { + "type": "wait", + "data": { + "waitTime": 1.5 + } + }, + { + "type": "path", + "data": { + "pathName": "Copy of HubFarRight-NeutralZone 1-2" + } + }, + { + "type": "path", + "data": { + "pathName": "HubFarRight-NeutralZone 2-2" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "HubFarLeft-Shoot" + } + }, + { + "type": "named", + "data": { + "name": "Robot Rev Up" + } + } + ] + } + }, + { + "type": "named", + "data": { + "name": "Robot Shoot" + } + } + ] + } + }, + "resetOdom": true, + "folder": "HubRight", + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/X HubCenter-Station-Score.auto b/src/main/deploy/pathplanner/autos/X HubCenter-Station-Score.auto index 17eb54f..7d1ab76 100644 --- a/src/main/deploy/pathplanner/autos/X HubCenter-Station-Score.auto +++ b/src/main/deploy/pathplanner/autos/X HubCenter-Station-Score.auto @@ -38,7 +38,7 @@ { "type": "path", "data": { - "pathName": "PlayerStation-Shoot" + "pathName": "CPlayerStation-CShoot" } }, { diff --git a/src/main/deploy/pathplanner/paths/CPlayerStation-CShoot.path b/src/main/deploy/pathplanner/paths/CPlayerStation-CShoot.path new file mode 100644 index 0000000..7325176 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/CPlayerStation-CShoot.path @@ -0,0 +1,75 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 0.45, + "y": 1.0 + }, + "prevControl": null, + "nextControl": { + "x": 0.8305284220032643, + "y": 0.9200002390150002 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.4998005698005699, + "y": 1.140868945868947 + }, + "prevControl": { + "x": 1.2334625881261518, + "y": 0.9559732945163617 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 4.6115541, + "y": 4.0213534 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 0.4, + "maxWaypointRelativePos": 1.0, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 0.4, + "y": 5.5 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 0.0, + "maxWaypointRelativePos": 0.2749379652605452, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -137.5 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0.0, + "rotation": -90.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Copy of HubFarRight-NeutralZone 1-2.path b/src/main/deploy/pathplanner/paths/Copy of HubFarRight-NeutralZone 1-2.path new file mode 100644 index 0000000..e65a3bf --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Copy of HubFarRight-NeutralZone 1-2.path @@ -0,0 +1,65 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6162261904761905, + "y": 0.6661428571428576 + }, + "prevControl": null, + "nextControl": { + "x": 4.6685357142857145, + "y": 0.6015000000000011 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.663, + "y": 0.8712976190476196 + }, + "prevControl": { + "x": 7.713544609817508, + "y": 0.5725975891884018 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 9.0, + "y": 0.5 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 0.025631067961170227, + "maxWaypointRelativePos": 0.6920388349514595, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 10.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 2.6, + "rotation": 90.0 + }, + "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/HubCenter-PlayerStation.path b/src/main/deploy/pathplanner/paths/HubCenter-PlayerStation.path index 14a36ff..cbd5c03 100644 --- a/src/main/deploy/pathplanner/paths/HubCenter-PlayerStation.path +++ b/src/main/deploy/pathplanner/paths/HubCenter-PlayerStation.path @@ -16,16 +16,16 @@ }, { "anchor": { - "x": 2.5, - "y": 4.0 + "x": 2.3637023809523816, + "y": 3.0632142857142854 }, "prevControl": { - "x": 2.778903133903134, - "y": 4.319245014245015 + "x": 2.6426055148555156, + "y": 3.382459299959301 }, "nextControl": { - "x": 1.995141221800707, - "y": 3.422116038703489 + "x": 1.8588436027530886, + "y": 2.4853303244177742 }, "isLocked": false, "linkedName": null @@ -48,12 +48,12 @@ }, { "anchor": { - "x": 0.46, - "y": 1.0 + "x": 0.3, + "y": 0.8999999999999999 }, "prevControl": { - "x": 0.709742135052909, - "y": 0.9886480847776856 + "x": 0.5497421350529089, + "y": 0.8886480847776855 }, "nextControl": null, "isLocked": false, @@ -61,7 +61,21 @@ } ], "rotationTargets": [], - "constraintZones": [], + "constraintZones": [ + { + "name": "Constraints Zone", + "minWaypointRelativePos": 1.771712158808938, + "maxWaypointRelativePos": 3.0, + "constraints": { + "maxVelocity": 0.7, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 12.0, + "unlimited": false + } + } + ], "pointTowardsZones": [ { "fieldPosition": { @@ -69,7 +83,7 @@ "y": 0.7 }, "rotationOffset": 180.0, - "minWaypointRelativePos": 0.8486842105263119, + "minWaypointRelativePos": 1.0272952853597963, "maxWaypointRelativePos": 1.95, "name": "Point Towards Zone" }, @@ -80,7 +94,7 @@ }, "rotationOffset": 180.0, "minWaypointRelativePos": 0.0, - "maxWaypointRelativePos": 0.7515182186234766, + "maxWaypointRelativePos": 0.44367245657569376, "name": "Point Towards Zone" } ], @@ -90,7 +104,7 @@ "maxAcceleration": 3.0, "maxAngularVelocity": 600.0, "maxAngularAcceleration": 750.0, - "nominalVoltage": 10.0, + "nominalVoltage": 12.0, "unlimited": false }, "goalEndState": { diff --git a/src/main/deploy/pathplanner/paths/HubFarLeft-NeutralZone 2-2.path b/src/main/deploy/pathplanner/paths/HubFarLeft-NeutralZone 2-2.path index 811f3d8..2cab886 100644 --- a/src/main/deploy/pathplanner/paths/HubFarLeft-NeutralZone 2-2.path +++ b/src/main/deploy/pathplanner/paths/HubFarLeft-NeutralZone 2-2.path @@ -48,7 +48,7 @@ "constraintZones": [ { "name": "Constraints Zone", - "minWaypointRelativePos": 0, + "minWaypointRelativePos": 0.2679900744416821, "maxWaypointRelativePos": 0.8992555831265578, "constraints": { "maxVelocity": 1.2, diff --git a/src/main/deploy/pathplanner/paths/HubFarLeft-Shoot.path b/src/main/deploy/pathplanner/paths/HubFarLeft-Shoot.path new file mode 100644 index 0000000..900ac05 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/HubFarLeft-Shoot.path @@ -0,0 +1,75 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 4.0, + "y": 7.4 + }, + "prevControl": null, + "nextControl": { + "x": 2.7848095238095247, + "y": 7.393059523809524 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.514869047619049, + "y": 5.805809523809524 + }, + "prevControl": { + "x": 2.638903782208257, + "y": 6.0228703093406395 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [ + { + "fieldPosition": { + "x": 4.61155415, + "y": 4.0213534 + }, + "rotationOffset": 180.0, + "minWaypointRelativePos": 0.40595533498758746, + "maxWaypointRelativePos": 1.0, + "name": "Point Towards Zone" + }, + { + "fieldPosition": { + "x": 0.0, + "y": 7.4 + }, + "rotationOffset": 0.0, + "minWaypointRelativePos": 0.0, + "maxWaypointRelativePos": 0.32258064516129836, + "name": "Point Towards Zone" + } + ], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 600.0, + "maxAngularAcceleration": 750.0, + "nominalVoltage": 10.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 139.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 180.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/HubFarRight-NeutralZone 2-2.path b/src/main/deploy/pathplanner/paths/HubFarRight-NeutralZone 2-2.path index e2f9531..ddc66c0 100644 --- a/src/main/deploy/pathplanner/paths/HubFarRight-NeutralZone 2-2.path +++ b/src/main/deploy/pathplanner/paths/HubFarRight-NeutralZone 2-2.path @@ -92,7 +92,7 @@ "unlimited": false }, "goalEndState": { - "velocity": 0, + "velocity": 3.0, "rotation": 180.0 }, "reversed": false, diff --git a/src/main/java/frc4388/robot/constants/BuildConstants.java b/src/main/java/frc4388/robot/constants/BuildConstants.java index d32cb2f..1185453 100644 --- a/src/main/java/frc4388/robot/constants/BuildConstants.java +++ b/src/main/java/frc4388/robot/constants/BuildConstants.java @@ -7,12 +7,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "2026KPopRobotHunters"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 145; - public static final String GIT_SHA = "d5ff90c1aa76a82571b723631ee8562d9f040026"; - public static final String GIT_DATE = "2026-03-06 10:57:47 MST"; + public static final int GIT_REVISION = 146; + public static final String GIT_SHA = "0ce384a9402300fbc7b2c1b609c507284c5caa3c"; + public static final String GIT_DATE = "2026-03-06 22:52:06 MST"; public static final String GIT_BRANCH = "PikesPeak"; - public static final String BUILD_DATE = "2026-03-06 16:34:51 MST"; - public static final long BUILD_UNIX_TIME = 1772840091676L; + public static final String BUILD_DATE = "2026-03-07 15:12:09 MST"; + public static final long BUILD_UNIX_TIME = 1772921529065L; public static final int DIRTY = 1; private BuildConstants(){} diff --git a/src/main/java/frc4388/robot/subsystems/shooter/Shooter.java b/src/main/java/frc4388/robot/subsystems/shooter/Shooter.java index de02591..15f0edf 100644 --- a/src/main/java/frc4388/robot/subsystems/shooter/Shooter.java +++ b/src/main/java/frc4388/robot/subsystems/shooter/Shooter.java @@ -143,6 +143,12 @@ public class Shooter extends SubsystemBase { badShooterVelocity = Math.abs(shooterSpeed - shooterSpeedTarget) > ShooterConstants.SHOOTER_SPEED_TOLERANCE.get(); + //revtime calculations + // double shooterAcceleration = + double shooterSpeedTargetPretend = ShooterConstants.getTargetShooterSpeed(distanceToHub).in(RotationsPerSecond); + double revTime = (Math.abs(shooterSpeed - shooterSpeedTargetPretend)/((7 - shooterSpeedTargetPretend)/ShooterConstants.T_CONSTANT)); + // double revTimeExp = ShooterConstants.T_CONSTANT * Math.log(1 - Math.abs(shooterSpeed/shooterSpeedTargetPretend)); + Logger.recordOutput("Time to rev", revTime); switch (mode) { case Shooting: diff --git a/src/main/java/frc4388/robot/subsystems/shooter/ShooterConstants.java b/src/main/java/frc4388/robot/subsystems/shooter/ShooterConstants.java index 8c7960d..d55e93b 100644 --- a/src/main/java/frc4388/robot/subsystems/shooter/ShooterConstants.java +++ b/src/main/java/frc4388/robot/subsystems/shooter/ShooterConstants.java @@ -17,6 +17,7 @@ public class ShooterConstants { public static final double SHOOTERMOTOR_GEAR_RATIO = 1.5; public static final double INDEXER_GEAR_RATIO = 1.; + public static final double T_CONSTANT = 2; public static final ConfigurableDouble SHOOTER_MAX_VELOCITY = new ConfigurableDouble("Shooter MAX Velocity", 60); public static final ConfigurableDouble SHOOTER_OVERRIDE_VELOCITY = new ConfigurableDouble("Shooter OVERRIDE Velocity", -42); @@ -29,7 +30,7 @@ public class ShooterConstants { public static final ConfigurableDouble INDEXER_FORWARD_OUTPUT = new ConfigurableDouble("Indexer FWD % Output", -0.4); public static final ConfigurableDouble INDEXER_REVERSE_OUTPUT = new ConfigurableDouble("Indexer reverse % Output", 0.0); - public static final ConfigurableDouble MODEL_TRIM = new ConfigurableDouble("TRIM SHOOTER SPEED", 0.0); + public static final ConfigurableDouble MODEL_TRIM = new ConfigurableDouble("TRIM SHOOTER SPEED", -1.5); public static final ConfigurableDouble AIM_LEAD_TIME = new ConfigurableDouble("Aim lead time", 0); @@ -55,6 +56,11 @@ public class ShooterConstants { double speed = 5.6939*hubDistMeters + 22.76545 + MODEL_TRIM.get(); + + // double speed = + // 0.00610938*hubDistMeters*hubDistMeters + // 5.65235*hubDistMeters + + // 22.82825; double max = SHOOTER_MAX_VELOCITY.get();