James Kuszmaul | 5ff8a86 | 2021-09-25 17:29:43 -0700 | [diff] [blame] | 1 | namespace y2020.control_loops.drivetrain; |
| 2 | |
| 3 | enum RejectionReason : byte { |
| 4 | IMAGE_FROM_FUTURE = 0, |
| 5 | NO_CALIBRATION = 1, |
| 6 | TURRET_TOO_FAST = 2, |
| 7 | NO_RESULTS = 3, |
| 8 | NO_TRANSFORMS = 4, |
| 9 | HIGH_THETA_DIFFERENCE = 5, |
| 10 | IMAGE_TOO_OLD = 6, |
| 11 | NONFINITE_MEASUREMENT = 7, |
| 12 | CORRECTION_TOO_LARGE = 8, |
James Kuszmaul | a3d1cd1 | 2021-10-23 22:30:45 -0700 | [diff] [blame^] | 13 | MESSAGE_BRIDGE_DISCONNECTED = 9, |
James Kuszmaul | 5ff8a86 | 2021-09-25 17:29:43 -0700 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | table ImageMatchDebug { |
| 17 | camera:uint8 (id: 0); |
| 18 | pose_index: uint8 (id: 1); |
| 19 | local_image_capture_time_ns:long (id: 2); |
| 20 | roborio_image_capture_time_ns:long (id: 3); |
James Kuszmaul | f75ecd6 | 2021-10-23 14:33:46 -0700 | [diff] [blame] | 21 | camera_x:float (id: 11); |
| 22 | camera_y:float (id: 12); |
| 23 | camera_theta:float (id: 13); |
James Kuszmaul | 5ff8a86 | 2021-09-25 17:29:43 -0700 | [diff] [blame] | 24 | implied_robot_x:float (id: 4); |
| 25 | implied_robot_y:float (id: 5); |
| 26 | implied_robot_theta:float (id: 6); |
| 27 | implied_turret_goal:float (id: 7); |
| 28 | accepted:bool (id: 8); |
| 29 | rejection_reason:RejectionReason (id: 9); |
| 30 | // Image age (more human-readable than trying to interpret roborio_image_capture_time_ns). |
| 31 | image_age_sec:float (id: 10); |
| 32 | } |
| 33 | |
James Kuszmaul | f75ecd6 | 2021-10-23 14:33:46 -0700 | [diff] [blame] | 34 | table CumulativeStatistics { |
| 35 | total_accepted:int (id: 0); |
| 36 | total_candidates:int (id: 1); |
| 37 | // Indexed by integer value of RejectionReason enum. |
| 38 | rejection_reason_count:[int] (id: 2); |
| 39 | } |
| 40 | |
James Kuszmaul | 5ff8a86 | 2021-09-25 17:29:43 -0700 | [diff] [blame] | 41 | table LocalizerDebug { |
| 42 | matches:[ImageMatchDebug] (id: 0); |
James Kuszmaul | f75ecd6 | 2021-10-23 14:33:46 -0700 | [diff] [blame] | 43 | statistics:CumulativeStatistics (id: 1); |
James Kuszmaul | 5ff8a86 | 2021-09-25 17:29:43 -0700 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | root_type LocalizerDebug; |