Skip to content

Commit

Permalink
Merge pull request #109 from frc-862/use-timestamped-pose
Browse files Browse the repository at this point in the history
Use the timestamp now stored in Pose4d (be sure and update Thunder first)
  • Loading branch information
MattD8957 authored Jan 27, 2024
2 parents dab11e6 + 25f4776 commit 0b64990
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/frc/robot/subsystems/Swerve.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,8 @@ public void simulationPeriodic() {

@Override
public void periodic() {
for (Limelight limelight : Limelight.filterLimelights(limelights)) {
Pose4d pose = limelight.getAlliancePose();
addVisionMeasurement(pose.toPose2d(),
Timer.getFPGATimestamp() - Units.millisecondsToSeconds(pose.getLatency())
- VisionConstants.PROCESS_LATENCY);
for (Pose4d pose : Limelight.filteredPoses(limelights)) {
addVisionMeasurement(pose.toPose2d(), pose.getFPGATimestamp());
}

LightningShuffleboard.setDouble("Swerve", "Robot Heading", getPigeon2().getAngle());
Expand Down

0 comments on commit 0b64990

Please sign in to comment.