milind-u | 2f101fc | 2023-01-21 12:28:49 -0800 | [diff] [blame] | 1 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_py_library") |
Austin Schuh | a1d006e | 2022-09-14 21:50:42 -0700 | [diff] [blame] | 2 | load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library") |
Jim Ostrowski | 977850f | 2022-01-22 21:04:22 -0800 | [diff] [blame] | 3 | |
| 4 | flatbuffer_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 | |
| 12 | flatbuffer_ts_library( |
| 13 | name = "vision_ts_fbs", |
| 14 | srcs = ["vision.fbs"], |
| 15 | target_compatible_with = ["@platforms//os:linux"], |
| 16 | visibility = ["//visibility:public"], |
| 17 | ) |
| 18 | |
milind-u | 2f101fc | 2023-01-21 12:28:49 -0800 | [diff] [blame] | 19 | flatbuffer_cc_library( |
| 20 | name = "calibration_fbs", |
| 21 | srcs = ["calibration.fbs"], |
| 22 | gen_reflections = 1, |
| 23 | target_compatible_with = ["@platforms//os:linux"], |
| 24 | visibility = ["//visibility:public"], |
| 25 | ) |
| 26 | |
| 27 | flatbuffer_ts_library( |
| 28 | name = "calibration_ts_fbs", |
| 29 | srcs = ["calibration.fbs"], |
| 30 | target_compatible_with = ["@platforms//os:linux"], |
| 31 | visibility = ["//visibility:public"], |
| 32 | ) |
| 33 | |
| 34 | flatbuffer_py_library( |
| 35 | name = "calibration_fbs_python", |
| 36 | srcs = [ |
| 37 | "calibration.fbs", |
| 38 | ], |
| 39 | namespace = "frc971.vision.calibration", |
| 40 | tables = [ |
| 41 | "CalibrationData", |
| 42 | "CameraCalibration", |
| 43 | "TransformationMatrix", |
| 44 | ], |
| 45 | target_compatible_with = ["@platforms//os:linux"], |
| 46 | visibility = ["//visibility:public"], |
| 47 | ) |
| 48 | |
milind-u | 959d6bd | 2023-01-21 12:32:52 -0800 | [diff] [blame] | 49 | py_library( |
| 50 | name = "create_calib_file", |
| 51 | srcs = [ |
| 52 | "create_calib_file.py", |
| 53 | ], |
| 54 | target_compatible_with = ["@platforms//os:linux"], |
| 55 | visibility = ["//visibility:public"], |
| 56 | deps = [ |
| 57 | ":calibration_fbs_python", |
| 58 | "@bazel_tools//tools/python/runfiles", |
| 59 | "@pip//glog", |
| 60 | "@pip//opencv_python", |
| 61 | ], |
| 62 | ) |
| 63 | |
Jim Ostrowski | 977850f | 2022-01-22 21:04:22 -0800 | [diff] [blame] | 64 | cc_library( |
| 65 | name = "v4l2_reader", |
| 66 | srcs = [ |
| 67 | "v4l2_reader.cc", |
| 68 | ], |
| 69 | hdrs = [ |
| 70 | "v4l2_reader.h", |
| 71 | ], |
| 72 | target_compatible_with = ["@platforms//os:linux"], |
| 73 | visibility = ["//visibility:public"], |
| 74 | deps = [ |
| 75 | ":vision_fbs", |
Ravago Jones | dc52475 | 2022-12-27 01:15:13 -0800 | [diff] [blame] | 76 | "//aos/events:epoll", |
Jim Ostrowski | 977850f | 2022-01-22 21:04:22 -0800 | [diff] [blame] | 77 | "//aos/events:event_loop", |
| 78 | "//aos/scoped:scoped_fd", |
Ravago Jones | c6b919f | 2023-01-01 21:34:12 -0800 | [diff] [blame^] | 79 | "//aos/util:threaded_consumer", |
Jim Ostrowski | 977850f | 2022-01-22 21:04:22 -0800 | [diff] [blame] | 80 | "@com_github_google_glog//:glog", |
| 81 | "@com_google_absl//absl/base", |
| 82 | ], |
| 83 | ) |
Austin Schuh | dcb6b36 | 2022-02-25 18:06:21 -0800 | [diff] [blame] | 84 | |
| 85 | cc_library( |
| 86 | name = "charuco_lib", |
| 87 | srcs = [ |
| 88 | "charuco_lib.cc", |
| 89 | ], |
| 90 | hdrs = [ |
| 91 | "charuco_lib.h", |
| 92 | ], |
| 93 | target_compatible_with = ["@platforms//os:linux"], |
| 94 | visibility = ["//visibility:public"], |
| 95 | deps = [ |
| 96 | "//aos:flatbuffers", |
| 97 | "//aos/events:event_loop", |
| 98 | "//aos/network:message_bridge_server_fbs", |
| 99 | "//aos/network:team_number", |
| 100 | "//frc971/control_loops:quaternion_utils", |
| 101 | "//frc971/vision:vision_fbs", |
| 102 | "//third_party:opencv", |
| 103 | "//y2020/vision/sift:sift_fbs", |
| 104 | "//y2020/vision/sift:sift_training_fbs", |
| 105 | "//y2020/vision/tools/python_code:sift_training_data", |
| 106 | "@com_github_google_glog//:glog", |
| 107 | "@com_google_absl//absl/strings:str_format", |
| 108 | "@com_google_absl//absl/types:span", |
| 109 | "@org_tuxfamily_eigen//:eigen", |
| 110 | ], |
| 111 | ) |
| 112 | |
| 113 | cc_library( |
| 114 | name = "extrinsics_calibration", |
| 115 | srcs = [ |
| 116 | "calibration_accumulator.cc", |
| 117 | "calibration_accumulator.h", |
| 118 | "extrinsics_calibration.cc", |
| 119 | "extrinsics_calibration.h", |
| 120 | ], |
| 121 | target_compatible_with = ["@platforms//os:linux"], |
| 122 | visibility = ["//visibility:public"], |
| 123 | deps = [ |
| 124 | ":charuco_lib", |
| 125 | "//aos:init", |
| 126 | "//aos/events/logging:log_reader", |
| 127 | "//frc971/analysis:in_process_plotter", |
| 128 | "//frc971/control_loops/drivetrain:improved_down_estimator", |
Jim Ostrowski | ba2edd1 | 2022-12-03 15:44:37 -0800 | [diff] [blame] | 129 | "//frc971/vision:visualize_robot", |
Austin Schuh | dcb6b36 | 2022-02-25 18:06:21 -0800 | [diff] [blame] | 130 | "//frc971/wpilib:imu_batch_fbs", |
| 131 | "//frc971/wpilib:imu_fbs", |
| 132 | "//third_party:opencv", |
| 133 | "@com_google_absl//absl/strings:str_format", |
| 134 | "@com_google_ceres_solver//:ceres", |
| 135 | "@org_tuxfamily_eigen//:eigen", |
| 136 | ], |
| 137 | ) |
Milind Upadhyay | b67c618 | 2022-10-22 13:45:45 -0700 | [diff] [blame] | 138 | |
Milind Upadhyay | cd677a3 | 2022-12-04 13:06:43 -0800 | [diff] [blame] | 139 | flatbuffer_cc_library( |
| 140 | name = "target_map_fbs", |
| 141 | srcs = ["target_map.fbs"], |
| 142 | gen_reflections = 1, |
| 143 | target_compatible_with = ["@platforms//os:linux"], |
| 144 | visibility = ["//visibility:public"], |
| 145 | ) |
| 146 | |
Milind Upadhyay | b67c618 | 2022-10-22 13:45:45 -0700 | [diff] [blame] | 147 | cc_library( |
Milind Upadhyay | 7c20522 | 2022-11-16 18:20:58 -0800 | [diff] [blame] | 148 | name = "target_mapper", |
| 149 | srcs = ["target_mapper.cc"], |
| 150 | hdrs = ["target_mapper.h"], |
Yash Chainani | d5c7f0d | 2022-11-19 17:05:57 -0800 | [diff] [blame] | 151 | data = ["target_map.json"], |
Milind Upadhyay | 7c20522 | 2022-11-16 18:20:58 -0800 | [diff] [blame] | 152 | target_compatible_with = ["@platforms//os:linux"], |
| 153 | visibility = ["//visibility:public"], |
| 154 | deps = [ |
| 155 | ":geometry_lib", |
Milind Upadhyay | cd677a3 | 2022-12-04 13:06:43 -0800 | [diff] [blame] | 156 | ":target_map_fbs", |
Milind Upadhyay | 7c20522 | 2022-11-16 18:20:58 -0800 | [diff] [blame] | 157 | "//aos/events:simulated_event_loop", |
| 158 | "//frc971/control_loops:control_loop", |
Milind Upadhyay | c5beba1 | 2022-12-17 17:41:20 -0800 | [diff] [blame] | 159 | "//frc971/vision/ceres:pose_graph_3d_lib", |
Milind Upadhyay | 7c20522 | 2022-11-16 18:20:58 -0800 | [diff] [blame] | 160 | "//third_party:opencv", |
| 161 | "@com_google_ceres_solver//:ceres", |
| 162 | "@org_tuxfamily_eigen//:eigen", |
| 163 | ], |
| 164 | ) |
| 165 | |
| 166 | cc_test( |
| 167 | name = "target_mapper_test", |
| 168 | srcs = [ |
| 169 | "target_mapper_test.cc", |
| 170 | ], |
Milind Upadhyay | c5beba1 | 2022-12-17 17:41:20 -0800 | [diff] [blame] | 171 | data = [":target_map.json"], |
Milind Upadhyay | 7c20522 | 2022-11-16 18:20:58 -0800 | [diff] [blame] | 172 | target_compatible_with = ["@platforms//os:linux"], |
| 173 | deps = [ |
| 174 | ":target_mapper", |
| 175 | "//aos/events:simulated_event_loop", |
| 176 | "//aos/testing:googletest", |
Milind Upadhyay | c5beba1 | 2022-12-17 17:41:20 -0800 | [diff] [blame] | 177 | "//aos/testing:path", |
Milind Upadhyay | 7c20522 | 2022-11-16 18:20:58 -0800 | [diff] [blame] | 178 | "//aos/testing:random_seed", |
Milind Upadhyay | c5beba1 | 2022-12-17 17:41:20 -0800 | [diff] [blame] | 179 | "//aos/util:math", |
Milind Upadhyay | 7c20522 | 2022-11-16 18:20:58 -0800 | [diff] [blame] | 180 | ], |
| 181 | ) |
| 182 | |
| 183 | cc_library( |
Milind Upadhyay | b67c618 | 2022-10-22 13:45:45 -0700 | [diff] [blame] | 184 | name = "geometry_lib", |
| 185 | hdrs = [ |
| 186 | "geometry.h", |
| 187 | ], |
| 188 | target_compatible_with = ["@platforms//os:linux"], |
| 189 | visibility = ["//visibility:public"], |
| 190 | deps = [ |
| 191 | "//aos/util:math", |
| 192 | "//third_party:opencv", |
| 193 | "@com_github_google_glog//:glog", |
| 194 | ], |
| 195 | ) |
| 196 | |
| 197 | cc_test( |
| 198 | name = "geometry_test", |
| 199 | srcs = [ |
| 200 | "geometry_test.cc", |
| 201 | ], |
| 202 | deps = [ |
| 203 | ":geometry_lib", |
| 204 | "//aos/testing:googletest", |
| 205 | ], |
| 206 | ) |
Jim Ostrowski | ba2edd1 | 2022-12-03 15:44:37 -0800 | [diff] [blame] | 207 | |
| 208 | cc_library( |
| 209 | name = "visualize_robot", |
| 210 | srcs = [ |
| 211 | "visualize_robot.cc", |
| 212 | ], |
| 213 | hdrs = [ |
| 214 | "visualize_robot.h", |
| 215 | ], |
| 216 | deps = [ |
| 217 | "//aos:init", |
| 218 | "//third_party:opencv", |
| 219 | "@com_google_absl//absl/strings:str_format", |
| 220 | "@org_tuxfamily_eigen//:eigen", |
| 221 | ], |
| 222 | ) |
| 223 | |
| 224 | cc_binary( |
| 225 | name = "visualize_robot_sample", |
| 226 | srcs = [ |
| 227 | "visualize_robot_sample.cc", |
| 228 | ], |
| 229 | target_compatible_with = ["@platforms//os:linux"], |
| 230 | visibility = ["//visibility:public"], |
| 231 | deps = [ |
| 232 | "//aos:init", |
| 233 | "//frc971/vision:visualize_robot", |
| 234 | "//third_party:opencv", |
| 235 | "@com_github_google_glog//:glog", |
| 236 | "@com_google_ceres_solver//:ceres", |
| 237 | "@org_tuxfamily_eigen//:eigen", |
| 238 | ], |
| 239 | ) |
Austin Schuh | c97d48d | 2022-12-26 14:09:13 -0800 | [diff] [blame] | 240 | |
| 241 | cc_library( |
| 242 | name = "media_device", |
| 243 | srcs = [ |
| 244 | "media_device.cc", |
| 245 | ], |
| 246 | hdrs = ["media_device.h"], |
| 247 | visibility = ["//visibility:public"], |
| 248 | deps = [ |
| 249 | "//aos/scoped:scoped_fd", |
| 250 | "//aos/util:file", |
| 251 | "@com_github_google_glog//:glog", |
| 252 | "@com_google_absl//absl/strings", |
| 253 | ], |
| 254 | ) |
James Kuszmaul | 0c59396 | 2023-01-28 16:04:20 -0800 | [diff] [blame] | 255 | |
| 256 | cc_library( |
| 257 | name = "foxglove_image_converter", |
| 258 | srcs = ["foxglove_image_converter.cc"], |
| 259 | hdrs = ["foxglove_image_converter.h"], |
| 260 | visibility = ["//visibility:public"], |
| 261 | deps = [ |
| 262 | ":vision_fbs", |
| 263 | "//aos/events:event_loop", |
| 264 | "//third_party:opencv", |
| 265 | "@com_github_foxglove_schemas//:schemas", |
| 266 | ], |
| 267 | ) |