blob: 42a012d379daf75356da90f229e2d6c275279a06 [file] [log] [blame]
Milind Upadhyaye2f40d72022-02-24 13:55:53 -08001include "y2022/vision/calibration.fbs";
2
milind-u92195982022-01-22 20:29:31 -08003namespace y2022.vision;
4
Henry Speisere45e7a22022-02-04 23:17:01 -08005struct Point {
6 x:int (id: 0);
7 y:int (id: 1);
8}
9
10table Blob {
11 points:[Point] (id: 0);
12}
13
14// Statistics for each blob used for filtering
15table BlobStatsFbs {
16 centroid:Point (id: 0);
17 aspect_ratio:double (id: 1);
18 area:double (id: 2);
19 num_points:uint64 (id: 3);
20}
21
22// Information for debugging blob detection
Milind Upadhyay25610d22022-02-07 15:35:26 -080023table BlobResultFbs {
Henry Speisere45e7a22022-02-04 23:17:01 -080024 // Blobs that passed the filtering step
25 filtered_blobs:[Blob] (id: 0);
26 // All detected blobs
27 unfiltered_blobs:[Blob] (id: 1);
28 // Stats on the blobs
29 blob_stats:[BlobStatsFbs] (id: 2);
Milind Upadhyayf61e1482022-02-11 20:42:55 -080030 // Centroids of filtered blobs
31 filtered_centroids:[Point] (id: 4);
Henry Speisere45e7a22022-02-04 23:17:01 -080032 // Average centroid of the filtered blobs
33 centroid:Point (id: 3);
34}
35
Milind Upadhyayf61e1482022-02-11 20:42:55 -080036// Euler angles rotation
37struct Rotation {
38 roll:double (id: 0);
39 pitch:double (id: 1);
40 yaw:double (id: 2);
41}
42
milind-u92195982022-01-22 20:29:31 -080043// Contains the information the EKF wants from blobs from a single image.
44table TargetEstimate {
45 // Horizontal distance from the camera to the center of the upper hub
46 distance:double (id: 0);
47 // Angle from the camera to the target (horizontal angle in rad).
Milind Upadhyayf61e1482022-02-11 20:42:55 -080048 // Positive means left of center, negative means right.
milind-u92195982022-01-22 20:29:31 -080049 angle_to_target:double (id: 1);
Milind Upadhyayf61e1482022-02-11 20:42:55 -080050 // Polar angle from target to camera (not rotation).
51 // Currently being frozen at 0
52 angle_to_camera:double (id: 3);
53 // Rotation of the camera in the hub's reference frame
54 rotation_camera_hub:Rotation (id: 4);
Milind Upadhyay14279de2022-02-26 16:07:53 -080055 // Confidence in the estimate from 0 to 1, based on the final solver cost.
56 // Good estimates currently have confidences of around 0.9 or greater.
57 confidence:double (id: 7);
milind-u92195982022-01-22 20:29:31 -080058
Milind Upadhyay25610d22022-02-07 15:35:26 -080059 blob_result:BlobResultFbs (id: 2);
Henry Speisere45e7a22022-02-04 23:17:01 -080060
Jim Ostrowski210765a2022-02-27 12:52:14 -080061 // Contains the duration between the epoch and the nearest point
62 // in time from when it was called.
Milind Upadhyayf61e1482022-02-11 20:42:55 -080063 image_monotonic_timestamp_ns:int64 (id: 5);
Jim Ostrowski210765a2022-02-27 12:52:14 -080064
Milind Upadhyaye2f40d72022-02-24 13:55:53 -080065 // Information about the camera which took this image.
Milind Upadhyayf61e1482022-02-11 20:42:55 -080066 camera_calibration:frc971.vision.calibration.CameraCalibration (id: 6);
milind-u92195982022-01-22 20:29:31 -080067}
milind-uf2f59aa2022-01-23 21:06:12 -080068
69root_type TargetEstimate;