# Track Width Tuning
Your localizer's heading measurements should be accurate prior to tuning this. If you're using a 3-wheel localizer, this means tuning the lateral distance. Otherwise, the heading should come directly from the IMU.
This is a fairly verbose clarification of the term track width as its use different contexts can be confusing.
Track width is simply the center-to-center distance from two parallel wheels. However, there are two types of track width that you may see.
The track width in your
DriveConstants.java refers to the track width of the drive train.
However in the context of dead wheel odometry, track width is the center-to-center distance of the two parallel wheels. This only applies to three-wheel odometry. The track width for three-wheel odometry refers to the same thing as
We are not touching the localizer at the moment, thus any references to track width on this page will refer to the drive train track width (located in
The track width for the drive train is used for the forward kinematics for feedforward following.
The track width for three-wheel odometry (aka
lateralDistance) is used for localization.
You should have already tuned localization. Right now, you will be tuning the drive train.
- Run the
TrackWidthTuneropmode via the RC.
- Your bot should turn 180 degrees 5 times.
- Don't touch the bot during the tuning process.
- At the end of the tuning, the RC's telemetry should print an "effective track width".
- If this number sounds reasonable (close to the actual physical track width, might be a few inches off), stick this number in your
- If you have FTC Dashboard open, you can change the track width in the variable configuration sidebar (on the right) to test your values. You may need to run the tuner a few times so this makes it a lot easier as you don't have to change the constants file and re-compile/re-upload the app to test values.
- The bot should be turning close to 180 degrees every time once tuned.
- If you bot runs into the following issues, you will have to tune manually:
- It does not turn 180 degrees each time, even with tuning
- The effective track width given does not print something reasonable (most likely a low number like 3)
- This is generally caused by failing to put an initial estimate in the drive constants file and leaving the track width at 1.
- To tune the track width manually, simply keep adjusting the track width yourself until it turns 180 degrees. If the the bot turns less than 180 degrees, raise the trackwidth. If the bot turns more than 180 degrees, lower the trackwidth.