Filip Kujawa | 3004f20 | 2023-02-12 16:41:40 -0800 | [diff] [blame] | 1 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
Maxwell Henderson | bf1bcec | 2023-03-05 18:00:20 -0800 | [diff] [blame] | 2 | load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library") |
Filip Kujawa | 3004f20 | 2023-02-12 16:41:40 -0800 | [diff] [blame] | 3 | |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 4 | cc_binary( |
| 5 | name = "camera_reader", |
| 6 | srcs = [ |
| 7 | "camera_reader.cc", |
Ravago Jones | e870007 | 2023-01-14 19:41:56 -0800 | [diff] [blame] | 8 | "rkisp1-config.h", |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 9 | ], |
Ravago Jones | e870007 | 2023-01-14 19:41:56 -0800 | [diff] [blame] | 10 | target_compatible_with = [ |
| 11 | "@platforms//os:linux", |
| 12 | "//tools/platforms/hardware:raspberry_pi", |
| 13 | ], |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 14 | visibility = ["//y2023:__subpackages__"], |
| 15 | deps = [ |
| 16 | "//aos:init", |
| 17 | "//aos/events:shm_event_loop", |
| 18 | "//frc971/vision:media_device", |
| 19 | "//frc971/vision:v4l2_reader", |
| 20 | ], |
| 21 | ) |
| 22 | |
| 23 | cc_binary( |
| 24 | name = "viewer", |
| 25 | srcs = [ |
| 26 | "viewer.cc", |
| 27 | ], |
| 28 | target_compatible_with = ["@platforms//os:linux"], |
| 29 | visibility = ["//y2023:__subpackages__"], |
| 30 | deps = [ |
| 31 | "//aos:init", |
Ravago Jones | 17e13a2 | 2023-01-28 17:12:11 -0800 | [diff] [blame] | 32 | "//aos:json_to_flatbuffer", |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 33 | "//aos/events:shm_event_loop", |
milind-u | c3cf975 | 2023-02-20 23:07:30 -0800 | [diff] [blame] | 34 | "//frc971/constants:constants_sender_lib", |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 35 | "//frc971/vision:vision_fbs", |
| 36 | "//third_party:opencv", |
milind-u | c3cf975 | 2023-02-20 23:07:30 -0800 | [diff] [blame] | 37 | "//y2023/vision:vision_util", |
Ravago Jones | 17e13a2 | 2023-01-28 17:12:11 -0800 | [diff] [blame] | 38 | "@com_google_absl//absl/strings", |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 39 | ], |
| 40 | ) |
milind-u | 16e3a08 | 2023-01-21 13:53:43 -0800 | [diff] [blame] | 41 | |
| 42 | cc_binary( |
milind-u | d4051fe | 2023-02-25 18:00:05 -0800 | [diff] [blame] | 43 | name = "localization_verifier", |
| 44 | srcs = [ |
| 45 | "localization_verifier.cc", |
| 46 | ], |
| 47 | target_compatible_with = ["@platforms//os:linux"], |
| 48 | visibility = ["//y2023:__subpackages__"], |
| 49 | deps = [ |
| 50 | "//aos:init", |
| 51 | "//aos/events:shm_event_loop", |
| 52 | "//frc971/constants:constants_sender_lib", |
| 53 | "//frc971/control_loops/drivetrain/localization:localizer_output_fbs", |
| 54 | "//frc971/vision:vision_fbs", |
| 55 | "//y2023/localizer", |
milind-u | 607f323 | 2023-02-26 15:22:40 -0800 | [diff] [blame] | 56 | "//y2023/localizer:utils", |
milind-u | d4051fe | 2023-02-25 18:00:05 -0800 | [diff] [blame] | 57 | "//y2023/vision:vision_util", |
| 58 | "@com_google_absl//absl/strings", |
| 59 | ], |
| 60 | ) |
| 61 | |
| 62 | cc_binary( |
milind-u | 16e3a08 | 2023-01-21 13:53:43 -0800 | [diff] [blame] | 63 | name = "target_mapping", |
| 64 | srcs = [ |
| 65 | "target_mapping.cc", |
| 66 | ], |
| 67 | data = [ |
| 68 | "//y2023:aos_config", |
milind-u | c5a494f | 2023-02-24 15:39:22 -0800 | [diff] [blame] | 69 | "//y2023/constants:constants.json", |
| 70 | "//y2023/vision:maps", |
milind-u | 16e3a08 | 2023-01-21 13:53:43 -0800 | [diff] [blame] | 71 | ], |
| 72 | target_compatible_with = ["@platforms//os:linux"], |
| 73 | visibility = ["//y2023:__subpackages__"], |
| 74 | deps = [ |
milind-u | 09fb125 | 2023-01-28 19:21:41 -0800 | [diff] [blame] | 75 | ":aprilrobotics_lib", |
milind-u | 16e3a08 | 2023-01-21 13:53:43 -0800 | [diff] [blame] | 76 | "//aos:init", |
| 77 | "//aos/events:simulated_event_loop", |
| 78 | "//aos/events/logging:log_reader", |
Jim Ostrowski | 68965cd | 2023-03-01 20:32:51 -0800 | [diff] [blame] | 79 | "//aos/util:mcap_logger", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 80 | "//frc971/constants:constants_sender_lib", |
milind-u | 16e3a08 | 2023-01-21 13:53:43 -0800 | [diff] [blame] | 81 | "//frc971/control_loops:pose", |
| 82 | "//frc971/vision:calibration_fbs", |
| 83 | "//frc971/vision:charuco_lib", |
| 84 | "//frc971/vision:target_mapper", |
| 85 | "//third_party:opencv", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 86 | "//y2023/constants:constants_fbs", |
milind-u | c5a494f | 2023-02-24 15:39:22 -0800 | [diff] [blame] | 87 | "//y2023/constants:simulated_constants_sender", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 88 | ], |
| 89 | ) |
| 90 | |
| 91 | cc_library( |
| 92 | name = "vision_util", |
| 93 | srcs = ["vision_util.cc"], |
| 94 | hdrs = ["vision_util.h"], |
| 95 | deps = [ |
milind-u | f2a4e32 | 2023-02-01 19:33:10 -0800 | [diff] [blame] | 96 | "//third_party:opencv", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 97 | "//y2023/constants:constants_fbs", |
| 98 | "@com_github_google_glog//:glog", |
milind-u | 16e3a08 | 2023-01-21 13:53:43 -0800 | [diff] [blame] | 99 | ], |
| 100 | ) |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 101 | |
Ravago Jones | b84f206 | 2023-01-29 13:46:59 -0800 | [diff] [blame] | 102 | cc_library( |
| 103 | name = "aprilrobotics_lib", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 104 | srcs = [ |
| 105 | "aprilrobotics.cc", |
| 106 | "aprilrobotics.h", |
| 107 | ], |
| 108 | target_compatible_with = ["@platforms//os:linux"], |
| 109 | visibility = ["//y2023:__subpackages__"], |
| 110 | deps = [ |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 111 | ":vision_util", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 112 | "//aos:init", |
| 113 | "//aos/events:shm_event_loop", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 114 | "//frc971/constants:constants_sender_lib", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 115 | "//frc971/vision:calibration_fbs", |
| 116 | "//frc971/vision:charuco_lib", |
| 117 | "//frc971/vision:target_map_fbs", |
| 118 | "//frc971/vision:target_mapper", |
| 119 | "//frc971/vision:vision_fbs", |
| 120 | "//third_party:opencv", |
| 121 | "//third_party/apriltag", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 122 | "//y2023/constants:constants_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 123 | ], |
| 124 | ) |
Ravago Jones | b84f206 | 2023-01-29 13:46:59 -0800 | [diff] [blame] | 125 | |
| 126 | cc_binary( |
| 127 | name = "aprilrobotics", |
| 128 | srcs = [ |
| 129 | "aprilrobotics_main.cc", |
| 130 | ], |
| 131 | target_compatible_with = ["@platforms//os:linux"], |
| 132 | visibility = ["//y2023:__subpackages__"], |
| 133 | deps = [ |
| 134 | ":aprilrobotics_lib", |
| 135 | "//aos:init", |
| 136 | "//aos/events:shm_event_loop", |
| 137 | ], |
| 138 | ) |
James Kuszmaul | 77d536c | 2023-02-11 17:30:59 -0800 | [diff] [blame] | 139 | |
Yash Chainani | 10b7b02 | 2023-02-22 14:34:04 -0800 | [diff] [blame] | 140 | cc_test( |
| 141 | name = "april_detection_test", |
| 142 | srcs = [ |
| 143 | "april_detection_test.cc", |
| 144 | ], |
| 145 | data = [ |
| 146 | "//y2023:aos_config", |
| 147 | "//y2023/constants:constants.json", |
| 148 | "@apriltag_test_bfbs_images", |
| 149 | ], |
| 150 | deps = [ |
| 151 | ":aprilrobotics_lib", |
| 152 | "//aos:flatbuffer_merge", |
| 153 | "//aos:json_to_flatbuffer", |
| 154 | "//aos/events:simulated_event_loop", |
| 155 | "//aos/testing:googletest", |
| 156 | "//aos/testing:path", |
| 157 | "//aos/testing:test_logging", |
| 158 | "//frc971/constants:constants_sender_lib", |
| 159 | "//frc971/vision:target_mapper", |
| 160 | "//frc971/vision:vision_fbs", |
| 161 | "//y2023/constants:constants_fbs", |
| 162 | "//y2023/constants:constants_list_fbs", |
| 163 | ], |
| 164 | ) |
| 165 | |
milind-u | 8e98cb9 | 2023-02-05 16:07:10 -0800 | [diff] [blame] | 166 | filegroup( |
| 167 | name = "image_streamer_start", |
| 168 | srcs = ["image_streamer_start.sh"], |
| 169 | visibility = ["//visibility:public"], |
| 170 | ) |
| 171 | |
James Kuszmaul | 77d536c | 2023-02-11 17:30:59 -0800 | [diff] [blame] | 172 | cc_binary( |
| 173 | name = "foxglove_image_converter", |
| 174 | srcs = ["foxglove_image_converter.cc"], |
| 175 | visibility = ["//y2023:__subpackages__"], |
| 176 | deps = [ |
| 177 | "//aos:init", |
| 178 | "//aos/events:shm_event_loop", |
| 179 | "//frc971/vision:foxglove_image_converter_lib", |
| 180 | ], |
| 181 | ) |
James Kuszmaul | d6199be | 2023-02-11 19:56:28 -0800 | [diff] [blame] | 182 | |
| 183 | cc_binary( |
| 184 | name = "calibrate_extrinsics", |
| 185 | srcs = [ |
| 186 | "calibrate_extrinsics.cc", |
| 187 | ], |
| 188 | target_compatible_with = ["@platforms//os:linux"], |
| 189 | deps = [ |
| 190 | "//aos:init", |
| 191 | "//aos/events/logging:log_reader", |
| 192 | "//frc971/constants:constants_sender_lib", |
| 193 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 194 | "//frc971/vision:extrinsics_calibration", |
| 195 | "//third_party:opencv", |
| 196 | "//y2023/constants:constants_fbs", |
| 197 | "//y2023/vision:vision_util", |
| 198 | ], |
| 199 | ) |
Filip Kujawa | 3004f20 | 2023-02-12 16:41:40 -0800 | [diff] [blame] | 200 | |
| 201 | cc_binary( |
| 202 | name = "game_pieces_detector", |
| 203 | srcs = [ |
| 204 | "game_pieces_main.cc", |
| 205 | ], |
| 206 | target_compatible_with = ["@platforms//os:linux"], |
| 207 | visibility = ["//y2023:__subpackages__"], |
| 208 | deps = [ |
| 209 | ":game_pieces_lib", |
| 210 | "//aos:init", |
| 211 | "//aos/events:shm_event_loop", |
| 212 | ], |
| 213 | ) |
| 214 | |
| 215 | cc_library( |
| 216 | name = "game_pieces_lib", |
| 217 | srcs = [ |
| 218 | "game_pieces.cc", |
| 219 | ], |
| 220 | hdrs = [ |
| 221 | "game_pieces.h", |
| 222 | ], |
| 223 | data = [ |
| 224 | "//y2023:aos_config", |
| 225 | ], |
| 226 | target_compatible_with = ["@platforms//os:linux"], |
| 227 | visibility = ["//y2023:__subpackages__"], |
| 228 | deps = [ |
| 229 | ":game_pieces_fbs", |
| 230 | "//aos/events:event_loop", |
| 231 | "//aos/events:shm_event_loop", |
| 232 | "//frc971/vision:vision_fbs", |
| 233 | ], |
| 234 | ) |
| 235 | |
| 236 | flatbuffer_cc_library( |
| 237 | name = "game_pieces_fbs", |
| 238 | srcs = ["game_pieces.fbs"], |
| 239 | gen_reflections = 1, |
| 240 | target_compatible_with = ["@platforms//os:linux"], |
| 241 | visibility = ["//visibility:public"], |
| 242 | ) |
Maxwell Henderson | bf1bcec | 2023-03-05 18:00:20 -0800 | [diff] [blame] | 243 | |
| 244 | flatbuffer_ts_library( |
| 245 | name = "game_pieces_ts_fbs", |
| 246 | srcs = ["game_pieces.fbs"], |
| 247 | target_compatible_with = ["@platforms//os:linux"], |
| 248 | visibility = ["//visibility:public"], |
| 249 | ) |
milind-u | a96c518 | 2023-03-10 23:31:11 -0800 | [diff] [blame] | 250 | |
| 251 | cc_binary( |
| 252 | name = "image_logger", |
| 253 | srcs = [ |
| 254 | "image_logger.cc", |
| 255 | ], |
| 256 | target_compatible_with = ["@platforms//os:linux"], |
| 257 | visibility = ["//visibility:public"], |
| 258 | deps = [ |
| 259 | "//aos:configuration", |
| 260 | "//aos:init", |
| 261 | "//aos/events:shm_event_loop", |
| 262 | "//aos/events/logging:log_writer", |
| 263 | "//aos/logging:log_namer", |
| 264 | "//frc971/input:joystick_state_fbs", |
| 265 | "@com_github_gflags_gflags//:gflags", |
| 266 | "@com_github_google_glog//:glog", |
| 267 | ], |
| 268 | ) |