Class LegacySwerveDrivetrain.OdometryThread

java.lang.Object
com.ctre.phoenix6.mechanisms.swerve.LegacySwerveDrivetrain.OdometryThread
Enclosing class:
LegacySwerveDrivetrain

public class LegacySwerveDrivetrain.OdometryThread extends Object
  • Field Details

    • START_THREAD_PRIORITY

      protected static final int START_THREAD_PRIORITY
      See Also:
    • m_thread

      protected final Thread m_thread
    • m_running

      protected volatile boolean m_running
    • m_allSignals

      protected final BaseStatusSignal[] 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.