Robot Localization - Dutton-Christian-Robotics/Learning-to-Code GitHub Wiki
Overview
Localization is all about knowing where your robot is. There are several ways we could think of this:
- Robot-Centric: coordinates that are relative to where the robot was at a particular point in time, such as the start of the opmode.
- Field-Centric: a set of stable coordinates that don't change based on where a robot started and instead are based on the robot's position on the field. For FTC, the "origin" (the point where x=0 and y=0) is the center of the field. As a side note, FRC competitions don't always follow this system.
Possible Field Orientations
The easiest way to think about coordinates is in relationship to which sides of the field "belong" to the red and blue alliance--either in terms of which portion of the field each alliance controls in auton, or where the red and blue alliance stations are adjacent to the field.
Unfortunately, each year's game can change where these areas are.
- For INTO THE DEEP, the red alliance station was to the right as seen from the audience, and the blue alliance station to the left. Each alliance's portion of the field was a rectangle adjacent to their station.
- For DECODE, the alliances stations were swapped. The red alliance station was to the left, as seen from the audience, and the blue alliance station to the right. Each alliance's portion of the field was still a rectangle, but each was across the field from their alliance station instead of adjacent (perhaps this made it easier to see your own robot in scoring position since the goal's vertical height could block certain angles?).
- For FIRST RES-Q, a diamond-orientation was used. The field itself was rotated 45ยบ so that the "audience" direction was a corner, not a side of the field. The red alliance station was at the audience's right on the "upstage" side of the field, and the blue alliance station was to the audience's left on the "upstage" side. In this configuration, the two alliance stations were not opposite each other as is usual. And in this configuration, each alliance's portion of the field was a right triangle whose hypotenuse was the field diagonal running from the upstage corner down to the audience corner, adjacent to the alliance station.
Field-Centric Coordinates
Unfortunately, the alignment of the coordinate system can vary from year to year.
- The origin in the FTC field coordinate system is the center of the field. Note that it appears FRC does not follow this.
- FTC field coordinates have the side-to-side axis (perpendicular to the alliance walls) as the Y axis. At least for me, this is counter intuitive. Usually, positive numbers head from the origin towards the blue alliance side.
- The X axis runs perpendicular to the "audience" wall and the upstage wall. Usually values increase positively towards the audience. Note that for DECODE, the field axes were rotated 180 degrees, so that positive X was towards upstage. For BIOBUZZ normal axes order has been restored.