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