blob: b07278b79f03053465e24f597a78b8647acd4857 [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
James Kuszmaulef35d732022-02-12 16:37:32 -080013table LocalizerOutput {
14 // Timestamp (on the source node) that this sample corresponds with. This
15 // may be older than the sent time to account for delays in sensor readings.
16 monotonic_timestamp_ns:int64 (id: 0);
17 // Current x/y position estimate, in meters.
18 x:double (id: 1);
19 y:double (id: 2);
20 // Current heading, in radians.
21 theta:double (id: 3);
James Kuszmaul10d3fd42022-02-25 21:57:36 -080022 // Current estimate of the robot's 3-D rotation.
23 orientation:Quaternion (id: 4);
James Kuszmaulf3ef9e12022-03-05 17:13:00 -080024 // Whether we have zeroed the IMU (may go false if we observe a fault with the
25 // IMU).
26 zeroed:bool (id: 5);
James Kuszmaulef35d732022-02-12 16:37:32 -080027}
28
29root_type LocalizerOutput;