Class SwerveDrivetrain.OdometryThread
java.lang.Object
com.ctre.phoenix6.swerve.SwerveDrivetrain.OdometryThread
- Enclosing class:
SwerveDrivetrain<DriveMotorT extends CommonTalon, SteerMotorT extends CommonTalon, EncoderT extends ParentDevice>
Performs swerve module updates in a separate thread to minimize latency.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the odometry is currently valid.final voidsetThreadPriority(int priority) Sets the odometry thread priority to a real time priority under the specified priority levelfinal voidstart()Starts the odometry thread.final voidstop()Stops the odometry thread.
-
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.
-