James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 1 | namespace 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 Kuszmaul | 10d3fd4 | 2022-02-25 21:57:36 -0800 | [diff] [blame^] | 6 | struct Quaternion { |
| 7 | w:double (id: 0); |
| 8 | x:double (id: 1); |
| 9 | y:double (id: 2); |
| 10 | z:double (id: 3); |
| 11 | } |
| 12 | |
James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 13 | table 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 Kuszmaul | 10d3fd4 | 2022-02-25 21:57:36 -0800 | [diff] [blame^] | 22 | // Current estimate of the robot's 3-D rotation. |
| 23 | orientation:Quaternion (id: 4); |
James Kuszmaul | ef35d73 | 2022-02-12 16:37:32 -0800 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | root_type LocalizerOutput; |