WPILib field coordinate systems
These methods return the robot’s pose relative to a fixed field origin.WPILib Blue Alliance (recommended)
Origin at the blue alliance wall. This is the preferred frame because it does not flip when the alliance assignment changes between matches.WPILib Red Alliance
Origin at the red alliance wall. Not recommended as your primary odometry frame.Field-centric (legacy)
Origin at the center of the field. Not WPILib-standard. Use the_wpiBlue or _wpiRed variants instead.
Relative coordinate spaces
These methods return pose data relative to a moving reference — useful for target tracking and alignment, not for field localization.Target space
Pose expressed relative to the currently tracked target’s coordinate frame.Camera space
Pose expressed relative to the camera’s coordinate frame.Robot space
Pose expressed relative to the robot’s coordinate frame.Pose array format
All raw pose data from NetworkTables is returned as a 6-elementdouble[] array:
x,y,z— translation in metersroll,pitch,yaw— rotation angles in degrees
toPose3D and toPose2D to convert these arrays to WPILib geometry objects:
Pose2d when integrating with WPILib’s SwerveDrivePoseEstimator or DifferentialDrivePoseEstimator via addVisionMeasurement. Use Pose3d when you need full 3D pose information, such as for robots that pitch or roll significantly.
Extended botpose arrays
The botpose arrays (botpose_wpiblue, botpose_orb_wpiblue, etc.) contain additional metadata beyond the 6 pose values. The getBotPoseEstimate_* methods parse this automatically into a PoseEstimate object, but you can also read the raw array directly:
| Index | Field | Description |
|---|---|---|
| 0–5 | x, y, z, roll, pitch, yaw | Robot pose |
| 6 | latency | Total pipeline + capture latency in ms |
| 7 | tagCount | Number of tags used in the pose solve |
| 8 | tagSpan | Distance between the outermost tags used, in meters |
| 9 | avgTagDist | Average distance to all tags used, in meters |
| 10 | avgTagArea | Average tag area as a percentage of the image |
| 11+ | Per-fiducial data | 7 values per tag: id, txnc, tync, ta, distToCamera, distToRobot, ambiguity |
getBotPoseEstimate family of methods reads this layout directly:
addVisionMeasurement is already computed for you in estimate.timestampSeconds — it subtracts latency from the server-side NetworkTables timestamp.