Skip to content

Commit

Permalink
[#297] - added accepted vision logging
Browse files Browse the repository at this point in the history
  • Loading branch information
HeeistHo committed Apr 15, 2023
1 parent 0b76865 commit cee7da8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/frc/robot/subsystems/Drivetrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public class Drivetrain extends SubsystemBase {
private boolean doVisionUpdate = true;
private double lastKnownGoodVisionX = 0;
private double lastKnownGoodVisionY = 0;
private double lastKnownGoodVisionRotation = 0;
private double lastTime = 0;

// Heading compenstaion variables
Expand Down Expand Up @@ -392,10 +393,12 @@ public void updateVision() {

lastKnownGoodVisionX = visionPose2d.getX();
lastKnownGoodVisionY = visionPose2d.getY();
lastKnownGoodVisionRotation = visionPose2d.getRotation().getDegrees();
lastTime = currTime;

LightningShuffleboard.setDouble("Drivetrain", "Accepted vision X", lastKnownGoodVisionX);
LightningShuffleboard.setDouble("Drivetrain", "Accepted vision Y", lastKnownGoodVisionY);
LightningShuffleboard.setDouble("Drivetrain", "Accepted vision Rotation", lastKnownGoodVisionRotation);
}
}

Expand Down

0 comments on commit cee7da8

Please sign in to comment.