Deadwheel Odometry (Mecanum and Tank)
Resources
GM0's Odometry Page - Must Read! (Explains deadwheel configurations and provides easy to implement pseudocode + a overview behind the for 3 wheel odometry)
RoadRunner's Odometry Paper - Will be a bit hard to understand without linear algebra knowledge.
Deadwheel odometry makes use of unpowered wheels connected to encoders to track the robot's current position. Essentially, a deadwheel odometry algorithm converts the returned encoder measurements into useful values.
For maximized accuracy, most teams make use of three deadwheel setups. However if a team needs an extra encoder slot, some will make do with a two-deadwheel setup and the IMU for angle calculation.
Why use 3-wheel odometry as opposed to 2-wheel: Answered in RoadRunner Docs
2 Deadwheel Odometry
Intuitively speaking, we know that a mecanum drive train can move both forward and sideways. Therefore when making use of a two-wheel odometry setup we can see that you only need to use one of the parallel wheels.
Note that because we are removing one of the parallel wheels, you cannot calculate the robot's current angle through odometry alone. Instead, you must make use of the IMU.
3 Deadwheel Odometry
Due to the extensive explanations written in the links provided at the top of the module, we feel that it would be redundant to provide our own. Instead, we will just give you an implementation.
The following code is from the samples of Beta8397's virtual robot simulator: https://github.com/Beta8397/virtual_robot/blob/master/TeamCode/src/org/firstinspires/ftc/teamcode/EncBot.java
Last updated