Class SwerveDrivetrain.OdometryThread
java.lang.Object
com.ctre.phoenix6.mechanisms.swerve.SwerveDrivetrain.OdometryThread
- Enclosing class:
- SwerveDrivetrain
public class SwerveDrivetrain.OdometryThread extends Object
-
Field Summary
Fields Modifier and Type Field Description protected double
averageLoopTime
protected double
currentTime
protected int
FailedDaqs
protected int
lastThreadPriority
protected double
lastTime
protected LinearFilter
lowPass
protected BaseStatusSignal[]
m_allSignals
protected boolean
m_running
protected Thread
m_thread
protected MedianFilter
peakRemover
protected static int
START_THREAD_PRIORITY
protected int
SuccessfulDaqs
protected int
threadPriorityToSet
-
Constructor Summary
Constructors Constructor Description OdometryThread()
-
Method Summary
Modifier and Type Method Description boolean
odometryIsValid()
void
run()
void
setThreadPriority(int priority)
Sets the DAQ thread priority to a real time priority under the specified priority levelvoid
start()
Starts the odometry thread.void
stop()
Stops the odometry thread.void
stop(long millis)
Stops the odometry thread with a timeout.
-
Field Details
-
Constructor Details
-
OdometryThread
public OdometryThread()
-
-
Method Details
-
start
Starts the odometry thread. -
stop
Stops the odometry thread. -
stop
Stops the odometry thread with a timeout.- Parameters:
millis
- The time to wait in milliseconds
-
run
-
odometryIsValid
-
setThreadPriority
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.
-