Class LegacySwerveDrivetrain.OdometryThread
java.lang.Object
com.ctre.phoenix6.mechanisms.swerve.LegacySwerveDrivetrain.OdometryThread
- Enclosing class:
- LegacySwerveDrivetrain
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected doubleprotected intprotected intprotected doubleprotected final edu.wpi.first.math.filter.LinearFilterprotected final BaseStatusSignal[]protected booleanprotected final Threadprotected final edu.wpi.first.math.filter.MedianFilterprotected static final intprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidrun()voidsetThreadPriority(int priority) Sets the DAQ thread priority to a real time priority under the specified priority levelvoidstart()Starts the odometry thread.voidstop()Stops the odometry thread.voidstop(long millis) Stops the odometry thread with a timeout.
-
Field Details
-
START_THREAD_PRIORITY
protected static final int START_THREAD_PRIORITY- See Also:
-
m_thread
-
m_running
protected volatile boolean m_running -
m_allSignals
-
peakRemover
protected final edu.wpi.first.math.filter.MedianFilter peakRemover -
lowPass
protected final edu.wpi.first.math.filter.LinearFilter lowPass -
lastTime
protected double lastTime -
currentTime
protected double currentTime -
averageLoopTime
protected double averageLoopTime -
SuccessfulDaqs
protected int SuccessfulDaqs -
FailedDaqs
protected int FailedDaqs -
lastThreadPriority
protected int lastThreadPriority -
threadPriorityToSet
protected volatile int threadPriorityToSet
-
-
Constructor Details
-
OdometryThread
public OdometryThread()
-
-
Method Details
-
start
public void start()Starts the odometry thread. -
stop
public void stop()Stops the odometry thread. -
stop
public void stop(long millis) Stops the odometry thread with a timeout.- Parameters:
millis- The time to wait in milliseconds
-
run
public void run() -
odometryIsValid
public boolean odometryIsValid() -
setThreadPriority
public void setThreadPriority(int priority) Sets the DAQ thread priority to a real time priority under the specified priority level- Parameters:
priority- Priority level to set the DAQ thread to. This is a value between 0 and 99, with 99 indicating higher priority and 0 indicating lower priority.
-