James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 1 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library") |
| 2 | load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library") |
| 3 | |
| 4 | flatbuffer_cc_library( |
| 5 | name = "status_fbs", |
| 6 | srcs = [ |
| 7 | "status.fbs", |
| 8 | ], |
| 9 | gen_reflections = True, |
| 10 | target_compatible_with = ["@platforms//os:linux"], |
| 11 | visibility = ["//visibility:public"], |
| 12 | deps = [ |
| 13 | "//frc971/control_loops/drivetrain:drivetrain_status_fbs", |
| 14 | "//frc971/imu_reader:imu_failures_fbs", |
| 15 | ], |
| 16 | ) |
| 17 | |
| 18 | flatbuffer_ts_library( |
| 19 | name = "status_ts_fbs", |
| 20 | srcs = ["status.fbs"], |
| 21 | visibility = ["//visibility:public"], |
| 22 | deps = [ |
| 23 | "//frc971/control_loops/drivetrain:drivetrain_status_ts_fbs", |
| 24 | "//frc971/imu_reader:imu_failures_ts_fbs", |
| 25 | ], |
| 26 | ) |
| 27 | |
| 28 | flatbuffer_cc_library( |
| 29 | name = "visualization_fbs", |
| 30 | srcs = [ |
| 31 | "visualization.fbs", |
| 32 | ], |
| 33 | gen_reflections = True, |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 34 | visibility = ["//visibility:public"], |
| 35 | deps = [ |
| 36 | ":status_fbs", |
| 37 | ], |
| 38 | ) |
| 39 | |
| 40 | flatbuffer_ts_library( |
| 41 | name = "visualization_ts_fbs", |
| 42 | srcs = ["visualization.fbs"], |
| 43 | visibility = ["//visibility:public"], |
| 44 | deps = [ |
| 45 | ":status_ts_fbs", |
| 46 | ], |
| 47 | ) |
| 48 | |
James Kuszmaul | 18008f8 | 2023-02-23 20:52:50 -0800 | [diff] [blame^] | 49 | flatbuffer_cc_library( |
| 50 | name = "scoring_map_fbs", |
| 51 | srcs = [ |
| 52 | "scoring_map.fbs", |
| 53 | ], |
| 54 | gen_reflections = True, |
| 55 | visibility = ["//visibility:public"], |
| 56 | deps = [ |
| 57 | "//frc971/vision:target_map_fbs", |
| 58 | ], |
| 59 | ) |
| 60 | |
| 61 | flatbuffer_cc_library( |
| 62 | name = "relative_scoring_map_fbs", |
| 63 | srcs = [ |
| 64 | "relative_scoring_map.fbs", |
| 65 | ], |
| 66 | gen_reflections = True, |
| 67 | visibility = ["//visibility:public"], |
| 68 | deps = [ |
| 69 | ":scoring_map_fbs", |
| 70 | ], |
| 71 | ) |
| 72 | |
| 73 | cc_library( |
| 74 | name = "utils", |
| 75 | srcs = ["utils.cc"], |
| 76 | hdrs = ["utils.h"], |
| 77 | deps = [ |
| 78 | "//frc971/vision:target_map_fbs", |
| 79 | "@org_tuxfamily_eigen//:eigen", |
| 80 | ], |
| 81 | ) |
| 82 | |
| 83 | cc_library( |
| 84 | name = "map_expander_lib", |
| 85 | srcs = ["map_expander_lib.cc"], |
| 86 | hdrs = ["map_expander_lib.h"], |
| 87 | deps = [ |
| 88 | ":relative_scoring_map_fbs", |
| 89 | ":scoring_map_fbs", |
| 90 | ":utils", |
| 91 | "//aos:flatbuffers", |
| 92 | "//aos:json_to_flatbuffer", |
| 93 | ], |
| 94 | ) |
| 95 | |
| 96 | cc_binary( |
| 97 | name = "map_expander", |
| 98 | srcs = ["map_expander.cc"], |
| 99 | data = [ |
| 100 | "//y2023/constants:scoring_map", |
| 101 | "//y2023/vision/maps", |
| 102 | ], |
| 103 | deps = [ |
| 104 | ":map_expander_lib", |
| 105 | "//aos:init", |
| 106 | ], |
| 107 | ) |
| 108 | |
| 109 | cc_test( |
| 110 | name = "map_expander_lib_test", |
| 111 | srcs = ["map_expander_lib_test.cc"], |
| 112 | data = [ |
| 113 | "//y2023/constants:scoring_map", |
| 114 | "//y2023/vision/maps", |
| 115 | ], |
| 116 | deps = [ |
| 117 | ":map_expander_lib", |
| 118 | "//aos/testing:flatbuffer_eq", |
| 119 | "//aos/testing:googletest", |
| 120 | ], |
| 121 | ) |
| 122 | |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 123 | cc_library( |
| 124 | name = "localizer", |
| 125 | srcs = ["localizer.cc"], |
| 126 | hdrs = ["localizer.h"], |
| 127 | deps = [ |
| 128 | ":status_fbs", |
James Kuszmaul | 18008f8 | 2023-02-23 20:52:50 -0800 | [diff] [blame^] | 129 | ":utils", |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 130 | ":visualization_fbs", |
| 131 | "//aos/containers:sized_array", |
| 132 | "//aos/events:event_loop", |
| 133 | "//frc971/constants:constants_sender_lib", |
| 134 | "//frc971/control_loops:pose", |
| 135 | "//frc971/control_loops/drivetrain:hybrid_ekf", |
| 136 | "//frc971/control_loops/drivetrain:improved_down_estimator", |
| 137 | "//frc971/control_loops/drivetrain:localizer_fbs", |
| 138 | "//frc971/control_loops/drivetrain/localization:localizer_output_fbs", |
| 139 | "//frc971/control_loops/drivetrain/localization:utils", |
| 140 | "//frc971/imu_reader:imu_watcher", |
| 141 | "//frc971/vision:target_map_fbs", |
| 142 | "//y2023:constants", |
| 143 | "//y2023/constants:constants_fbs", |
| 144 | ], |
| 145 | ) |
| 146 | |
| 147 | cc_test( |
| 148 | name = "localizer_test", |
| 149 | srcs = ["localizer_test.cc"], |
| 150 | data = ["//y2023:aos_config"], |
| 151 | deps = [ |
| 152 | ":localizer", |
| 153 | ":status_fbs", |
James Kuszmaul | 18008f8 | 2023-02-23 20:52:50 -0800 | [diff] [blame^] | 154 | ":utils", |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 155 | "//aos/events:simulated_event_loop", |
| 156 | "//aos/events/logging:log_writer", |
| 157 | "//aos/testing:googletest", |
| 158 | "//frc971/control_loops/drivetrain:drivetrain_test_lib", |
| 159 | "//frc971/control_loops/drivetrain:localizer_fbs", |
| 160 | "//y2023/constants:simulated_constants_sender", |
| 161 | "//y2023/control_loops/drivetrain:drivetrain_base", |
| 162 | ], |
| 163 | ) |
| 164 | |
| 165 | cc_binary( |
| 166 | name = "localizer_main", |
| 167 | srcs = ["localizer_main.cc"], |
| 168 | visibility = ["//visibility:public"], |
| 169 | deps = [ |
| 170 | ":localizer", |
| 171 | "//aos:init", |
| 172 | "//aos/events:shm_event_loop", |
| 173 | "//frc971/constants:constants_sender_lib", |
| 174 | "//y2023/control_loops/drivetrain:drivetrain_base", |
| 175 | ], |
| 176 | ) |