Skip to content

Commit

Permalink
remove note finder (wont carry over) + organize into package folders
Browse files Browse the repository at this point in the history
  • Loading branch information
linglejack06 committed Apr 20, 2024
1 parent 1034de8 commit b7a4ebc
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 270 deletions.
67 changes: 67 additions & 0 deletions lib/src/main/java/coppercore/constants/FieldConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package constants;

import edu.wpi.first.math.util.Units;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Translation2d;

public static final class FieldConstants {
public static final double lengthM = 16.451;
public static final double widthM = 8.211;

public static final double midfieldLowThresholdM = 5.87;
public static final double midfieldHighThresholdM = 10.72;

public static final Rotation2d ampHeading = new Rotation2d(-Math.PI / 2);

public static final Rotation2d blueUpHeading = Rotation2d.fromRadians(0.0);
public static final Rotation2d blueDownHeading = Rotation2d.fromRadians(Math.PI);
public static final Rotation2d blueLeftHeading = Rotation2d.fromRadians(Math.PI / 2.0);
public static final Rotation2d blueRightHeading = Rotation2d.fromRadians(-Math.PI / 2.0);

public static final Rotation2d redUpHeading = Rotation2d.fromRadians(Math.PI);
public static final Rotation2d redDownHeading = Rotation2d.fromRadians(0.0);
public static final Rotation2d redLeftHeading = Rotation2d.fromRadians(-Math.PI / 2.0);
public static final Rotation2d redRightHeading = Rotation2d.fromRadians(Math.PI / 2.0);

public static final Rotation2d redSourceHeading =
new Rotation2d(Math.PI * 4 / 3); // 60 degrees
public static final Rotation2d blueSourceHeading =
new Rotation2d(Math.PI * 5 / 3); // 120 degrees

public static final Translation2d fieldToRedSpeaker =
new Translation2d(Units.inchesToMeters(652.73), Units.inchesToMeters(218.42));

public static final Translation2d fieldToBlueSpeaker =
new Translation2d(Units.inchesToMeters(-1.5), Units.inchesToMeters(218.42));

public static final Pose2d robotAgainstBlueSpeaker =
new Pose2d(1.39, 5.56, Rotation2d.fromDegrees(180));

public static final Pose2d robotAgainstRedSpeaker =
new Pose2d(15.19, 5.56, Rotation2d.fromDegrees(0));

public static final Pose2d robotAgainstBlueSpeakerRight =
new Pose2d(0.7, 4.38, Rotation2d.fromDegrees(120));

public static final Pose2d robotAgainstRedSpeakerRight =
new Pose2d(15.83, 6.73, Rotation2d.fromDegrees(-60));

public static final Pose2d robotAgainstBlueSpeakerLeft =
new Pose2d(0.7, 6.73, Rotation2d.fromDegrees(-120));

public static final Pose2d robotAgainstRedSpeakerLeft =
new Pose2d(15.83, 4.38, Rotation2d.fromDegrees(60));

public static final Pose2d robotAgainstBluePodium =
new Pose2d(2.57, 4.09, Rotation2d.fromDegrees(180));

public static final Pose2d robotAgainstRedPodium =
new Pose2d(13.93, 4.09, Rotation2d.fromDegrees(0));

public static final Pose2d robotAgainstBlueAmpZone =
new Pose2d(2.85, 7.68, Rotation2d.fromDegrees(-90));

public static final Pose2d robotAgainstRedAmpZone =
new Pose2d(13.74, 7.68, Rotation2d.fromDegrees(-90));
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
package frc.robot.utils;
package utils;

import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.wpilibj.DriverStation;
import frc.robot.Constants.FieldConstants;
import org.littletonrobotics.junction.Logger;
import constants.FieldConstants;

public class AllianceUtil {

public static Translation2d getFieldToSpeaker() {
if (!DriverStation.getAlliance().isEmpty()) {
switch (DriverStation.getAlliance().get()) {
case Blue:
Logger.recordOutput("Field/speaker", FieldConstants.fieldToBlueSpeaker);
return FieldConstants.fieldToBlueSpeaker;
case Red:
Logger.recordOutput("Field/speaker", FieldConstants.fieldToRedSpeaker);
return FieldConstants.fieldToRedSpeaker;
}
}
return FieldConstants.fieldToRedSpeaker;
}

public static Rotation2d getAmpHeading() {
Logger.recordOutput("Field/amp", FieldConstants.ampHeading);
return FieldConstants.ampHeading;
}

Expand Down Expand Up @@ -92,10 +88,8 @@ public static Rotation2d getSourceHeading() {
if (!DriverStation.getAlliance().isEmpty()) {
switch (DriverStation.getAlliance().get()) {
case Blue:
Logger.recordOutput("Field/source", FieldConstants.blueSourceHeading);
return FieldConstants.blueSourceHeading;
case Red:
Logger.recordOutput("Field/source", FieldConstants.redSourceHeading);
return FieldConstants.redSourceHeading;
}
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
204 changes: 0 additions & 204 deletions lib/src/main/java/org/utils/notesimulator/Note.java

This file was deleted.

58 changes: 0 additions & 58 deletions lib/src/main/java/org/utils/notesimulator/NoteManager.java

This file was deleted.

0 comments on commit b7a4ebc

Please sign in to comment.