Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit all, explain later #103

Open
wants to merge 26 commits into
base: district-4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/deploy/pathplanner/Alon 4 ball #2.path
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"waypoints":[{"anchorPoint":{"x":7.68,"y":0.81},"prevControl":null,"nextControl":{"x":7.592110958862685,"y":2.057404114812666},"holonomicAngle":79.28,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":5.727465936471339,"y":1.72113244051184},"prevControl":{"x":7.014699442397051,"y":2.02486169471903},"nextControl":{"x":4.631195615678799,"y":1.4624619153810163},"holonomicAngle":-165.76271953423893,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":1.3306233993767749,"y":0.5351420193218593},"prevControl":{"x":2.6467835009412655,"y":1.1859904211944103},"nextControl":null,"holonomicAngle":-141.95295746817393,"isReversal":false,"velOverride":null,"isLocked":false}]}
{"waypoints":[{"anchorPoint":{"x":7.68,"y":0.81},"prevControl":null,"nextControl":{"x":7.592110958862685,"y":2.057404114812666},"holonomicAngle":79.28,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":5.727465936471339,"y":1.72113244051184},"prevControl":{"x":7.014699442397051,"y":2.02486169471903},"nextControl":{"x":4.631195615678799,"y":1.4624619153810163},"holonomicAngle":-165.76271953423893,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":1.1097731477424426,"y":1.0665352328953341},"prevControl":{"x":2.551984847157085,"y":1.4842748908264891},"nextControl":null,"holonomicAngle":-141.95295746817393,"isReversal":false,"velOverride":null,"isLocked":false}]}
2 changes: 1 addition & 1 deletion src/main/deploy/pathplanner/Alon 4 ball #3.path
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"waypoints":[{"anchorPoint":{"x":1.33,"y":0.54},"prevControl":null,"nextControl":{"x":2.2845776560797413,"y":0.9594356367623105},"holonomicAngle":-139.67,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":5.268093581171338,"y":1.3668567129531706},"prevControl":{"x":4.268093581171338,"y":1.3668567129531706},"nextControl":null,"holonomicAngle":40.914383220025144,"isReversal":false,"velOverride":null,"isLocked":false}],"maxVelocity":4.0,"maxAcceleration":2.0,"isReversed":null}
{"waypoints":[{"anchorPoint":{"x":1.11,"y":1.07},"prevControl":null,"nextControl":{"x":2.1909478711777037,"y":1.8194571906832087},"holonomicAngle":-139.67,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":5.268093581171338,"y":1.3668567129531706},"prevControl":{"x":4.268093581171338,"y":1.3668567129531706},"nextControl":null,"holonomicAngle":40.914383220025144,"isReversal":false,"velOverride":null,"isLocked":false}],"maxVelocity":4.0,"maxAcceleration":2.0,"isReversed":null}
1 change: 1 addition & 0 deletions src/main/deploy/pathplanner/Disappeare #1.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":6.720378838681553,"y":5.638283940927743},"prevControl":null,"nextControl":{"x":6.734616929441472,"y":5.638283940927743},"holonomicAngle":134.99999999999991,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":5.666760122447581,"y":7.375331013637806},"prevControl":{"x":5.6525220316876625,"y":7.375331013637806},"nextControl":null,"holonomicAngle":-54.86580694308438,"isReversal":false,"velOverride":null,"isLocked":false}]}
1 change: 1 addition & 0 deletions src/main/deploy/pathplanner/Disappeare #2.1.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":6.108140936005055,"y":4.1290463203763785},"prevControl":null,"nextControl":{"x":7.108140936005055,"y":4.1290463203763785},"holonomicAngle":1.5074357587749554,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":4.086332048096622,"y":4.029379685056948},"prevControl":{"x":4.086332048096622,"y":4.01514159429703},"nextControl":null,"holonomicAngle":0.0,"isReversal":false,"velOverride":null,"isLocked":false}]}
1 change: 1 addition & 0 deletions src/main/deploy/pathplanner/Disappeare #2.2.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":4.072093957336704,"y":3.9439511404974366},"prevControl":null,"nextControl":{"x":4.086332048096622,"y":3.9439511404974366},"holonomicAngle":0.0,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":1.309904349912506,"y":4.0578558665767845},"prevControl":{"x":1.2956662591525876,"y":4.0578558665767845},"nextControl":null,"holonomicAngle":0.0,"isReversal":false,"velOverride":null,"isLocked":false}]}
2 changes: 1 addition & 1 deletion src/main/deploy/pathplanner/FiveCargoAutoPart2.path
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"waypoints":[{"anchorPoint":{"x":4.96,"y":2.0},"prevControl":null,"nextControl":{"x":3.120852115904583,"y":2.4666138205738624},"holonomicAngle":40.150654652961755,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":1.2004537190093711,"y":1.1715271233705913},"prevControl":{"x":2.776953181322883,"y":2.3864441401993526},"nextControl":null,"holonomicAngle":-139.51398845827583,"isReversal":false,"velOverride":null,"isLocked":false}],"maxVelocity":4.0,"maxAcceleration":2.0,"isReversed":null}
{"waypoints":[{"anchorPoint":{"x":4.96,"y":2.0},"prevControl":null,"nextControl":{"x":3.120852115904583,"y":2.4666138205738624},"holonomicAngle":40.150654652961755,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":1.3259627219779835,"y":1.0232973180482268},"prevControl":{"x":2.902462184291495,"y":2.2382143348769885},"nextControl":null,"holonomicAngle":-139.51398845827583,"isReversal":false,"velOverride":null,"isLocked":false}],"maxVelocity":4.0,"maxAcceleration":2.0,"isReversed":null}
2 changes: 1 addition & 1 deletion src/main/deploy/pathplanner/FiveCargoAutoPart3.path
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"waypoints":[{"anchorPoint":{"x":1.2,"y":1.17},"prevControl":null,"nextControl":{"x":1.5020361644941214,"y":1.4018664841196122},"holonomicAngle":-139.51,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":2.4009074380187423,"y":1.7789856317849724},"prevControl":{"x":1.9525452056176515,"y":1.619889355771682},"nextControl":null,"holonomicAngle":22.5795725640263,"isReversal":false,"velOverride":null,"isLocked":false}],"maxVelocity":4.0,"maxAcceleration":2.0,"isReversed":null}
{"waypoints":[{"anchorPoint":{"x":1.3403753602603528,"y":1.02},"prevControl":null,"nextControl":{"x":1.6424115247544742,"y":1.2518664841196123},"holonomicAngle":-139.51,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":2.5798622525441197,"y":1.8015797852961732},"prevControl":{"x":2.131500020143029,"y":1.642483509282883},"nextControl":null,"holonomicAngle":22.5795725640263,"isReversal":false,"velOverride":null,"isLocked":false}],"maxVelocity":4.0,"maxAcceleration":2.0,"isReversed":null}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":5.59,"y":2.06},"prevControl":null,"nextControl":{"x":5.68380749106099,"y":2.101047099251879},"holonomicAngle":-164.29,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":4.777894753114187,"y":1.71425289653302},"prevControl":{"x":5.271566301321153,"y":1.8720242160630813},"nextControl":null,"holonomicAngle":15.762147763972642,"isReversal":false,"velOverride":null,"isLocked":false}]}
1 change: 1 addition & 0 deletions src/main/deploy/pathplanner/Four- go to terminal.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":4.78,"y":1.71},"prevControl":null,"nextControl":{"x":4.121362487972965,"y":1.5513921795987642},"holonomicAngle":15.76,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":1.5919319780877905,"y":1.4801406159400265},"prevControl":{"x":2.513112908247183,"y":1.495408808152613},"nextControl":null,"holonomicAngle":-142.56839702158936,"isReversal":false,"velOverride":null,"isLocked":false}]}
1 change: 1 addition & 0 deletions src/main/deploy/pathplanner/Four- leave low left.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":6.6656763466332585,"y":2.6405468074855807},"prevControl":null,"nextControl":{"x":6.05876943741271,"y":2.3277563235026832},"holonomicAngle":-135.31654804727307,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":5.5872494540952085,"y":2.0616509863829044},"prevControl":{"x":5.582580939408897,"y":2.0523139570102797},"nextControl":null,"holonomicAngle":-164.29136217098434,"isReversal":false,"velOverride":null,"isLocked":false}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":2.71,"y":1.55},"prevControl":null,"nextControl":{"x":2.36552038352551,"y":1.429246641898072},"holonomicAngle":-155.73,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":1.5613955936626176,"y":1.5615709744071544},"prevControl":{"x":1.3323727104738194,"y":1.1849555664966847},"nextControl":null,"holonomicAngle":-138.53955916854994,"isReversal":false,"velOverride":null,"isLocked":false}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":1.59,"y":1.48},"prevControl":null,"nextControl":{"x":2.59,"y":1.48},"holonomicAngle":-142.57,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":5.963724348291743,"y":1.5004982055568075},"prevControl":{"x":4.963724348291743,"y":1.5004982055568075},"nextControl":null,"holonomicAngle":38.49104355949754,"isReversal":false,"velOverride":null,"isLocked":false}]}
1 change: 1 addition & 0 deletions src/main/deploy/pathplanner/From Tarmac to (5,6) ball.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":6.21,"y":5.14},"prevControl":null,"nextControl":{"x":5.683180986615138,"y":5.405388025965925},"holonomicAngle":135.97,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":5.069721531848127,"y":5.949399240570633},"prevControl":{"x":5.347514492497339,"y":5.602158039759117},"nextControl":null,"holonomicAngle":135.97,"isReversal":false,"velOverride":null,"isLocked":false}]}
1 change: 1 addition & 0 deletions src/main/deploy/pathplanner/p0- leave tarmac up low.path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"waypoints":[{"anchorPoint":{"x":6.0865374516672786,"y":3.962765462187816},"prevControl":null,"nextControl":{"x":4.942994427384167,"y":4.055106757438087},"holonomicAngle":1.134421630977088,"isReversal":false,"velOverride":null,"isLocked":false},{"anchorPoint":{"x":4.055976636984904,"y":4.08778636024227},"prevControl":{"x":5.0783813532872095,"y":4.050438242751776},"nextControl":null,"holonomicAngle":0.0,"isReversal":false,"velOverride":null,"isLocked":false}]}
10 changes: 6 additions & 4 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,19 @@ public static final class SwerveDrive {
public static final WebConstant ADJUST_CONTROLLER_KP = WebConstant.of("Swerve", "kp_heading", 12.5);
public static final WebConstant ADJUST_CONTROLLER_KI = WebConstant.of("Swerve", "KI_heading", 0);
public static final WebConstant ADJUST_CONTROLLER_KD = WebConstant.of("Swerve", "Kd_heading", 0.1);

public static final double ODOMETRY_ADJUST_FINISHED_CONDITION = 2; // [deg]
public static final double VISION_ADJUST_FINISHED_CONDITION = 1.5; // [deg]
private static final double Rx = SwerveDrive.ROBOT_LENGTH / 2; // [m]
private static final double Ry = SwerveDrive.ROBOT_WIDTH / 2; // [m]

// Axis systems
public static final Translation2d[] SWERVE_POSITIONS = new Translation2d[]{
new Translation2d(Rx, -Ry),
new Translation2d(Rx, Ry),
new Translation2d(-Rx, -Ry),
new Translation2d(-Rx, Ry)
};


}

public static class Shooter {
Expand All @@ -105,7 +107,7 @@ public static class Shooter {
public static final WebConstant kI = WebConstant.of("Shooter", "kI", 0.0000075);
public static final WebConstant kD = WebConstant.of("Shooter", "kD", 9);
public static final WebConstant kF = WebConstant.of("Shooter", "kf", 0.0465);
// public static final WebConstant kP = WebConstant.of("Shooter", "kP", 0.03);
// public static final WebConstant kP = WebConstant.of("Shooter", "kP", 0.03);
// public static final WebConstant kI = WebConstant.of("Shooter", "kI", 0.00);
// public static final WebConstant kD = WebConstant.of("Shooter", "kD", 0);
// public static final WebConstant kF = WebConstant.of("Shooter", "kf", 0.0475);
Expand Down Expand Up @@ -153,7 +155,7 @@ public static final class SwerveModule {
public static final double TRIGGER_THRESHOLD_TIME = 0.02; // [secs]
public static final double RAMP_RATE = 0; // seconds from neutral to max

public static final int[] ZERO_POSITIONS = {-589, -430, -868, -519}; // fr, fl, rr, rl
public static final int[] ZERO_POSITIONS = {-582, -1451, -866, -493}; // fr, fl, rr, rl

public static final SwerveModuleConfigBase frConfig = new SwerveModuleConfigBase.Builder(0)
.configPorts(DRIVE_MOTOR_FR, ANGLE_MOTOR_FR)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import frc.robot.subsystems.intake.Intake;
import frc.robot.utils.LedSubsystem;
import frc.robot.valuetuner.NetworkTableConstant;

/**
Expand Down Expand Up @@ -131,6 +132,7 @@ public void teleopInit() {
m_autonomousCommand.cancel();
}
new InstantCommand(() -> RobotContainer.shooting = false);
new InstantCommand(() -> LedSubsystem.currentLedMode = LedSubsystem.LedMode.STATIC);
}

/**
Expand Down
Loading