blob: 54dab0d91eca8127fac04d36f7f3f88764502c28 [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",
82 "//frc971/wpilib:imu_batch_fbs",
83 "//frc971/wpilib:imu_fbs",
84 "//third_party:opencv",
85 "@com_google_absl//absl/strings:str_format",
86 "@com_google_ceres_solver//:ceres",
87 "@org_tuxfamily_eigen//:eigen",
88 ],
89)
Milind Upadhyayb67c6182022-10-22 13:45:45 -070090
Milind Upadhyaycd677a32022-12-04 13:06:43 -080091flatbuffer_cc_library(
92 name = "target_map_fbs",
93 srcs = ["target_map.fbs"],
94 gen_reflections = 1,
95 target_compatible_with = ["@platforms//os:linux"],
96 visibility = ["//visibility:public"],
97)
98
Milind Upadhyayb67c6182022-10-22 13:45:45 -070099cc_library(
Milind Upadhyay7c205222022-11-16 18:20:58 -0800100 name = "target_mapper",
101 srcs = ["target_mapper.cc"],
102 hdrs = ["target_mapper.h"],
103 target_compatible_with = ["@platforms//os:linux"],
104 visibility = ["//visibility:public"],
105 deps = [
106 ":geometry_lib",
Milind Upadhyaycd677a32022-12-04 13:06:43 -0800107 ":target_map_fbs",
Milind Upadhyay7c205222022-11-16 18:20:58 -0800108 "//aos/events:simulated_event_loop",
109 "//frc971/control_loops:control_loop",
110 "//frc971/vision/ceres:pose_graph_2d_lib",
111 "//third_party:opencv",
112 "@com_google_ceres_solver//:ceres",
113 "@org_tuxfamily_eigen//:eigen",
114 ],
115)
116
117cc_test(
118 name = "target_mapper_test",
119 srcs = [
120 "target_mapper_test.cc",
121 ],
122 target_compatible_with = ["@platforms//os:linux"],
123 deps = [
124 ":target_mapper",
125 "//aos/events:simulated_event_loop",
126 "//aos/testing:googletest",
127 "//aos/testing:random_seed",
128 ],
129)
130
131cc_library(
Milind Upadhyayb67c6182022-10-22 13:45:45 -0700132 name = "geometry_lib",
133 hdrs = [
134 "geometry.h",
135 ],
136 target_compatible_with = ["@platforms//os:linux"],
137 visibility = ["//visibility:public"],
138 deps = [
139 "//aos/util:math",
140 "//third_party:opencv",
141 "@com_github_google_glog//:glog",
142 ],
143)
144
145cc_test(
146 name = "geometry_test",
147 srcs = [
148 "geometry_test.cc",
149 ],
150 deps = [
151 ":geometry_lib",
152 "//aos/testing:googletest",
153 ],
154)