blob: ed87895b6318e0337549dffe1dc66d01cf62fc3c [file] [log] [blame]
Milind Upadhyaycd677a32022-12-04 13:06:43 -08001namespace frc971.vision;
2
milind-u3f5f83c2023-01-29 15:23:51 -08003table Position {
4 x:double (id: 0);
5 y:double (id: 1);
6 z:double (id: 2);
7}
8
9table Quaternion {
10 w:double (id: 0);
11 x:double (id: 1);
12 y:double (id: 2);
13 z:double (id: 3);
14}
15
Milind Upadhyaycd677a32022-12-04 13:06:43 -080016// Represents 3d pose of an april tag on the field.
17table TargetPoseFbs {
18 // AprilTag ID of this target
19 id:uint64 (id: 0);
20
Yash Chainanibd6c6e52023-02-18 19:31:32 -080021 // Pose of target relative to either the field origin or camera.
milind-u09fb1252023-01-28 19:21:41 -080022 // To get the pose of the target, do:
milind-u3f5f83c2023-01-29 15:23:51 -080023 // 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 Upadhyaycd677a32022-12-04 13:06:43 -080027}
28
29// Map of all target poses on a field.
milind-u09fb1252023-01-28 19:21:41 -080030// There are two possible uses for this:
31// 1. Static april tag poses on the field solved for by TargetMapper.
Yash Chainanibd6c6e52023-02-18 19:31:32 -080032// 2. List of detected april poses relative to the camera.
Milind Upadhyaycd677a32022-12-04 13:06:43 -080033table TargetMap {
34 target_poses:[TargetPoseFbs] (id: 0);
Milind Upadhyay05652cb2022-12-07 20:51:51 -080035
milind-u09fb1252023-01-28 19:21:41 -080036 // Unique name of the field (for use case 1.)
Milind Upadhyay05652cb2022-12-07 20:51:51 -080037 field_name:string (id: 1);
milind-u09fb1252023-01-28 19:21:41 -080038
39 // End-of-frame timestamp for the frame with tag detections.
40 // (for use case 2.).
41 monotonic_timestamp_ns:int64 (id: 2);
Maxwell Hendersonfebee252023-01-28 16:53:52 -080042}
43
44root_type TargetMap;