| namespace frc971.vision; |
| |
| table Position { |
| x:double (id: 0); |
| y:double (id: 1); |
| z:double (id: 2); |
| } |
| |
| table Quaternion { |
| w:double (id: 0); |
| x:double (id: 1); |
| y:double (id: 2); |
| z:double (id: 3); |
| } |
| |
| // Represents 3d pose of an april tag on the field. |
| table TargetPoseFbs { |
| // AprilTag ID of this target |
| id:uint64 (id: 0); |
| |
| // Pose of target relative to either the field origin or camera. |
| // To get the pose of the target, do: |
| // Translation3d(position.x(), position.y(), position.z()) * |
| // Quaterniond(orientation.w(), orientation.x(), orientation.y(), orientation.z()) |
| position:Position (id: 1); |
| orientation:Quaternion (id: 2); |
| |
| // Minimum decision margin (confidence) for this april tag detection. |
| // Only filled out if this pose represents a live detection. |
| // NOTE: Detections with a decision margin less than |
| // FLAGS_min_decision_margin in aprilrobotics.cc are already filtered |
| // out before sending. |
| confidence:double (id: 3); |
| |
| // Object-space error of the tag from pose estimation. |
| // Only filled out if this pose represents a live detection. |
| // Tags which are seen completely usually have a pose_error < 1e-6, |
| // and a higher error could imply that part of the tag is being blocked. |
| // NOTE: not filtered by aprilrobotics.cc so that we can log |
| // more detections. |
| pose_error:double (id: 4); |
| |
| // A measure of how much distortion affected this detection. |
| // Only filled out if this pose represents a live detection. |
| // This is computed as the average distance between the distorted |
| // corners and undistorted corners, normalized by the image size |
| // and the maximum expected distortion to be between 0-1. |
| // NOTE: not filtered by aprilrobotics.cc so that we can log |
| // more detections. |
| distortion_factor:double (id: 5); |
| |
| // Ratio of pose_error from the best estimation to |
| // pose error of the second best estimation. |
| // Only filled out if this pose represents a live detection. |
| // This should be significantly less than 1, |
| // otherwise this pose may be a wrong solution. |
| // NOTE: not filtered by aprilrobotics.cc so that we can log |
| // more detections. |
| pose_error_ratio:double (id: 6); |
| } |
| |
| // Map of all target poses on a field. |
| // There are two possible uses for this: |
| // 1. Static april tag poses on the field solved for by TargetMapper. |
| // 2. List of detected april poses relative to the camera. |
| table TargetMap { |
| target_poses:[TargetPoseFbs] (id: 0); |
| |
| // Unique name of the field (for use case 1.) |
| field_name:string (id: 1); |
| |
| // End-of-frame timestamp for the frame with tag detections. |
| // (for use case 2.). |
| monotonic_timestamp_ns:int64 (id: 2); |
| |
| // Number of april tags rejected (cumulative) because |
| // of low decision margin (affected by lighting). |
| // We do the decision margin rejection in aprilrobotics |
| // so we don't have an excessive amount of random target |
| // detections (for use case 2). |
| rejections:uint64 (id: 3); |
| } |
| |
| root_type TargetMap; |