Skip to content

Commit

Permalink
Fix high freq odometry bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vichik123 committed Feb 13, 2024
1 parent 273b361 commit 001e565
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/swerve/SwerveDrive.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ public double[] getHighFreqTimeStamps() {
}

public void updateHighFreqPose() {
highFreqModulePositions.clear();
int sampleCount = Integer.MAX_VALUE;
for (int i = 0; i < 4; i++) {
sampleCount = Math.min(sampleCount, modules[i].getHighFreqAngles().length);
Expand All @@ -162,8 +163,7 @@ public void updateHighFreqPose() {
modules[moduleIndex].getHighFreqDriveDistances()[sampleIndex],
Rotation2d.fromRadians(
modules[moduleIndex].getHighFreqAngles()[sampleIndex]));
highFreqModulePositions.get(sampleIndex)[moduleIndex] =
tempHighFreqModulePositions[moduleIndex];
highFreqModulePositions.add(tempHighFreqModulePositions);
}
poseEstimator.updatePose();
botPose = poseEstimator.getEstimatedPose();
Expand Down

0 comments on commit 001e565

Please sign in to comment.