Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
Fixed camera feeds on shuffleboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Arrowbotics3482 committed Jul 31, 2024
1 parent a40eb11 commit 0a4c125
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/frc/robot/vision/VisionSubsystem.java
Original file line number Diff line number Diff line change
@@ -71,9 +71,6 @@ private VisionSubsystem() {
LimelightConstants.BACK_APRIL_TAG_LL,
"http://" + LimelightConstants.BACK_APRIL_TAG_LL + ".local:5800/stream.mjpg"
);

CameraServer.addCamera(frontLLCamera);
CameraServer.addCamera(backLLCamera);

Shuffleboard.getTab(ShuffleboardTabNames.DEFAULT)
.add(LimelightConstants.FRONT_APRIL_TAG_LL, frontLLCamera)
@@ -196,13 +193,13 @@ private LimelightData[] getFilteredLimelightData(boolean useStored) {
// Returns the data with the greater tag count.
// Will only return the data if it has the same heartbeat as just captured (if it doesn't,
// this means the data was retrieved from this.limelightDatas and not during this loop).
if (((useStored && frontLLDataMT2 != null) || this.lastHeartbeatFrontLL == heartbeatFrontLL)
if ((frontLLDataMT2 != null && (useStored || this.lastHeartbeatFrontLL == heartbeatFrontLL))
&& (backLLDataMT2 == null
|| backLLDataMT2.avgTagDist > LimelightConstants.TRUST_TAG_DISTANCE
|| frontLLDataMT2.tagCount > backLLDataMT2.tagCount)) {
return new LimelightData[]{ this.limelightDatas[0] };
}
else if (((useStored && backLLDataMT2 != null) || this.lastHeartbeatBackLL == heartbeatBackLL)
else if ((backLLDataMT2 != null && (useStored || this.lastHeartbeatBackLL == heartbeatBackLL))
&& (frontLLDataMT2 == null
|| frontLLDataMT2.avgTagDist > LimelightConstants.TRUST_TAG_DISTANCE
|| backLLDataMT2.tagCount > frontLLDataMT2.tagCount)) {

0 comments on commit 0a4c125

Please sign in to comment.