Yash Chainani | 728ae22 | 2023-02-04 19:48:12 -0800 | [diff] [blame] | 1 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
| 2 | |
milind-u | fbc48c9 | 2023-01-21 12:56:16 -0800 | [diff] [blame] | 3 | py_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 | |
| 19 | genrule( |
| 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 | |
| 34 | cc_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 Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 46 | cc_binary( |
| 47 | name = "camera_reader", |
| 48 | srcs = [ |
| 49 | "camera_reader.cc", |
Ravago Jones | e870007 | 2023-01-14 19:41:56 -0800 | [diff] [blame] | 50 | "rkisp1-config.h", |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 51 | ], |
Ravago Jones | e870007 | 2023-01-14 19:41:56 -0800 | [diff] [blame] | 52 | target_compatible_with = [ |
| 53 | "@platforms//os:linux", |
| 54 | "//tools/platforms/hardware:raspberry_pi", |
| 55 | ], |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 56 | 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 | |
| 65 | cc_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 Jones | 17e13a2 | 2023-01-28 17:12:11 -0800 | [diff] [blame] | 74 | "//aos:json_to_flatbuffer", |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 75 | "//aos/events:shm_event_loop", |
| 76 | "//frc971/vision:vision_fbs", |
| 77 | "//third_party:opencv", |
Ravago Jones | 17e13a2 | 2023-01-28 17:12:11 -0800 | [diff] [blame] | 78 | "@com_google_absl//absl/strings", |
Austin Schuh | db2ed9d | 2022-12-26 14:02:26 -0800 | [diff] [blame] | 79 | ], |
| 80 | ) |
milind-u | 16e3a08 | 2023-01-21 13:53:43 -0800 | [diff] [blame] | 81 | |
| 82 | cc_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-u | 09fb125 | 2023-01-28 19:21:41 -0800 | [diff] [blame] | 93 | ":aprilrobotics_lib", |
milind-u | 16e3a08 | 2023-01-21 13:53:43 -0800 | [diff] [blame] | 94 | ":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 Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 105 | |
Yash Chainani | 728ae22 | 2023-02-04 19:48:12 -0800 | [diff] [blame] | 106 | flatbuffer_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 Jones | b84f206 | 2023-01-29 13:46:59 -0800 | [diff] [blame] | 114 | cc_library( |
| 115 | name = "aprilrobotics_lib", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 116 | srcs = [ |
| 117 | "aprilrobotics.cc", |
| 118 | "aprilrobotics.h", |
| 119 | ], |
| 120 | target_compatible_with = ["@platforms//os:linux"], |
| 121 | visibility = ["//y2023:__subpackages__"], |
| 122 | deps = [ |
Yash Chainani | 728ae22 | 2023-02-04 19:48:12 -0800 | [diff] [blame] | 123 | ":april_debug_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 124 | ":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 Jones | b84f206 | 2023-01-29 13:46:59 -0800 | [diff] [blame] | 136 | |
| 137 | cc_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 | ) |