Skip to content

Commit

Permalink
Merge pull request #34 from applepi-2067/cj/krakendrive
Browse files Browse the repository at this point in the history
  • Loading branch information
CJc318 authored May 28, 2024
2 parents 8e2130d + 6e6b794 commit b868948
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 6 deletions.
112 changes: 112 additions & 0 deletions src/main/deploy/pathplanner/autos/Anti-Aces Auto.auto
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"version": 1.0,
"startingPose": {
"position": {
"x": 1.454549670868242,
"y": 6.476092609817173
},
"rotation": -178.63607246839726
},
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "CloseAimShoot"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Amp note 2"
}
},
{
"type": "named",
"data": {
"name": "Pickup"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "AimShoot"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Amp midline note path 2"
}
},
{
"type": "named",
"data": {
"name": "Pickup"
}
}
]
}
},
{
"type": "path",
"data": {
"pathName": "Amp return path"
}
},
{
"type": "named",
"data": {
"name": "AimShoot"
}
},
{
"type": "deadline",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Amp midline note path 2"
}
},
{
"type": "named",
"data": {
"name": "Pickup"
}
}
]
}
},
{
"type": "path",
"data": {
"pathName": "Amp return path"
}
},
{
"type": "named",
"data": {
"name": "AimShoot"
}
}
]
}
},
"folder": null,
"choreoAuto": false
}
5 changes: 3 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public RobotContainer() {
m_drivetrain::getRobotRelativeChassisSpeeds,
m_drivetrain::driveRobotRelative,
new HolonomicPathFollowerConfig(
new PIDConstants(3.0),
new PIDConstants(11.0),
new PIDConstants(2.65),
new PIDConstants(8.2),
DriveMotor.MAX_SPEED_METERS_PER_SEC,
Drivetrain.CENTER_TO_WHEEL_OFFSET_METERS,
new ReplanningConfig()
Expand All @@ -99,6 +99,7 @@ public RobotContainer() {
autoChooser.addOption("Jim auto", new PathPlannerAuto("Jim auto"));
autoChooser.addOption("Center 4 note close", new PathPlannerAuto("Close 4 note"));
autoChooser.addOption("Close shot", new ZeroShoulder().andThen(new AimShoot(true)));
autoChooser.addOption("Anti Aces auto", new PathPlannerAuto("Anti-Aces Auto"));

SmartDashboard.putData("Auto chooser", autoChooser);

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/subsystems/swerve/DriveMotor.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class DriveMotor {

// Motor settings.
private static final CurrentLimitsConfigs CURRENT_LIMITS_CONFIGS = new CurrentLimitsConfigs()
.withSupplyCurrentThreshold(80)
.withSupplyCurrentThreshold(75)
.withSupplyTimeThreshold(4.5)
.withSupplyCurrentLimit(40);
.withSupplyCurrentLimit(60);
private static final double PERCENT_DEADBAND = 0.001;

// Conversion constants.
Expand All @@ -33,7 +33,7 @@ public class DriveMotor {

// PID.
private static final int K_TIMEOUT_MS = 10;
private static final Slot0Configs PID_GAINS = new Slot0Configs().withKP(2.0).withKV(0.8);
private static final Slot0Configs PID_GAINS = new Slot0Configs().withKP(2.2).withKV(0.4);

private static final double FALCON_500_MAX_SPEED_RPS = 6380.0 / 60.0;
private static final MotionMagicConfigs MOTION_MAGIC_CONFIGS = new MotionMagicConfigs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class SwerveModule {
// Back left, back right, front left, front right convention.
// Calibration procedure: set all offsets to 0.0, redeploy, align all wheels to face forwards,
// use CANCoder reading as offset, add 180.0 if wheel drives backwards.
private static final double[] STEER_WHEEL_ZERO_OFFSET_DEGREES = {298.04, 260.33, 161.37, -0.44};
private static final double[] STEER_WHEEL_ZERO_OFFSET_DEGREES = {298.04, 260.33, 161.37, -0.44}; //adjust wheel offsets.

private static final DecimalFormat rounder = new DecimalFormat("0.0000");

Expand Down

0 comments on commit b868948

Please sign in to comment.