Skip to content

Commit

Permalink
fix profiler breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonwatson committed Sep 26, 2024
1 parent 0db7fcb commit 7458b7c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/subsystems/swerve/Swerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public void periodic() {
swerveOdometry.resetPosition(getGyroYaw(), getModulePositions(),
robotPose.get().robotPose);
hasInitialized = true;
Robot.profiler.pop();
break;
}
Robot.profiler.pop();
Expand All @@ -288,9 +289,11 @@ public void periodic() {
var result = cameras[i].getEstimatedGlobalPose(getPose());
if (result.isPresent()) {
if (DriverStation.isAutonomous() && result.get().targetsUsed.size() < 2) {
Robot.profiler.pop();
continue;
} else if (result.get().targetsUsed.size() == 1
&& result.get().targetsUsed.get(0).getPoseAmbiguity() > 0.1) {
Robot.profiler.pop();
continue;
}
swerveOdometry.addVisionMeasurement(result.get().estimatedPose.toPose2d(),
Expand Down

0 comments on commit 7458b7c

Please sign in to comment.