From b23c2ba65a5b3ec56e7e3c0adab97fff081fc24d Mon Sep 17 00:00:00 2001 From: Vignesh Balasubramaniam Date: Wed, 18 Sep 2024 19:32:15 -0500 Subject: [PATCH] Run input thread for IMUs --- .../lasarobotics/hardware/ctre/Pigeon2.java | 24 ++++++++++++++++++- .../hardware/kauailabs/NavX2.java | 7 +++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/lasarobotics/hardware/ctre/Pigeon2.java b/src/main/java/org/lasarobotics/hardware/ctre/Pigeon2.java index 33f3132d..7187fea5 100644 --- a/src/main/java/org/lasarobotics/hardware/ctre/Pigeon2.java +++ b/src/main/java/org/lasarobotics/hardware/ctre/Pigeon2.java @@ -17,8 +17,10 @@ import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.units.Angle; import edu.wpi.first.units.Measure; +import edu.wpi.first.units.Time; import edu.wpi.first.units.Units; import edu.wpi.first.units.Velocity; +import edu.wpi.first.wpilibj.Notifier; /** CTRE Pigeon 2.0 */ public class Pigeon2 extends LoggableHardware { @@ -60,6 +62,11 @@ public static class Pigeon2Inputs { public Rotation2d rotation2d = GlobalConstants.ROTATION_ZERO; } + private int DEFAULT_THREAD_PERIOD = 10; + + private Notifier m_inputThread; + private Measure