blob: df8b7b0d26ce93dac06476d2440259df47083e67 [file] [log] [blame]
Jim Ostrowski007e2ea2022-01-30 13:13:26 -08001namespace frc971.vision.calibration;
2
3table TransformationMatrix {
4 // The matrix data for a row-major 4x4 homogeneous transformation matrix.
5 // This implies the bottom row is (0, 0, 0, 1).
6 data:[float] (id: 0);
7}
8
9// Calibration information for a given camera on a given robot.
10table CameraCalibration {
11 // The name of the camera node which this calibration data applies to.
12 node_name:string (id: 0);
13 // The team number of the robot which this calibration data applies to.
14 team_number:int (id: 1);
15
16 // Intrinsics for the camera.
17 //
18 // This is the standard OpenCV intrinsics matrix in row major order (3x3).
19 intrinsics:[float] (id: 2);
20
21 // Fixed extrinsics for the camera. This transforms from camera coordinates to
22 // robot coordinates. For example: multiplying (0, 0, 0, 1) by this results in
23 // the position of the camera aperture in robot coordinates.
24 fixed_extrinsics:TransformationMatrix (id: 3);
25
26 // Extrinsics for a camera on a turret. This will only be filled out for
27 // applicable cameras. For turret-mounted cameras, fixed_extrinsics defines
28 // a position for the center of rotation of the turret, and this field defines
29 // a position for the camera on the turret.
30 //
31 // The combination of the two transformations is underdefined, so nothing can
32 // distinguish between the two parts of the final extrinsics for a given
33 // turret position.
34 //
35 // To get the final extrinsics for a camera using this transformation,
36 // multiply (in order):
37 // fixed_extrinsics
38 // rotation around the Z axis by the turret angle
39 // turret_extrinsics
40 turret_extrinsics:TransformationMatrix (id: 4);
41
42 // This is the standard OpenCV 5 parameter distortion coefficients
43 dist_coeffs:[float] (id: 5);
44
45 // Timestamp for when the calibration was taken on the realtime clock.
46 calibration_timestamp:int64 (id: 6);
James Kuszmaul7e958812023-02-11 15:34:31 -080047
48 // ID for the physical camera hardware (typically will be a string of the form
49 // YY-NN, with a two-digit year and an index).
50 camera_id:string (id: 7);
Jim Ostrowski007e2ea2022-01-30 13:13:26 -080051}
52
53// Calibration information for all the cameras we know about.
54table CalibrationData {
55 camera_calibrations:[CameraCalibration] (id: 0);
56}
57
58
59root_type CalibrationData;