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

Cj/krakendrive #34

Merged
merged 4 commits into from
May 28, 2024
Merged
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
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retune the steer offsets before merging


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

Expand Down