Skip to content

Commit 8c03c4b

Browse files
committed
abc
1 parent 9df8b63 commit 8c03c4b

File tree

5 files changed

+80
-58
lines changed

5 files changed

+80
-58
lines changed

build.gradle

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
22
id "java"
33
id "edu.wpi.first.GradleRIO" version "2024.3.2"
4-
id "com.peterabeles.gversion" version "1.10"
5-
id 'com.diffplug.spotless' version '6.20.0'
4+
// id "com.peterabeles.gversion" version "1.10"
5+
// id 'com.diffplug.spotless' version '6.20.0' // i like my weird code...
66
}
77

88
java {
@@ -129,55 +129,55 @@ dependencies {
129129
annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitJson.version"
130130
}
131131

132-
project.compileJava.dependsOn(createVersionFile)
133-
gversion {
134-
srcDir = "src/main/java/"
135-
classPackage = "frc.robot"
136-
className = "BUILD"
137-
dateFormat = "yyyy-MM-dd HH:mm:ss z"
138-
timeZone = "America/New_York" // Use preferred time zone
139-
indent = " "
140-
}
132+
// project.compileJava.dependsOn(createVersionFile) doesnt work???
133+
// gversion {
134+
// srcDir = "src/main/java/"
135+
// classPackage = "frc.robot"
136+
// className = "BUILD"
137+
// dateFormat = "yyyy-MM-dd HH:mm:ss z"
138+
// timeZone = "America/New_York" // Use preferred time zone
139+
// indent = " "
140+
// }
141+
142+
// spotless {
143+
// java {
144+
// target fileTree('.') {
145+
// include '**/*.java'
146+
// exclude '**/build/**', '**/build-*/**', '**/BUILD.java'
147+
// }
148+
// toggleOffOn()
149+
// googleJavaFormat()
150+
// removeUnusedImports()
151+
// trimTrailingWhitespace()
152+
// endWithNewline()
153+
// }
154+
// groovyGradle {
155+
// target fileTree('.') {
156+
// include '**/*.gradle'
157+
// exclude '**/build/**', '**/build-*/**'
158+
// }
159+
// greclipse()
160+
// indentWithSpaces(4)
161+
// trimTrailingWhitespace()
162+
// endWithNewline()
163+
// }
164+
// format 'xml', {
165+
// target fileTree('.') {
166+
// include '**/*.xml'
167+
// exclude '**/build/**', '**/build-*/**'
168+
// }
169+
// eclipseWtp('xml')
170+
// trimTrailingWhitespace()
171+
// indentWithSpaces(2)
172+
// endWithNewline()
173+
// }
174+
// format 'misc', {
175+
// target fileTree('.') {
176+
// include '**/*.md', '**/.gitignore'
177+
// exclude '**/build/**', '**/build-*/**'
178+
// }
179+
// trimTrailingWhitespace()
180+
// indentWithSpaces(2)
181+
// endWithNewline()
182+
// }
141183

142-
spotless {
143-
java {
144-
target fileTree('.') {
145-
include '**/*.java'
146-
exclude '**/build/**', '**/build-*/**', '**/BUILD.java'
147-
}
148-
toggleOffOn()
149-
googleJavaFormat()
150-
removeUnusedImports()
151-
trimTrailingWhitespace()
152-
endWithNewline()
153-
}
154-
groovyGradle {
155-
target fileTree('.') {
156-
include '**/*.gradle'
157-
exclude '**/build/**', '**/build-*/**'
158-
}
159-
greclipse()
160-
indentWithSpaces(4)
161-
trimTrailingWhitespace()
162-
endWithNewline()
163-
}
164-
format 'xml', {
165-
target fileTree('.') {
166-
include '**/*.xml'
167-
exclude '**/build/**', '**/build-*/**'
168-
}
169-
eclipseWtp('xml')
170-
trimTrailingWhitespace()
171-
indentWithSpaces(2)
172-
endWithNewline()
173-
}
174-
format 'misc', {
175-
target fileTree('.') {
176-
include '**/*.md', '**/.gitignore'
177-
exclude '**/build/**', '**/build-*/**'
178-
}
179-
trimTrailingWhitespace()
180-
indentWithSpaces(2)
181-
endWithNewline()
182-
}
183-
}

simgui.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@
3232
}
3333
},
3434
"NetworkTables Info": {
35-
"Clients": {
35+
"Connections": {
36+
"open": true
37+
},
38+
"Server": {
39+
"Publishers": {
40+
"open": true
41+
},
3642
"open": true
3743
},
3844
"visible": true

src/main/java/frc/robot/Constants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
public final class Constants
2626
{
27-
public static final Mode currentMode = Mode.SIM;
27+
public static final Mode currentMode = Mode.REAL;
2828

2929
public static enum Mode {
3030
/** Running on a real robot. */
@@ -89,7 +89,7 @@ public static class PoseCameraConstants
8989
Units.inchesToMeters(-10.687),
9090
Units.inchesToMeters(16.129));
9191

92-
public static final String CAM2N = "W";
92+
public static final String CAM2N = "h";
9393
public static final Rotation3d CAM2R = new Rotation3d(0, 0, 0);
9494
public static final Translation3d CAM2T = new Translation3d(Units.inchesToMeters(-4.628),
9595
Units.inchesToMeters(-10.687),

src/main/java/frc/robot/subsystems/Swerve/SWERVEVision.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import edu.wpi.first.math.numbers.N3;
1616
import edu.wpi.first.wpilibj.smartdashboard.Field2d;
1717
import frc.robot.Robot;
18+
import frc.robot.Constants.Mode;
1819
import frc.robot.Constants.PoseCameraConstants;
1920

2021
import java.awt.Desktop;
@@ -35,6 +36,9 @@
3536
import org.photonvision.simulation.VisionSystemSim;
3637
import org.photonvision.targeting.PhotonPipelineResult;
3738
import org.photonvision.targeting.PhotonTrackedTarget;
39+
40+
import com.google.flatbuffers.Constants;
41+
3842
import swervelib.SwerveDrive;
3943
import swervelib.telemetry.Alert;
4044
import swervelib.telemetry.Alert.AlertType;
@@ -44,6 +48,11 @@
4448
* Example PhotonVision class to aid in the pursuit of accurate odometry. Taken from
4549
* https://gitlab.com/ironclad_code/ironclad-2024/-/blob/master/src/main/java/frc/robot/vision/Vision.java?ref_type=heads
4650
*/
51+
52+
53+
// THERE IS A VISIONENABLED VARIABLE IN SWERVE SUBSYTEM I PROMISE THIS FILE SHOULD NEVER CHANGE
54+
// THERE IS A VISIONENABLED VARIABLE IN SWERVE SUBSYTEM I PROMISE THIS FILE SHOULD NEVER CHANGE
55+
// THERE IS A VISIONENABLED VARIABLE IN SWERVE SUBSYTEM I PROMISE THIS FILE SHOULD NEVER CHANGE
4756
public class SWERVEVision
4857
{
4958

src/main/java/frc/robot/subsystems/Swerve/SwerveSubsystem.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class SwerveSubsystem extends SubsystemBase
6060
/**
6161
* Enable vision odometry updates while driving.
6262
*/
63-
private boolean visionEnabled = false;
63+
private boolean visionEnabled = true;
6464

6565
/**
6666
* Initialize {@link SwerveDrive} with the directory provided.
@@ -412,9 +412,16 @@ public void resetOdometry(Pose2d initialHolonomicPose)
412412
*
413413
* @return The robot's pose
414414
*/
415-
public Pose2d getPose()
415+
public Pose2d getPose()
416+
{
417+
return !visionEnabled ? io.swerveDrive.getPose() : getVisionPose();
418+
// return io.swerveDrive.getPose();
419+
// Made it simple, can still use getMesPose for the normal pose
420+
}
421+
public Pose2d getMesPose()
416422
{
417423
return io.swerveDrive.getPose();
424+
// use getPose() for the default pose
418425
}
419426

420427
/**

0 commit comments

Comments
 (0)