Milind Upadhyay | cd677a3 | 2022-12-04 13:06:43 -0800 | [diff] [blame] | 1 | namespace frc971.vision; |
| 2 | |
milind-u | 3f5f83c | 2023-01-29 15:23:51 -0800 | [diff] [blame] | 3 | table Position { |
| 4 | x:double (id: 0); |
| 5 | y:double (id: 1); |
| 6 | z:double (id: 2); |
| 7 | } |
| 8 | |
| 9 | table Quaternion { |
| 10 | w:double (id: 0); |
| 11 | x:double (id: 1); |
| 12 | y:double (id: 2); |
| 13 | z:double (id: 3); |
| 14 | } |
| 15 | |
Milind Upadhyay | cd677a3 | 2022-12-04 13:06:43 -0800 | [diff] [blame] | 16 | // Represents 3d pose of an april tag on the field. |
| 17 | table TargetPoseFbs { |
| 18 | // AprilTag ID of this target |
| 19 | id:uint64 (id: 0); |
| 20 | |
Yash Chainani | bd6c6e5 | 2023-02-18 19:31:32 -0800 | [diff] [blame^] | 21 | // Pose of target relative to either the field origin or camera. |
milind-u | 09fb125 | 2023-01-28 19:21:41 -0800 | [diff] [blame] | 22 | // To get the pose of the target, do: |
milind-u | 3f5f83c | 2023-01-29 15:23:51 -0800 | [diff] [blame] | 23 | // Translation3d(position.x(), position.y(), position.z()) * |
| 24 | // Quaterniond(orientation.w(), orientation.x(), orientation.y(), orientation.z()) |
| 25 | position:Position (id: 1); |
| 26 | orientation:Quaternion (id: 2); |
Milind Upadhyay | cd677a3 | 2022-12-04 13:06:43 -0800 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | // Map of all target poses on a field. |
milind-u | 09fb125 | 2023-01-28 19:21:41 -0800 | [diff] [blame] | 30 | // There are two possible uses for this: |
| 31 | // 1. Static april tag poses on the field solved for by TargetMapper. |
Yash Chainani | bd6c6e5 | 2023-02-18 19:31:32 -0800 | [diff] [blame^] | 32 | // 2. List of detected april poses relative to the camera. |
Milind Upadhyay | cd677a3 | 2022-12-04 13:06:43 -0800 | [diff] [blame] | 33 | table TargetMap { |
| 34 | target_poses:[TargetPoseFbs] (id: 0); |
Milind Upadhyay | 05652cb | 2022-12-07 20:51:51 -0800 | [diff] [blame] | 35 | |
milind-u | 09fb125 | 2023-01-28 19:21:41 -0800 | [diff] [blame] | 36 | // Unique name of the field (for use case 1.) |
Milind Upadhyay | 05652cb | 2022-12-07 20:51:51 -0800 | [diff] [blame] | 37 | field_name:string (id: 1); |
milind-u | 09fb125 | 2023-01-28 19:21:41 -0800 | [diff] [blame] | 38 | |
| 39 | // End-of-frame timestamp for the frame with tag detections. |
| 40 | // (for use case 2.). |
| 41 | monotonic_timestamp_ns:int64 (id: 2); |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | root_type TargetMap; |