blob: ff25c31b3d79f093d9d9de3d1a251f50891f0c66 [file] [log] [blame]
James Kuszmaulef35d732022-02-12 16:37:32 -08001namespace frc971.controls;
2
3// This provides a minimal output from the localizer that can be forwarded to
4// the roborio and used for corrections to its (simpler) localizer.
5
James Kuszmaul10d3fd42022-02-25 21:57:36 -08006struct Quaternion {
7 w:double (id: 0);
8 x:double (id: 1);
9 y:double (id: 2);
10 z:double (id: 3);
11}
12
Milind Upadhyayd67e9cf2022-03-13 13:56:57 -070013// Used to tell different LEDs to be on or off
14enum LedOutput : byte {
15 ON,
16 OFF
17}
18
James Kuszmaulef35d732022-02-12 16:37:32 -080019table LocalizerOutput {
20 // Timestamp (on the source node) that this sample corresponds with. This
21 // may be older than the sent time to account for delays in sensor readings.
22 monotonic_timestamp_ns:int64 (id: 0);
23 // Current x/y position estimate, in meters.
24 x:double (id: 1);
25 y:double (id: 2);
26 // Current heading, in radians.
27 theta:double (id: 3);
James Kuszmaul10d3fd42022-02-25 21:57:36 -080028 // Current estimate of the robot's 3-D rotation.
29 orientation:Quaternion (id: 4);
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080030 // Whether we have zeroed the IMU (may go false if we observe a fault with the
31 // IMU).
32 zeroed:bool (id: 5);
Milind Upadhyayd67e9cf2022-03-13 13:56:57 -070033
34 // Whether each led should be on.
35 // Indices correspond to pi number.
36 led_outputs:[LedOutput] (id: 6);
Austin Schuh3806ffb2022-04-13 19:44:10 -070037
38 // Cumulative number of accepted images.
39 image_accepted_count:uint (id: 7);
James Kuszmaulef35d732022-02-12 16:37:32 -080040}
41
42root_type LocalizerOutput;