Skip to content

Commit

Permalink
w changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeful committed Sep 20, 2024
1 parent 4461705 commit a945add
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main/java/frc/robot/subsystems/vision/VisionSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,18 @@ public PoseEstimate enabledPoseUpdate(int limelightNumber) {
// Soon to be implemented code:
if (canSeeAprilTags(limelightNumber) && isValidPoseEstimate(limelightNumber)) {
if (isLargeDiscrepancyBetweenMegaTag1And2(limelightNumber)
&& getLimelightAprilTagDistance(limelightNumber) <
VisionConstants.MEGA_TAG_2_DISTANCE_THRESHOLD) {
&& getLimelightAprilTagDistance(limelightNumber)
< VisionConstants.MEGA_TAG_2_DISTANCE_THRESHOLD) {
return limelightEstimates[limelightNumber] = getMegaTag1PoseEstimate(limelightNumber);
} else if (headingRateDegreesPerSecond < VisionConstants.MEGA_TAG_2_MAX_HEADING_RATE) {
LimelightHelpers.SetRobotOrientation(
getLimelightName(limelightNumber), headingDegrees, 0, 0, 0, 0, 0);
return limelightEstimates[limelightNumber] = getMegaTag2PoseEstimate(limelightNumber);
} else {
return limelightEstimates[limelightNumber] = getMegaTag1PoseEstimate(limelightNumber);
}
LimelightHelpers.SetRobotOrientation(
getLimelightName(limelightNumber), headingDegrees, 0, 0, 0, 0, 0);
return limelightEstimates[limelightNumber] = getMegaTag2PoseEstimate(limelightNumber);
} else {
return limelightEstimates[limelightNumber] = getMegaTag1PoseEstimate(limelightNumber);
}
}
return new PoseEstimate();
}

/**
Expand Down

0 comments on commit a945add

Please sign in to comment.