Milind Upadhyay | e2f40d7 | 2022-02-24 13:55:53 -0800 | [diff] [blame^] | 1 | include "y2022/vision/calibration.fbs"; |
| 2 | |
milind-u | 9219598 | 2022-01-22 20:29:31 -0800 | [diff] [blame] | 3 | namespace y2022.vision; |
| 4 | |
Henry Speiser | e45e7a2 | 2022-02-04 23:17:01 -0800 | [diff] [blame] | 5 | struct Point { |
| 6 | x:int (id: 0); |
| 7 | y:int (id: 1); |
| 8 | } |
| 9 | |
| 10 | table Blob { |
| 11 | points:[Point] (id: 0); |
| 12 | } |
| 13 | |
| 14 | // Statistics for each blob used for filtering |
| 15 | table 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 Upadhyay | 25610d2 | 2022-02-07 15:35:26 -0800 | [diff] [blame] | 23 | table BlobResultFbs { |
Henry Speiser | e45e7a2 | 2022-02-04 23:17:01 -0800 | [diff] [blame] | 24 | // 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); |
| 30 | // Average centroid of the filtered blobs |
| 31 | centroid:Point (id: 3); |
| 32 | } |
| 33 | |
milind-u | 9219598 | 2022-01-22 20:29:31 -0800 | [diff] [blame] | 34 | // Contains the information the EKF wants from blobs from a single image. |
| 35 | table TargetEstimate { |
| 36 | // Horizontal distance from the camera to the center of the upper hub |
| 37 | distance:double (id: 0); |
| 38 | // Angle from the camera to the target (horizontal angle in rad). |
| 39 | // Positive means right of center, negative means left. |
| 40 | angle_to_target:double (id: 1); |
| 41 | |
Milind Upadhyay | 25610d2 | 2022-02-07 15:35:26 -0800 | [diff] [blame] | 42 | blob_result:BlobResultFbs (id: 2); |
Henry Speiser | e45e7a2 | 2022-02-04 23:17:01 -0800 | [diff] [blame] | 43 | |
Milind Upadhyay | e2f40d7 | 2022-02-24 13:55:53 -0800 | [diff] [blame^] | 44 | // Information about the camera which took this image. |
| 45 | camera_calibration:frc971.vision.calibration.CameraCalibration (id: 3); |
milind-u | 9219598 | 2022-01-22 20:29:31 -0800 | [diff] [blame] | 46 | } |
milind-u | f2f59aa | 2022-01-23 21:06:12 -0800 | [diff] [blame] | 47 | |
| 48 | root_type TargetEstimate; |