Class SwerveDrivetrain.OdometryThread

java.lang.Object
com.ctre.phoenix6.swerve.SwerveDrivetrain.OdometryThread
Enclosing class:
SwerveDrivetrain<DriveMotorT extends CommonTalon, SteerMotorT extends CommonTalon, EncoderT extends ParentDevice>

public class SwerveDrivetrain.OdometryThread extends Object
Performs swerve module updates in a separate thread to minimize latency.
  • Constructor Details

    • OdometryThread

      public OdometryThread()
  • Method Details

    • start

      public final void start()
      Starts the odometry thread.
    • stop

      public final void stop()
      Stops the odometry thread.
    • isOdometryValid

      public boolean isOdometryValid()
      Check if the odometry is currently valid.
      Returns:
      True if odometry is valid
    • setThreadPriority

      public final void setThreadPriority(int priority)
      Sets the odometry thread priority to a real time priority under the specified priority level
      Parameters:
      priority - Priority level to set the odometry thread to. This is a value between 0 and 99, with 99 indicating higher priority and 0 indicating lower priority.