-
Notifications
You must be signed in to change notification settings - Fork 1
started field awareness #68
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
4fb6b20
fdf8540
c34712a
7d0667a
33ba566
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||||||||||||||||||||||
| package org.team5924.frc2026.subsystems.awareness; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import org.team5924.frc2026.Constants; | ||||||||||||||||||||||||||||
| import org.team5924.frc2026.RobotState; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import edu.wpi.first.math.geometry.Translation2d; | ||||||||||||||||||||||||||||
| import edu.wpi.first.math.kinematics.ChassisSpeeds; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public class FieldAwareness { | ||||||||||||||||||||||||||||
| private static FieldAwareness instance; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public static FieldAwareness getInstance() { | ||||||||||||||||||||||||||||
| if (instance == null) instance = new FieldAwareness(); | ||||||||||||||||||||||||||||
| return instance; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+13
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Singleton can still be instantiated directly.
Proposed fix public class FieldAwareness {
private static FieldAwareness instance;
+ private FieldAwareness() {}
+
public static FieldAwareness getInstance() {
if (instance == null) instance = new FieldAwareness();
return instance;
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| private double[] getDistanceToTrenches(){ | ||||||||||||||||||||||||||||
| double[] distance = new double[4]; | ||||||||||||||||||||||||||||
| Translation2d robotPosition = RobotState.getInstance().getOdometryPose().getTranslation(); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| for (int i = 0; i < 4; i++) { | ||||||||||||||||||||||||||||
| distance[i] = Constants.Field.TRENCH_TRANSLATIONS[i].getDistance(robotPosition); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| return distance; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| private void tdfyguijoi() { // TOD: name later | ||||||||||||||||||||||||||||
| ChassisSpeeds speeds = RobotState.getInstance().getRobotChassisSpeeds(); | ||||||||||||||||||||||||||||
| Translation2d velocity = new Translation2d(speeds.vxMetersPerSecond, speeds.vyMetersPerSecond); | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Placeholder method with nonsensical name and no implementation. This method has a random keyboard-mash name (
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.