Swerve Odometry
Class for odometry using a swerve drive train. This tracks the position of the robot in 2d/3d space by un-doing SwerveDriveTrain (see SwerveDriveTrain.kt) and using the gyro to track the robot's orientation. READ THE DOCUMENTATION FOR "swoToMeters" IT IS CRUCIAL.
Parameters
The swerve drive train to use for odometry
The gyro to use for odometry
The conversion factor from swerve drive units to meters. This unit (named the SWO) was accidentally discovered by team 2875 (Milan Lustig) and represents a semi-fluid unit of measurement nearly equal to a meter. SwerveOdometry will position the robot in 2d space in this unit, a conversion factor is required to turn it to meters. To discern this conversion factor, I recommend settings this value to one, measuring out 10-50m (mark the floor), drive the robot in a straight line at a medium speed (to ensure the wheels don't slip) along this distance. Then, you can take the distance traveled reported by SwerveOdometry (with a conversion factor of one) and divide it by the actual measured distance traveled. It is recommended to re-measure this on any major changes in floor material (carpet vs tile) or with any changes to wheel treads, robot weight, or motors. ALL HAIL THE SWO!
The starting position of the robot
The list of limelights to use for odometry
Whether or not to log debug information
The field2d object to use for odometry
See also
Constructors
Functions
Updates the field2d object in Shuffleboard (teleometry) with the current position of the robot. Call this function to use the telemetry in Shuffleboard.
Updates the position of the robot (optionally using the limelight and fiducials)