blob: 96ea63294293b17dd9f0c8ef22852c4ec7860fb1 [file] [log] [blame]
Yash Chainani728ae222023-02-04 19:48:12 -08001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
2
milind-ufbc48c92023-01-21 12:56:16 -08003py_binary(
4 name = "create_calib_file",
5 srcs = [
6 "create_calib_file.py",
7 ],
8 args = [
9 "calibration_data.h",
10 ],
11 data = glob(["calib_files/*.json"]),
12 target_compatible_with = ["@platforms//os:linux"],
13 visibility = ["//visibility:public"],
14 deps = [
15 "//frc971/vision:create_calib_file",
16 ],
17)
18
19genrule(
20 name = "run_calibration_data",
21 outs = [
22 "calibration_data.h",
23 ],
24 cmd = " ".join([
25 "$(location :create_calib_file)",
26 "$(location calibration_data.h)",
27 ]),
28 target_compatible_with = ["@platforms//os:linux"],
29 tools = [
30 ":create_calib_file",
31 ],
32)
33
34cc_library(
35 name = "calibration_data",
36 hdrs = [
37 "calibration_data.h",
38 ],
39 target_compatible_with = ["@platforms//os:linux"],
40 visibility = ["//visibility:public"],
41 deps = [
42 "@com_google_absl//absl/types:span",
43 ],
44)
45
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080046cc_binary(
47 name = "camera_reader",
48 srcs = [
49 "camera_reader.cc",
Ravago Jonese8700072023-01-14 19:41:56 -080050 "rkisp1-config.h",
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080051 ],
Ravago Jonese8700072023-01-14 19:41:56 -080052 target_compatible_with = [
53 "@platforms//os:linux",
54 "//tools/platforms/hardware:raspberry_pi",
55 ],
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080056 visibility = ["//y2023:__subpackages__"],
57 deps = [
58 "//aos:init",
59 "//aos/events:shm_event_loop",
60 "//frc971/vision:media_device",
61 "//frc971/vision:v4l2_reader",
62 ],
63)
64
65cc_binary(
66 name = "viewer",
67 srcs = [
68 "viewer.cc",
69 ],
70 target_compatible_with = ["@platforms//os:linux"],
71 visibility = ["//y2023:__subpackages__"],
72 deps = [
73 "//aos:init",
Ravago Jones17e13a22023-01-28 17:12:11 -080074 "//aos:json_to_flatbuffer",
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080075 "//aos/events:shm_event_loop",
76 "//frc971/vision:vision_fbs",
77 "//third_party:opencv",
Ravago Jones17e13a22023-01-28 17:12:11 -080078 "@com_google_absl//absl/strings",
Austin Schuhdb2ed9d2022-12-26 14:02:26 -080079 ],
80)
milind-u16e3a082023-01-21 13:53:43 -080081
82cc_binary(
83 name = "target_mapping",
84 srcs = [
85 "target_mapping.cc",
86 ],
87 data = [
88 "//y2023:aos_config",
89 ],
90 target_compatible_with = ["@platforms//os:linux"],
91 visibility = ["//y2023:__subpackages__"],
92 deps = [
milind-u09fb1252023-01-28 19:21:41 -080093 ":aprilrobotics_lib",
milind-u16e3a082023-01-21 13:53:43 -080094 ":calibration_data",
95 "//aos:init",
96 "//aos/events:simulated_event_loop",
97 "//aos/events/logging:log_reader",
98 "//frc971/control_loops:pose",
99 "//frc971/vision:calibration_fbs",
100 "//frc971/vision:charuco_lib",
101 "//frc971/vision:target_mapper",
102 "//third_party:opencv",
103 ],
104)
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800105
Yash Chainani728ae222023-02-04 19:48:12 -0800106flatbuffer_cc_library(
107 name = "april_debug_fbs",
108 srcs = ["april_debug.fbs"],
109 gen_reflections = 1,
110 target_compatible_with = ["@platforms//os:linux"],
111 visibility = ["//visibility:public"],
112)
113
Ravago Jonesb84f2062023-01-29 13:46:59 -0800114cc_library(
115 name = "aprilrobotics_lib",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800116 srcs = [
117 "aprilrobotics.cc",
118 "aprilrobotics.h",
119 ],
120 target_compatible_with = ["@platforms//os:linux"],
121 visibility = ["//y2023:__subpackages__"],
122 deps = [
Yash Chainani728ae222023-02-04 19:48:12 -0800123 ":april_debug_fbs",
Maxwell Hendersonfebee252023-01-28 16:53:52 -0800124 ":calibration_data",
125 "//aos:init",
126 "//aos/events:shm_event_loop",
127 "//frc971/vision:calibration_fbs",
128 "//frc971/vision:charuco_lib",
129 "//frc971/vision:target_map_fbs",
130 "//frc971/vision:target_mapper",
131 "//frc971/vision:vision_fbs",
132 "//third_party:opencv",
133 "//third_party/apriltag",
134 ],
135)
Ravago Jonesb84f2062023-01-29 13:46:59 -0800136
137cc_binary(
138 name = "aprilrobotics",
139 srcs = [
140 "aprilrobotics_main.cc",
141 ],
142 target_compatible_with = ["@platforms//os:linux"],
143 visibility = ["//y2023:__subpackages__"],
144 deps = [
145 ":aprilrobotics_lib",
146 "//aos:init",
147 "//aos/events:shm_event_loop",
148 ],
149)