blob: e90b825ecc0c9c80f71c62e5460701c51b87497e [file] [log] [blame]
Filip Kujawa3004f202023-02-12 16:41:40 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2
Austin Schuhdb2ed9d2022-12-26 14:02:26 -08003cc_binary(
4 name = "camera_reader",
5 srcs = [
6 "camera_reader.cc",
Ravago Jonese8700072023-01-14 19:41:56 -08007 "rkisp1-config.h",
Austin Schuhdb2ed9d2022-12-26 14:02:26 -08008 ],
Ravago Jonese8700072023-01-14 19:41:56 -08009 target_compatible_with = [
10 "@platforms//os:linux",
11 "//tools/platforms/hardware:raspberry_pi",
12 ],
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080013 visibility = ["//y2023:__subpackages__"],
14 deps = [
15 "//aos:init",
16 "//aos/events:shm_event_loop",
17 "//frc971/vision:media_device",
18 "//frc971/vision:v4l2_reader",
19 ],
20)
21
22cc_binary(
23 name = "viewer",
24 srcs = [
25 "viewer.cc",
26 ],
27 target_compatible_with = ["@platforms//os:linux"],
28 visibility = ["//y2023:__subpackages__"],
29 deps = [
30 "//aos:init",
Ravago Jones17e13a22023-01-28 17:12:11 -080031 "//aos:json_to_flatbuffer",
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080032 "//aos/events:shm_event_loop",
milind-uc3cf9752023-02-20 23:07:30 -080033 "//frc971/constants:constants_sender_lib",
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080034 "//frc971/vision:vision_fbs",
35 "//third_party:opencv",
milind-uc3cf9752023-02-20 23:07:30 -080036 "//y2023/vision:vision_util",
Ravago Jones17e13a22023-01-28 17:12:11 -080037 "@com_google_absl//absl/strings",
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080038 ],
39)
milind-u16e3a082023-01-21 13:53:43 -080040
41cc_binary(
milind-ud4051fe2023-02-25 18:00:05 -080042 name = "localization_verifier",
43 srcs = [
44 "localization_verifier.cc",
45 ],
46 target_compatible_with = ["@platforms//os:linux"],
47 visibility = ["//y2023:__subpackages__"],
48 deps = [
49 "//aos:init",
50 "//aos/events:shm_event_loop",
51 "//frc971/constants:constants_sender_lib",
52 "//frc971/control_loops/drivetrain/localization:localizer_output_fbs",
53 "//frc971/vision:vision_fbs",
54 "//y2023/localizer",
milind-u607f3232023-02-26 15:22:40 -080055 "//y2023/localizer:utils",
milind-ud4051fe2023-02-25 18:00:05 -080056 "//y2023/vision:vision_util",
57 "@com_google_absl//absl/strings",
58 ],
59)
60
61cc_binary(
milind-u16e3a082023-01-21 13:53:43 -080062 name = "target_mapping",
63 srcs = [
64 "target_mapping.cc",
65 ],
66 data = [
67 "//y2023:aos_config",
milind-uc5a494f2023-02-24 15:39:22 -080068 "//y2023/constants:constants.json",
69 "//y2023/vision:maps",
milind-u16e3a082023-01-21 13:53:43 -080070 ],
71 target_compatible_with = ["@platforms//os:linux"],
72 visibility = ["//y2023:__subpackages__"],
73 deps = [
milind-u09fb1252023-01-28 19:21:41 -080074 ":aprilrobotics_lib",
milind-u16e3a082023-01-21 13:53:43 -080075 "//aos:init",
76 "//aos/events:simulated_event_loop",
77 "//aos/events/logging:log_reader",
Jim Ostrowski68965cd2023-03-01 20:32:51 -080078 "//aos/util:mcap_logger",
James Kuszmauld67f6d22023-02-05 17:37:25 -080079 "//frc971/constants:constants_sender_lib",
milind-u16e3a082023-01-21 13:53:43 -080080 "//frc971/control_loops:pose",
81 "//frc971/vision:calibration_fbs",
82 "//frc971/vision:charuco_lib",
83 "//frc971/vision:target_mapper",
84 "//third_party:opencv",
James Kuszmauld67f6d22023-02-05 17:37:25 -080085 "//y2023/constants:constants_fbs",
milind-uc5a494f2023-02-24 15:39:22 -080086 "//y2023/constants:simulated_constants_sender",
James Kuszmauld67f6d22023-02-05 17:37:25 -080087 ],
88)
89
90cc_library(
91 name = "vision_util",
92 srcs = ["vision_util.cc"],
93 hdrs = ["vision_util.h"],
94 deps = [
milind-uf2a4e322023-02-01 19:33:10 -080095 "//third_party:opencv",
James Kuszmauld67f6d22023-02-05 17:37:25 -080096 "//y2023/constants:constants_fbs",
97 "@com_github_google_glog//:glog",
milind-u16e3a082023-01-21 13:53:43 -080098 ],
99)
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800100
Ravago Jonesb84f2062023-01-29 13:46:59 -0800101cc_library(
102 name = "aprilrobotics_lib",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800103 srcs = [
104 "aprilrobotics.cc",
105 "aprilrobotics.h",
106 ],
107 target_compatible_with = ["@platforms//os:linux"],
108 visibility = ["//y2023:__subpackages__"],
109 deps = [
James Kuszmauld67f6d22023-02-05 17:37:25 -0800110 ":vision_util",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800111 "//aos:init",
112 "//aos/events:shm_event_loop",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800113 "//frc971/constants:constants_sender_lib",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800114 "//frc971/vision:calibration_fbs",
115 "//frc971/vision:charuco_lib",
116 "//frc971/vision:target_map_fbs",
117 "//frc971/vision:target_mapper",
118 "//frc971/vision:vision_fbs",
119 "//third_party:opencv",
120 "//third_party/apriltag",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800121 "//y2023/constants:constants_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800122 ],
123)
Ravago Jonesb84f2062023-01-29 13:46:59 -0800124
125cc_binary(
126 name = "aprilrobotics",
127 srcs = [
128 "aprilrobotics_main.cc",
129 ],
130 target_compatible_with = ["@platforms//os:linux"],
131 visibility = ["//y2023:__subpackages__"],
132 deps = [
133 ":aprilrobotics_lib",
134 "//aos:init",
135 "//aos/events:shm_event_loop",
136 ],
137)
James Kuszmaul77d536c2023-02-11 17:30:59 -0800138
Yash Chainani10b7b022023-02-22 14:34:04 -0800139cc_test(
140 name = "april_detection_test",
141 srcs = [
142 "april_detection_test.cc",
143 ],
144 data = [
145 "//y2023:aos_config",
146 "//y2023/constants:constants.json",
147 "@apriltag_test_bfbs_images",
148 ],
149 deps = [
150 ":aprilrobotics_lib",
151 "//aos:flatbuffer_merge",
152 "//aos:json_to_flatbuffer",
153 "//aos/events:simulated_event_loop",
154 "//aos/testing:googletest",
155 "//aos/testing:path",
156 "//aos/testing:test_logging",
157 "//frc971/constants:constants_sender_lib",
158 "//frc971/vision:target_mapper",
159 "//frc971/vision:vision_fbs",
160 "//y2023/constants:constants_fbs",
161 "//y2023/constants:constants_list_fbs",
162 ],
163)
164
milind-u8e98cb92023-02-05 16:07:10 -0800165filegroup(
166 name = "image_streamer_start",
167 srcs = ["image_streamer_start.sh"],
168 visibility = ["//visibility:public"],
169)
170
James Kuszmaul77d536c2023-02-11 17:30:59 -0800171cc_binary(
172 name = "foxglove_image_converter",
173 srcs = ["foxglove_image_converter.cc"],
174 visibility = ["//y2023:__subpackages__"],
175 deps = [
176 "//aos:init",
177 "//aos/events:shm_event_loop",
178 "//frc971/vision:foxglove_image_converter_lib",
179 ],
180)
James Kuszmauld6199be2023-02-11 19:56:28 -0800181
182cc_binary(
183 name = "calibrate_extrinsics",
184 srcs = [
185 "calibrate_extrinsics.cc",
186 ],
187 target_compatible_with = ["@platforms//os:linux"],
188 deps = [
189 "//aos:init",
190 "//aos/events/logging:log_reader",
191 "//frc971/constants:constants_sender_lib",
192 "//frc971/control_loops:profiled_subsystem_fbs",
193 "//frc971/vision:extrinsics_calibration",
194 "//third_party:opencv",
195 "//y2023/constants:constants_fbs",
196 "//y2023/vision:vision_util",
197 ],
198)
Filip Kujawa3004f202023-02-12 16:41:40 -0800199
200cc_binary(
201 name = "game_pieces_detector",
202 srcs = [
203 "game_pieces_main.cc",
204 ],
205 target_compatible_with = ["@platforms//os:linux"],
206 visibility = ["//y2023:__subpackages__"],
207 deps = [
208 ":game_pieces_lib",
209 "//aos:init",
210 "//aos/events:shm_event_loop",
211 ],
212)
213
214cc_library(
215 name = "game_pieces_lib",
216 srcs = [
217 "game_pieces.cc",
218 ],
219 hdrs = [
220 "game_pieces.h",
221 ],
222 data = [
223 "//y2023:aos_config",
224 ],
225 target_compatible_with = ["@platforms//os:linux"],
226 visibility = ["//y2023:__subpackages__"],
227 deps = [
228 ":game_pieces_fbs",
229 "//aos/events:event_loop",
230 "//aos/events:shm_event_loop",
231 "//frc971/vision:vision_fbs",
232 ],
233)
234
235flatbuffer_cc_library(
236 name = "game_pieces_fbs",
237 srcs = ["game_pieces.fbs"],
238 gen_reflections = 1,
239 target_compatible_with = ["@platforms//os:linux"],
240 visibility = ["//visibility:public"],
241)