blob: 4a8d50b3a2d78e279e189323e4d4733996e38477 [file] [log] [blame]
Austin Schuha1d006e2022-09-14 21:50:42 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2load("@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
19cc_library(
20 name = "v4l2_reader",
21 srcs = [
22 "v4l2_reader.cc",
23 ],
24 hdrs = [
25 "v4l2_reader.h",
26 ],
27 target_compatible_with = ["@platforms//os:linux"],
28 visibility = ["//visibility:public"],
29 deps = [
30 ":vision_fbs",
Ravago Jonesdc524752022-12-27 01:15:13 -080031 "//aos/events:epoll",
Jim Ostrowski977850f2022-01-22 21:04:22 -080032 "//aos/events:event_loop",
33 "//aos/scoped:scoped_fd",
34 "@com_github_google_glog//:glog",
35 "@com_google_absl//absl/base",
36 ],
37)
Austin Schuhdcb6b362022-02-25 18:06:21 -080038
39cc_library(
40 name = "charuco_lib",
41 srcs = [
42 "charuco_lib.cc",
43 ],
44 hdrs = [
45 "charuco_lib.h",
46 ],
47 target_compatible_with = ["@platforms//os:linux"],
48 visibility = ["//visibility:public"],
49 deps = [
50 "//aos:flatbuffers",
51 "//aos/events:event_loop",
52 "//aos/network:message_bridge_server_fbs",
53 "//aos/network:team_number",
54 "//frc971/control_loops:quaternion_utils",
55 "//frc971/vision:vision_fbs",
56 "//third_party:opencv",
57 "//y2020/vision/sift:sift_fbs",
58 "//y2020/vision/sift:sift_training_fbs",
59 "//y2020/vision/tools/python_code:sift_training_data",
60 "@com_github_google_glog//:glog",
61 "@com_google_absl//absl/strings:str_format",
62 "@com_google_absl//absl/types:span",
63 "@org_tuxfamily_eigen//:eigen",
64 ],
65)
66
67cc_library(
68 name = "extrinsics_calibration",
69 srcs = [
70 "calibration_accumulator.cc",
71 "calibration_accumulator.h",
72 "extrinsics_calibration.cc",
73 "extrinsics_calibration.h",
74 ],
75 target_compatible_with = ["@platforms//os:linux"],
76 visibility = ["//visibility:public"],
77 deps = [
78 ":charuco_lib",
79 "//aos:init",
80 "//aos/events/logging:log_reader",
81 "//frc971/analysis:in_process_plotter",
82 "//frc971/control_loops/drivetrain:improved_down_estimator",
Jim Ostrowskiba2edd12022-12-03 15:44:37 -080083 "//frc971/vision:visualize_robot",
Austin Schuhdcb6b362022-02-25 18:06:21 -080084 "//frc971/wpilib:imu_batch_fbs",
85 "//frc971/wpilib:imu_fbs",
86 "//third_party:opencv",
87 "@com_google_absl//absl/strings:str_format",
88 "@com_google_ceres_solver//:ceres",
89 "@org_tuxfamily_eigen//:eigen",
90 ],
91)
Milind Upadhyayb67c6182022-10-22 13:45:45 -070092
Milind Upadhyaycd677a32022-12-04 13:06:43 -080093flatbuffer_cc_library(
94 name = "target_map_fbs",
95 srcs = ["target_map.fbs"],
96 gen_reflections = 1,
97 target_compatible_with = ["@platforms//os:linux"],
98 visibility = ["//visibility:public"],
99)
100
Milind Upadhyayb67c6182022-10-22 13:45:45 -0700101cc_library(
Milind Upadhyay7c205222022-11-16 18:20:58 -0800102 name = "target_mapper",
103 srcs = ["target_mapper.cc"],
104 hdrs = ["target_mapper.h"],
Yash Chainanid5c7f0d2022-11-19 17:05:57 -0800105 data = ["target_map.json"],
Milind Upadhyay7c205222022-11-16 18:20:58 -0800106 target_compatible_with = ["@platforms//os:linux"],
107 visibility = ["//visibility:public"],
108 deps = [
109 ":geometry_lib",
Milind Upadhyaycd677a32022-12-04 13:06:43 -0800110 ":target_map_fbs",
Milind Upadhyay7c205222022-11-16 18:20:58 -0800111 "//aos/events:simulated_event_loop",
112 "//frc971/control_loops:control_loop",
113 "//frc971/vision/ceres:pose_graph_2d_lib",
114 "//third_party:opencv",
115 "@com_google_ceres_solver//:ceres",
116 "@org_tuxfamily_eigen//:eigen",
117 ],
118)
119
120cc_test(
121 name = "target_mapper_test",
122 srcs = [
123 "target_mapper_test.cc",
124 ],
125 target_compatible_with = ["@platforms//os:linux"],
126 deps = [
127 ":target_mapper",
128 "//aos/events:simulated_event_loop",
129 "//aos/testing:googletest",
130 "//aos/testing:random_seed",
131 ],
132)
133
134cc_library(
Milind Upadhyayb67c6182022-10-22 13:45:45 -0700135 name = "geometry_lib",
136 hdrs = [
137 "geometry.h",
138 ],
139 target_compatible_with = ["@platforms//os:linux"],
140 visibility = ["//visibility:public"],
141 deps = [
142 "//aos/util:math",
143 "//third_party:opencv",
144 "@com_github_google_glog//:glog",
145 ],
146)
147
148cc_test(
149 name = "geometry_test",
150 srcs = [
151 "geometry_test.cc",
152 ],
153 deps = [
154 ":geometry_lib",
155 "//aos/testing:googletest",
156 ],
157)
Jim Ostrowskiba2edd12022-12-03 15:44:37 -0800158
159cc_library(
160 name = "visualize_robot",
161 srcs = [
162 "visualize_robot.cc",
163 ],
164 hdrs = [
165 "visualize_robot.h",
166 ],
167 deps = [
168 "//aos:init",
169 "//third_party:opencv",
170 "@com_google_absl//absl/strings:str_format",
171 "@org_tuxfamily_eigen//:eigen",
172 ],
173)
174
175cc_binary(
176 name = "visualize_robot_sample",
177 srcs = [
178 "visualize_robot_sample.cc",
179 ],
180 target_compatible_with = ["@platforms//os:linux"],
181 visibility = ["//visibility:public"],
182 deps = [
183 "//aos:init",
184 "//frc971/vision:visualize_robot",
185 "//third_party:opencv",
186 "@com_github_google_glog//:glog",
187 "@com_google_ceres_solver//:ceres",
188 "@org_tuxfamily_eigen//:eigen",
189 ],
190)
Austin Schuhc97d48d2022-12-26 14:09:13 -0800191
192cc_library(
193 name = "media_device",
194 srcs = [
195 "media_device.cc",
196 ],
197 hdrs = ["media_device.h"],
198 visibility = ["//visibility:public"],
199 deps = [
200 "//aos/scoped:scoped_fd",
201 "//aos/util:file",
202 "@com_github_google_glog//:glog",
203 "@com_google_absl//absl/strings",
204 ],
205)