Class PhoenixOdometryThread

java.lang.Object
java.lang.Thread
frc.RebeLib.subsystems.drive.PhoenixOdometryThread
All Implemented Interfaces:
Runnable

public class PhoenixOdometryThread extends Thread
Provides an interface for asynchronously reading high-frequency measurements to a set of queues.

This version is intended for Phoenix 6 devices on both the RIO and CANivore buses. When using a CANivore, the thread uses the "waitForAll" blocking method to enable more consistent sampling. This also allows Phoenix Pro users to benefit from lower latency between devices using CANivore time synchronization.

  • Method Details

    • getInstance

      public static PhoenixOdometryThread getInstance()
    • start

      public void start()
      Overrides:
      start in class Thread
    • registerSignal

      public Queue<Double> registerSignal(com.ctre.phoenix6.StatusSignal<edu.wpi.first.units.measure.Angle> signal)
      Registers a Phoenix signal to be read from the thread.
    • registerSignal

      public Queue<Double> registerSignal(DoubleSupplier signal)
      Registers a generic signal to be read from the thread.
    • makeTimestampQueue

      public Queue<Double> makeTimestampQueue()
      Returns a new queue that returns timestamp values for each sample.
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread