Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
Alvin/swerve fix2 (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimizh2418 authored Oct 4, 2023
1 parent c28a0d5 commit 1b86379
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/deploy/pathplanner/TopGrid3PieceTaxi.path
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
},
{
"anchorPoint": {
"x": 6.654269729684945,
"x": 6.55,
"y": 4.576056676374828
},
"prevControl": {
"x": 5.805178456479655,
"x": 5.70090872679471,
"y": 4.597962915155529
},
"nextControl": {
"x": 5.805178456479655,
"x": 5.70090872679471,
"y": 4.597962915155529
},
"holonomicAngle": 180.0,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/team1540/robot2023/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static final class Swerve {
/* Module Specific Constants */
/* Front Left Module - Module 0 */
public static final class Mod0 {
private static final int moduleID = 4;
private static final int moduleID = 1; //4
public static final SwerveModuleConstants constants = new SwerveModuleConstants(moduleID, ModuleCorner.FRONT_LEFT);
}

Expand All @@ -171,7 +171,7 @@ public static final class Mod2 {

/* Back Right Module - Module 3 */
public static final class Mod3 {
private static final int moduleID = 2;
private static final int moduleID = 5;
public static final SwerveModuleConstants constants = new SwerveModuleConstants(moduleID, ModuleCorner.REAR_RIGHT);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void execute() {
if(limelight.getTa() != 0 && limelight.getTclass().equals(gamepiece.identifier)){
System.out.println("SEEING GAME PIECE ");
angleXOffset = limelight.getTx() - limelight.getTa() * -0.9;

double gyroAngle = angleSupplier.getAsDouble();
pid.setSetpoint(gyroAngle + angleXOffset);//*-0.698-2.99); //16 (very sketchy constant) + angleOffset for back camera
SmartDashboard.putBoolean("pointToTarget/turningWithLimelight", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* Represents a corner of the robot. Used for calculating encoder offsets
*/
public enum ModuleCorner {
FRONT_LEFT(0, "Front Left"),
FRONT_LEFT(90, "Front Left"),
FRONT_RIGHT(90, "Front Right"),
REAR_LEFT(180, "Rear Left"),
REAR_RIGHT(270, "Rear Right");
REAR_RIGHT(90, "Rear Right");
private final double offset;
public final String label;
ModuleCorner(double offset, String label) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
public class ModuleMagnetOffset {
private static final double[] offsets = new double[]{
150.469, // Module 1
75.469, // Module 1
91.318, // Module 2
256.729, // Module 3
9.0, // Module 4
Expand Down

0 comments on commit 1b86379

Please sign in to comment.