blob: 9bd29faa2fa391bbccf301db301d551d370e02fa [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",
James Kuszmauld67f6d22023-02-05 17:37:25 -080078 "//frc971/constants:constants_sender_lib",
milind-u16e3a082023-01-21 13:53:43 -080079 "//frc971/control_loops:pose",
80 "//frc971/vision:calibration_fbs",
81 "//frc971/vision:charuco_lib",
82 "//frc971/vision:target_mapper",
83 "//third_party:opencv",
James Kuszmauld67f6d22023-02-05 17:37:25 -080084 "//y2023/constants:constants_fbs",
milind-uc5a494f2023-02-24 15:39:22 -080085 "//y2023/constants:simulated_constants_sender",
James Kuszmauld67f6d22023-02-05 17:37:25 -080086 ],
87)
88
89cc_library(
90 name = "vision_util",
91 srcs = ["vision_util.cc"],
92 hdrs = ["vision_util.h"],
93 deps = [
milind-uf2a4e322023-02-01 19:33:10 -080094 "//third_party:opencv",
James Kuszmauld67f6d22023-02-05 17:37:25 -080095 "//y2023/constants:constants_fbs",
96 "@com_github_google_glog//:glog",
milind-u16e3a082023-01-21 13:53:43 -080097 ],
98)
Maxwell Hendersonfebee252023-01-28 16:53:52 -080099
Ravago Jonesb84f2062023-01-29 13:46:59 -0800100cc_library(
101 name = "aprilrobotics_lib",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800102 srcs = [
103 "aprilrobotics.cc",
104 "aprilrobotics.h",
105 ],
106 target_compatible_with = ["@platforms//os:linux"],
107 visibility = ["//y2023:__subpackages__"],
108 deps = [
James Kuszmauld67f6d22023-02-05 17:37:25 -0800109 ":vision_util",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800110 "//aos:init",
111 "//aos/events:shm_event_loop",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800112 "//frc971/constants:constants_sender_lib",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800113 "//frc971/vision:calibration_fbs",
114 "//frc971/vision:charuco_lib",
115 "//frc971/vision:target_map_fbs",
116 "//frc971/vision:target_mapper",
117 "//frc971/vision:vision_fbs",
118 "//third_party:opencv",
119 "//third_party/apriltag",
James Kuszmauld67f6d22023-02-05 17:37:25 -0800120 "//y2023/constants:constants_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800121 ],
122)
Ravago Jonesb84f2062023-01-29 13:46:59 -0800123
124cc_binary(
125 name = "aprilrobotics",
126 srcs = [
127 "aprilrobotics_main.cc",
128 ],
129 target_compatible_with = ["@platforms//os:linux"],
130 visibility = ["//y2023:__subpackages__"],
131 deps = [
132 ":aprilrobotics_lib",
133 "//aos:init",
134 "//aos/events:shm_event_loop",
135 ],
136)
James Kuszmaul77d536c2023-02-11 17:30:59 -0800137
milind-u8e98cb92023-02-05 16:07:10 -0800138filegroup(
139 name = "image_streamer_start",
140 srcs = ["image_streamer_start.sh"],
141 visibility = ["//visibility:public"],
142)
143
James Kuszmaul77d536c2023-02-11 17:30:59 -0800144cc_binary(
145 name = "foxglove_image_converter",
146 srcs = ["foxglove_image_converter.cc"],
147 visibility = ["//y2023:__subpackages__"],
148 deps = [
149 "//aos:init",
150 "//aos/events:shm_event_loop",
151 "//frc971/vision:foxglove_image_converter_lib",
152 ],
153)
James Kuszmauld6199be2023-02-11 19:56:28 -0800154
155cc_binary(
156 name = "calibrate_extrinsics",
157 srcs = [
158 "calibrate_extrinsics.cc",
159 ],
160 target_compatible_with = ["@platforms//os:linux"],
161 deps = [
162 "//aos:init",
163 "//aos/events/logging:log_reader",
164 "//frc971/constants:constants_sender_lib",
165 "//frc971/control_loops:profiled_subsystem_fbs",
166 "//frc971/vision:extrinsics_calibration",
167 "//third_party:opencv",
168 "//y2023/constants:constants_fbs",
169 "//y2023/vision:vision_util",
170 ],
171)
Filip Kujawa3004f202023-02-12 16:41:40 -0800172
173cc_binary(
174 name = "game_pieces_detector",
175 srcs = [
176 "game_pieces_main.cc",
177 ],
178 target_compatible_with = ["@platforms//os:linux"],
179 visibility = ["//y2023:__subpackages__"],
180 deps = [
181 ":game_pieces_lib",
182 "//aos:init",
183 "//aos/events:shm_event_loop",
184 ],
185)
186
187cc_library(
188 name = "game_pieces_lib",
189 srcs = [
190 "game_pieces.cc",
191 ],
192 hdrs = [
193 "game_pieces.h",
194 ],
195 data = [
196 "//y2023:aos_config",
197 ],
198 target_compatible_with = ["@platforms//os:linux"],
199 visibility = ["//y2023:__subpackages__"],
200 deps = [
201 ":game_pieces_fbs",
202 "//aos/events:event_loop",
203 "//aos/events:shm_event_loop",
204 "//frc971/vision:vision_fbs",
205 ],
206)
207
208flatbuffer_cc_library(
209 name = "game_pieces_fbs",
210 srcs = ["game_pieces.fbs"],
211 gen_reflections = 1,
212 target_compatible_with = ["@platforms//os:linux"],
213 visibility = ["//visibility:public"],
214)