Want to know how to choose the best odometry for your robot? This blog can help you precisely navigate through the pros and cons of each odometry pod on the market.
What is Odometry?
Odometry is when your robot has the ability to have positional awareness on the field, at all times. This can usually be done with the encoders in your motors, which count the rotations pretty well. However, with the use of mecanum wheels, which allow you to strafe, your wheels slip a lot, which accumulates an offset overtime. This decreases the precision of motor encoders by a lot. What doesn’t slip are called dead wheels. Dead wheels are unpowered omni-wheels that are used for counting revolutions and odometry. If you combine a dead wheel and an encoder, you make what we call an odometry pod. With three of these (three wheel odometry), you can have a very accurate and reliable localization system to use for your autonomous, and even tele-op.
For more info, check out GM0: https://gm0.org/en/latest/docs/software/concepts/odometry.html?highlight=odometry#
Options
Now that we have a clear understanding of the components, let's go through the options you have.
COTS pods:
Pros:
Easy Mounting
Very Easy to Use
High Accuracy
COTS (Little Assembly Needed)
Cons:
Slightly Expensive
Pros:
Great Price
Quick Shipping
COTS (Little Assembly Needed)
Cons:
Linear Springing
Hard to Mount w/ Custom DT
Not Much Documentation
Open Source pods:
Pros:
Great Documentation
Easy to Use
Easy Mounting
Configurable
Comes in metal as well (Metal OpenOdo)
Cons:
Needs 3D Printer or CNC for metal (You can contact them for help with printing)
REV Encoders have drift
Pros:
Great Documentation
Easy to Use
Easy Mounting
Cons:
Needs 3D Printer
REV Encoders have drift
Pros:
Straight-Forward Design
Cons:
Little Documentation
Hard to Mount
Linear Springing
Needs 3D Printer
Encoders:
Odometry Psuedocode (cred: GM0)
while robot_is_active():
delta_left_encoder_pos = left_encoder_pos - prev_left_encoder_pos
delta_right_encoder_pos = right_encoder_pos - prev_right_encoder_pos
delta_center_encoder_pos = center_encoder_pos - prev_center_encoder_pos
phi = (delta_left_encoder_pos - delta_right_encoder_pos) / trackwidth
delta_middle_pos = (delta_left_encoder_pos + delta_right_encoder_pos) / 2
delta_perp_pos = delta_center_encoder_pos - forward_offset * phi
delta_x = delta_middle_pos * cos(heading) - delta_perp_pos * sin(heading)
delta_y = delta_middle_pos * sin(heading) + delta_perp_pos * cos(heading)
x_pos += delta_x
y_pos += delta_y
heading += phi
prev_left_encoder_pos = left_encoder_pos
prev_right_encoder_pos = right_encoder_pos
prev_center_encoder_pos = center_encoder_pos
For a thorough explanation of how to code odometry, check out Roadrunner:
Conclusion
Ultimately, choosing your odometry mainly depends on your drivetrain and preferences. Personally, I’d recommend GoBILDA for newer teams, as it is a COTS product (commercial off the shelf). It is very easy to mount, use, code, and work with overall. If you are a more experienced team, or want to try something new, I’d recommend OpenOdo or LoonyOdo. Firstly, OpenOdo is great as it is versatile for all drivetrains. The configurability and clear guides allow for easy usage on all robots. If you can’t decide which one fits your robot, it’s OpenOdo. However, if you want something very simple, compact, and straight-forward, I’d go with LoonyOdo. LoonyOdo is slightly harder to work with than OpenOdo, but still gives a great foundation for people to begin implementing odometry. If you have any more questions, head to GM0, or ask in the FTC discord. Good luck choosing your odometry, and have fun building your robot!