my team was trying to set up odometry and was wondering if the tracking wheel that is perpindicular to the drive wheels should rotate when we are turning the robot.
yes it should rotate. you can use it to help find your rotation but I would suggest using the gyro for that.
The perpendicular wheel is not used for heading calculations, so it is not necessary for it to turn while spinning. However, the only scenario when it should not spin is if the robot’s center of rotation is exactly centered on the wheel. If the ground underneath the wheel is moving relative to it, it should be turning.
Your perpendicular can be spinning while the robot is spinning. All you really need to do is filter out the robot’s spinning in the equation:
Perpendicular Filtered = Perpendicular Encoder - (Right Encoder - Left Encoder) * C
Where C is some constant