set Position
Send a position that the Pinpoint should use to track your robot relative to. You can use this to update the estimated position of your robot with new external sensor data, or to run a robot in field coordinates. This overrides the current position. Using this feature to track your robot's position in field coordinates: When you start your code, send a Pose2D that describes the starting position on the field of your robot. Say you're on the red alliance, your robot is against the wall and closer to the audience side, and the front of your robot is pointing towards the center of the field. You can send a setPosition with something like -600mm x, -1200mm Y, and 90 degrees. The pinpoint would then always keep track of how far away from the center of the field you are. Using this feature to update your position with additional sensors: Some robots have a secondary way to locate their robot on the field. This is commonly Apriltag localization in FTC, but it can also be something like a distance sensor. Often these external sensors are absolute (meaning they measure something about the field) so their data is very accurate. But they can be slower to read, or you may need to be in a very specific position on the field to use them. In that case, spend most of your time relying on the Pinpoint to determine your location. Then when you pull a new position from your secondary sensor, send a setPosition command with the new position. The Pinpoint will then track your movement relative to that new, more accurate position.
Parameters
a Pose2D describing the robot's new position.