Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.

Commit f065e72

Browse files
committed
final changes from storm surge
1 parent 318b61e commit f065e72

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain

src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/AbsolutePose.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)