This repository was archived by the owner on Oct 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,6 +127,8 @@ class LimelightPoseProvider(
127127
128128 private var currentAlgorithm: LimelightAlgorithm = LimelightAlgorithm .MegaTag
129129
130+ private var isDefaultPipelineActive = true
131+
130132 init {
131133 thread(isDaemon = true ) {
132134 while (true ) {
@@ -187,6 +189,14 @@ class LimelightPoseProvider(
187189 val highSpeed = algorithm.gyroVelocity.abs(DegreesPerSecond ) > 720.0
188190 if (estimate.tagCount == 0 || highSpeed) return measurement
189191
192+ if (estimate.rawFiducials[0 ]!! .distToCamera <= 1 .meters && isDefaultPipelineActive) {
193+ LimelightHelpers .setPipelineIndex(name, 1 )
194+ isDefaultPipelineActive = false
195+ } else if (estimate.rawFiducials[0 ]!! .distToCamera > 1 .meters && ! isDefaultPipelineActive) {
196+ LimelightHelpers .setPipelineIndex(name, 0 )
197+ isDefaultPipelineActive = true
198+ }
199+
190200 measurement.poseMeasurement = AbsolutePoseMeasurement (
191201 estimate.pose,
192202 estimate.timestampSeconds.seconds,
You can’t perform that action at this time.
0 commit comments