blob: 57627e871c1e424621be0516eb6bac0c986a8d94 [file] [log] [blame]
Milind Upadhyaycd677a32022-12-04 13:06:43 -08001namespace frc971.vision;
2
3// Represents 3d pose of an april tag on the field.
4table TargetPoseFbs {
5 // AprilTag ID of this target
6 id:uint64 (id: 0);
7
milind-u09fb1252023-01-28 19:21:41 -08008 // Pose of target relative to either the field origin or robot.
9 // To get the pose of the target, do:
Milind Upadhyayc5beba12022-12-17 17:41:20 -080010 // Translation3d(x, y, z) *
11 // (AngleAxisd(yaw) * AngleAxisd(pitch) * AngleAxisd(roll))
Milind Upadhyaycd677a32022-12-04 13:06:43 -080012 x:double (id: 1);
13 y:double (id: 2);
14 z:double (id: 3);
15
Milind Upadhyayc5beba12022-12-17 17:41:20 -080016 // Orientation of the target.
Milind Upadhyaycd677a32022-12-04 13:06:43 -080017 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-u09fb1252023-01-28 19:21:41 -080023// 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 Upadhyaycd677a32022-12-04 13:06:43 -080026table TargetMap {
27 target_poses:[TargetPoseFbs] (id: 0);
Milind Upadhyay05652cb2022-12-07 20:51:51 -080028
milind-u09fb1252023-01-28 19:21:41 -080029 // Unique name of the field (for use case 1.)
Milind Upadhyay05652cb2022-12-07 20:51:51 -080030 field_name:string (id: 1);
milind-u09fb1252023-01-28 19:21:41 -080031
32 // End-of-frame timestamp for the frame with tag detections.
33 // (for use case 2.).
34 monotonic_timestamp_ns:int64 (id: 2);
Maxwell Hendersonfebee252023-01-28 16:53:52 -080035}
36
37root_type TargetMap;