Package frc.RebeLib.subsystems.drive
Class PhoenixOdometryThread
java.lang.Object
java.lang.Thread
frc.RebeLib.subsystems.drive.PhoenixOdometryThread
- All Implemented Interfaces:
Runnable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Method Summary
Modifier and TypeMethodDescriptionstatic PhoenixOdometryThread
Returns a new queue that returns timestamp values for each sample.registerSignal
(com.ctre.phoenix6.StatusSignal<edu.wpi.first.units.measure.Angle> signal) Registers a Phoenix signal to be read from the thread.registerSignal
(DoubleSupplier signal) Registers a generic signal to be read from the thread.void
run()
void
start()
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
Method Details
-
getInstance
-
start
public void start() -
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
Registers a generic signal to be read from the thread. -
makeTimestampQueue
Returns a new queue that returns timestamp values for each sample. -
run
public void run()
-