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