Class PhoenixOdometryThread
java.lang.Object
java.lang.Thread
com.stuypulse.robot.subsystems.swerve.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 Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<DoubleSupplier> private static PhoenixOdometryThreadprivate static booleanprivate final List<com.ctre.phoenix6.BaseStatusSignal> private final LockFields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PhoenixOdometryThreadReturns a new queue that returns timestamp values for each sample.registerSignal(com.ctre.phoenix6.StatusSignal<org.wpilib.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.voidrun()voidstart()Methods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, stop, threadId, toString, yield
-
Field Details
-
signalsLock
-
phoenixSignals
-
genericSignals
-
phoenixQueues
-
genericQueues
-
timestampQueues
-
isCANFD
-
instance
-
-
Constructor Details
-
PhoenixOdometryThread
private PhoenixOdometryThread()
-
-
Method Details
-
getInstance
-
start
-
registerSignal
public Queue<Double> registerSignal(com.ctre.phoenix6.StatusSignal<org.wpilib.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
-