blob: 195634e599b856e528e451ca0fd348223e9aba0c [file] [log] [blame]
milind-u2f101fc2023-01-21 12:28:49 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library")
Austin Schuha1d006e2022-09-14 21:50:42 -07002load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Jim Ostrowski977850f2022-01-22 21:04:22 -08003
4flatbuffer_cc_library(
5 name = "vision_fbs",
6 srcs = ["vision.fbs"],
7 gen_reflections = 1,
8 target_compatible_with = ["@platforms//os:linux"],
9 visibility = ["//visibility:public"],
10)
11
12flatbuffer_ts_library(
13 name = "vision_ts_fbs",
14 srcs = ["vision.fbs"],
15 target_compatible_with = ["@platforms//os:linux"],
16 visibility = ["//visibility:public"],
17)
18
milind-u2f101fc2023-01-21 12:28:49 -080019flatbuffer_cc_library(
20 name = "calibration_fbs",
21 srcs = ["calibration.fbs"],
22 gen_reflections = 1,
23 target_compatible_with = ["@platforms//os:linux"],
24 visibility = ["//visibility:public"],
25)
26
27flatbuffer_ts_library(
28 name = "calibration_ts_fbs",
29 srcs = ["calibration.fbs"],
30 target_compatible_with = ["@platforms//os:linux"],
31 visibility = ["//visibility:public"],
32)
33
34flatbuffer_py_library(
35 name = "calibration_fbs_python",
36 srcs = [
37 "calibration.fbs",
38 ],
39 namespace = "frc971.vision.calibration",
40 tables = [
41 "CalibrationData",
42 "CameraCalibration",
43 "TransformationMatrix",
44 ],
45 target_compatible_with = ["@platforms//os:linux"],
46 visibility = ["//visibility:public"],
47)
48
Jim Ostrowski977850f2022-01-22 21:04:22 -080049cc_library(
50 name = "v4l2_reader",
51 srcs = [
52 "v4l2_reader.cc",
53 ],
54 hdrs = [
55 "v4l2_reader.h",
56 ],
57 target_compatible_with = ["@platforms//os:linux"],
58 visibility = ["//visibility:public"],
59 deps = [
60 ":vision_fbs",
Ravago Jonesdc524752022-12-27 01:15:13 -080061 "//aos/events:epoll",
Jim Ostrowski977850f2022-01-22 21:04:22 -080062 "//aos/events:event_loop",
63 "//aos/scoped:scoped_fd",
64 "@com_github_google_glog//:glog",
65 "@com_google_absl//absl/base",
66 ],
67)
Austin Schuhdcb6b362022-02-25 18:06:21 -080068
69cc_library(
70 name = "charuco_lib",
71 srcs = [
72 "charuco_lib.cc",
73 ],
74 hdrs = [
75 "charuco_lib.h",
76 ],
77 target_compatible_with = ["@platforms//os:linux"],
78 visibility = ["//visibility:public"],
79 deps = [
80 "//aos:flatbuffers",
81 "//aos/events:event_loop",
82 "//aos/network:message_bridge_server_fbs",
83 "//aos/network:team_number",
84 "//frc971/control_loops:quaternion_utils",
85 "//frc971/vision:vision_fbs",
86 "//third_party:opencv",
87 "//y2020/vision/sift:sift_fbs",
88 "//y2020/vision/sift:sift_training_fbs",
89 "//y2020/vision/tools/python_code:sift_training_data",
90 "@com_github_google_glog//:glog",
91 "@com_google_absl//absl/strings:str_format",
92 "@com_google_absl//absl/types:span",
93 "@org_tuxfamily_eigen//:eigen",
94 ],
95)
96
97cc_library(
98 name = "extrinsics_calibration",
99 srcs = [
100 "calibration_accumulator.cc",
101 "calibration_accumulator.h",
102 "extrinsics_calibration.cc",
103 "extrinsics_calibration.h",
104 ],
105 target_compatible_with = ["@platforms//os:linux"],
106 visibility = ["//visibility:public"],
107 deps = [
108 ":charuco_lib",
109 "//aos:init",
110 "//aos/events/logging:log_reader",
111 "//frc971/analysis:in_process_plotter",
112 "//frc971/control_loops/drivetrain:improved_down_estimator",
Jim Ostrowskiba2edd12022-12-03 15:44:37 -0800113 "//frc971/vision:visualize_robot",
Austin Schuhdcb6b362022-02-25 18:06:21 -0800114 "//frc971/wpilib:imu_batch_fbs",
115 "//frc971/wpilib:imu_fbs",
116 "//third_party:opencv",
117 "@com_google_absl//absl/strings:str_format",
118 "@com_google_ceres_solver//:ceres",
119 "@org_tuxfamily_eigen//:eigen",
120 ],
121)
Milind Upadhyayb67c6182022-10-22 13:45:45 -0700122
Milind Upadhyaycd677a32022-12-04 13:06:43 -0800123flatbuffer_cc_library(
124 name = "target_map_fbs",
125 srcs = ["target_map.fbs"],
126 gen_reflections = 1,
127 target_compatible_with = ["@platforms//os:linux"],
128 visibility = ["//visibility:public"],
129)
130
Milind Upadhyayb67c6182022-10-22 13:45:45 -0700131cc_library(
Milind Upadhyay7c205222022-11-16 18:20:58 -0800132 name = "target_mapper",
133 srcs = ["target_mapper.cc"],
134 hdrs = ["target_mapper.h"],
Yash Chainanid5c7f0d2022-11-19 17:05:57 -0800135 data = ["target_map.json"],
Milind Upadhyay7c205222022-11-16 18:20:58 -0800136 target_compatible_with = ["@platforms//os:linux"],
137 visibility = ["//visibility:public"],
138 deps = [
139 ":geometry_lib",
Milind Upadhyaycd677a32022-12-04 13:06:43 -0800140 ":target_map_fbs",
Milind Upadhyay7c205222022-11-16 18:20:58 -0800141 "//aos/events:simulated_event_loop",
142 "//frc971/control_loops:control_loop",
143 "//frc971/vision/ceres:pose_graph_2d_lib",
144 "//third_party:opencv",
145 "@com_google_ceres_solver//:ceres",
146 "@org_tuxfamily_eigen//:eigen",
147 ],
148)
149
150cc_test(
151 name = "target_mapper_test",
152 srcs = [
153 "target_mapper_test.cc",
154 ],
155 target_compatible_with = ["@platforms//os:linux"],
156 deps = [
157 ":target_mapper",
158 "//aos/events:simulated_event_loop",
159 "//aos/testing:googletest",
160 "//aos/testing:random_seed",
161 ],
162)
163
164cc_library(
Milind Upadhyayb67c6182022-10-22 13:45:45 -0700165 name = "geometry_lib",
166 hdrs = [
167 "geometry.h",
168 ],
169 target_compatible_with = ["@platforms//os:linux"],
170 visibility = ["//visibility:public"],
171 deps = [
172 "//aos/util:math",
173 "//third_party:opencv",
174 "@com_github_google_glog//:glog",
175 ],
176)
177
178cc_test(
179 name = "geometry_test",
180 srcs = [
181 "geometry_test.cc",
182 ],
183 deps = [
184 ":geometry_lib",
185 "//aos/testing:googletest",
186 ],
187)
Jim Ostrowskiba2edd12022-12-03 15:44:37 -0800188
189cc_library(
190 name = "visualize_robot",
191 srcs = [
192 "visualize_robot.cc",
193 ],
194 hdrs = [
195 "visualize_robot.h",
196 ],
197 deps = [
198 "//aos:init",
199 "//third_party:opencv",
200 "@com_google_absl//absl/strings:str_format",
201 "@org_tuxfamily_eigen//:eigen",
202 ],
203)
204
205cc_binary(
206 name = "visualize_robot_sample",
207 srcs = [
208 "visualize_robot_sample.cc",
209 ],
210 target_compatible_with = ["@platforms//os:linux"],
211 visibility = ["//visibility:public"],
212 deps = [
213 "//aos:init",
214 "//frc971/vision:visualize_robot",
215 "//third_party:opencv",
216 "@com_github_google_glog//:glog",
217 "@com_google_ceres_solver//:ceres",
218 "@org_tuxfamily_eigen//:eigen",
219 ],
220)
Austin Schuhc97d48d2022-12-26 14:09:13 -0800221
222cc_library(
223 name = "media_device",
224 srcs = [
225 "media_device.cc",
226 ],
227 hdrs = ["media_device.h"],
228 visibility = ["//visibility:public"],
229 deps = [
230 "//aos/scoped:scoped_fd",
231 "//aos/util:file",
232 "@com_github_google_glog//:glog",
233 "@com_google_absl//absl/strings",
234 ],
235)