Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 1 | load("//frc971:downloader.bzl", "robot_downloader") |
| 2 | load("//aos:config.bzl", "aos_config") |
| 3 | load("//tools/build_rules:template.bzl", "jinja2_template") |
| 4 | |
| 5 | robot_downloader( |
| 6 | name = "pi_download", |
| 7 | binaries = [ |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 8 | "//y2020/vision:calibration", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 9 | "//y2023/vision:viewer", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 10 | "//y2023/vision:aprilrobotics", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 11 | "//y2022/localizer:localizer_main", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 12 | "//y2023/constants:constants_sender", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 13 | "//aos/network:web_proxy_main", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 14 | "//aos/events/logging:log_cat", |
Austin Schuh | b07dd5b | 2023-02-05 22:29:11 -0800 | [diff] [blame] | 15 | "//y2023/rockpi:imu_main", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 16 | ], |
| 17 | data = [ |
| 18 | ":aos_config", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 19 | ":message_bridge_client.sh", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 20 | "//y2023/constants:constants.json", |
| 21 | "//y2023/www:www_files", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 22 | ], |
| 23 | dirs = [ |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 24 | "//y2023/www:www_files", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 25 | ], |
| 26 | start_binaries = [ |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 27 | "//aos/network:message_bridge_client", |
| 28 | "//aos/network:message_bridge_server", |
| 29 | "//aos/network:web_proxy_main", |
Austin Schuh | 3e1d3b6 | 2023-01-08 13:52:31 -0800 | [diff] [blame] | 30 | "//aos/starter:irq_affinity", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 31 | "//y2023/vision:camera_reader", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 32 | "//aos/events/logging:logger_main", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 33 | ], |
| 34 | target_compatible_with = ["//tools/platforms/hardware:raspberry_pi"], |
| 35 | target_type = "pi", |
| 36 | ) |
| 37 | |
| 38 | aos_config( |
| 39 | name = "aos_config", |
| 40 | src = "y2023.json", |
| 41 | flatbuffers = [ |
| 42 | "//aos/network:message_bridge_client_fbs", |
| 43 | "//aos/network:message_bridge_server_fbs", |
| 44 | "//aos/network:timestamp_fbs", |
| 45 | "//frc971/input:robot_state_fbs", |
| 46 | "//frc971/vision:vision_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 47 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 48 | ], |
| 49 | target_compatible_with = ["@platforms//os:linux"], |
| 50 | visibility = ["//visibility:public"], |
| 51 | deps = [ |
| 52 | ":config_imu", |
| 53 | ":config_logger", |
| 54 | ":config_pi1", |
| 55 | ":config_pi2", |
| 56 | ":config_pi3", |
| 57 | ":config_pi4", |
| 58 | ":config_roborio", |
| 59 | ], |
| 60 | ) |
| 61 | |
| 62 | [ |
| 63 | aos_config( |
| 64 | name = "config_" + pi, |
| 65 | src = "y2023_" + pi + ".json", |
| 66 | flatbuffers = [ |
| 67 | "//aos/network:message_bridge_client_fbs", |
| 68 | "//aos/network:message_bridge_server_fbs", |
| 69 | "//aos/network:timestamp_fbs", |
| 70 | "//aos/network:remote_message_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 71 | "//y2023/constants:constants_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 72 | "//y2022/localizer:localizer_output_fbs", |
milind-u | 2f101fc | 2023-01-21 12:28:49 -0800 | [diff] [blame] | 73 | "//frc971/vision:calibration_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 74 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 75 | "//frc971/vision:vision_fbs", |
Yash Chainani | 728ae22 | 2023-02-04 19:48:12 -0800 | [diff] [blame] | 76 | "//y2023/vision:april_debug_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 77 | ], |
| 78 | target_compatible_with = ["@platforms//os:linux"], |
| 79 | visibility = ["//visibility:public"], |
| 80 | deps = [ |
| 81 | "//aos/events:aos_config", |
| 82 | "//frc971/control_loops/drivetrain:aos_config", |
| 83 | "//frc971/input:aos_config", |
| 84 | ], |
| 85 | ) |
| 86 | for pi in [ |
| 87 | "pi1", |
| 88 | "pi2", |
| 89 | "pi3", |
| 90 | "pi4", |
| 91 | ] |
| 92 | ] |
| 93 | |
| 94 | aos_config( |
| 95 | name = "config_imu", |
| 96 | src = "y2023_imu.json", |
| 97 | flatbuffers = [ |
| 98 | "//aos/network:message_bridge_client_fbs", |
| 99 | "//aos/network:message_bridge_server_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 100 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 101 | "//aos/network:timestamp_fbs", |
| 102 | "//aos/network:remote_message_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 103 | "//y2022/localizer:localizer_status_fbs", |
| 104 | "//y2022/localizer:localizer_output_fbs", |
| 105 | "//y2022/localizer:localizer_visualization_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 106 | "//frc971/vision:target_map_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 107 | ], |
| 108 | target_compatible_with = ["@platforms//os:linux"], |
| 109 | visibility = ["//visibility:public"], |
| 110 | deps = [ |
| 111 | "//aos/events:aos_config", |
| 112 | "//frc971/control_loops/drivetrain:aos_config", |
| 113 | ], |
| 114 | ) |
| 115 | |
| 116 | aos_config( |
| 117 | name = "config_logger", |
| 118 | src = "y2023_logger.json", |
| 119 | flatbuffers = [ |
| 120 | "//aos/network:message_bridge_client_fbs", |
| 121 | "//aos/network:message_bridge_server_fbs", |
| 122 | "//aos/network:timestamp_fbs", |
| 123 | "//aos/network:remote_message_fbs", |
milind-u | 2f101fc | 2023-01-21 12:28:49 -0800 | [diff] [blame] | 124 | "//frc971/vision:calibration_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 125 | "//frc971/vision:vision_fbs", |
Maxwell Henderson | febee25 | 2023-01-28 16:53:52 -0800 | [diff] [blame] | 126 | "//frc971/vision:target_map_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 127 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 128 | ], |
| 129 | target_compatible_with = ["@platforms//os:linux"], |
| 130 | visibility = ["//visibility:public"], |
| 131 | deps = [ |
| 132 | "//aos/events:aos_config", |
| 133 | "//frc971/control_loops/drivetrain:aos_config", |
| 134 | "//frc971/input:aos_config", |
| 135 | ], |
| 136 | ) |
| 137 | |
| 138 | aos_config( |
| 139 | name = "config_roborio", |
| 140 | src = "y2023_roborio.json", |
| 141 | flatbuffers = [ |
| 142 | "//aos/network:remote_message_fbs", |
| 143 | "//aos/network:message_bridge_client_fbs", |
| 144 | "//aos/network:message_bridge_server_fbs", |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 145 | "//y2023/constants:constants_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 146 | "//aos/network:timestamp_fbs", |
| 147 | "//y2019/control_loops/drivetrain:target_selector_fbs", |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 148 | "//y2023/control_loops/superstructure:superstructure_goal_fbs", |
| 149 | "//y2023/control_loops/superstructure:superstructure_output_fbs", |
| 150 | "//y2023/control_loops/superstructure:superstructure_position_fbs", |
| 151 | "//y2023/control_loops/superstructure:superstructure_status_fbs", |
Austin Schuh | 9f164e9 | 2022-12-29 16:15:28 -0800 | [diff] [blame] | 152 | ], |
| 153 | target_compatible_with = ["@platforms//os:linux"], |
| 154 | deps = [ |
| 155 | "//aos/events:aos_config", |
| 156 | "//frc971/autonomous:aos_config", |
| 157 | "//frc971/control_loops/drivetrain:aos_config", |
| 158 | "//frc971/input:aos_config", |
| 159 | "//frc971/wpilib:aos_config", |
| 160 | ], |
| 161 | ) |
| 162 | |
| 163 | [ |
| 164 | jinja2_template( |
| 165 | name = "y2023_pi" + str(num) + ".json", |
| 166 | src = "y2023_pi_template.json", |
| 167 | parameters = {"NUM": str(num)}, |
| 168 | target_compatible_with = ["@platforms//os:linux"], |
| 169 | ) |
| 170 | for num in range(1, 6) |
| 171 | ] |
Maxwell Henderson | ad31234 | 2023-01-10 12:07:47 -0800 | [diff] [blame] | 172 | |
| 173 | cc_library( |
| 174 | name = "constants", |
| 175 | srcs = [ |
| 176 | "constants.cc", |
| 177 | ], |
| 178 | hdrs = [ |
| 179 | "constants.h", |
| 180 | ], |
| 181 | visibility = ["//visibility:public"], |
| 182 | deps = [ |
| 183 | "//aos/mutex", |
| 184 | "//aos/network:team_number", |
| 185 | "//frc971:constants", |
| 186 | "//frc971/control_loops:pose", |
| 187 | "//frc971/control_loops:static_zeroing_single_dof_profiled_subsystem", |
| 188 | "//frc971/shooter_interpolation:interpolation", |
| 189 | "//y2023/control_loops/drivetrain:polydrivetrain_plants", |
| 190 | "@com_github_google_glog//:glog", |
| 191 | "@com_google_absl//absl/base", |
| 192 | ], |
| 193 | ) |
| 194 | |
| 195 | cc_binary( |
| 196 | name = "wpilib_interface", |
| 197 | srcs = [ |
| 198 | "wpilib_interface.cc", |
| 199 | ], |
| 200 | target_compatible_with = ["//tools/platforms/hardware:roborio"], |
| 201 | deps = [ |
| 202 | ":constants", |
| 203 | "//aos:init", |
| 204 | "//aos:math", |
| 205 | "//aos/events:shm_event_loop", |
| 206 | "//aos/logging", |
| 207 | "//aos/stl_mutex", |
| 208 | "//aos/time", |
| 209 | "//aos/util:log_interval", |
| 210 | "//aos/util:phased_loop", |
| 211 | "//aos/util:wrapping_counter", |
| 212 | "//frc971/autonomous:auto_mode_fbs", |
| 213 | "//frc971/control_loops:control_loop", |
| 214 | "//frc971/control_loops:control_loops_fbs", |
| 215 | "//frc971/control_loops/drivetrain:drivetrain_position_fbs", |
| 216 | "//frc971/input:robot_state_fbs", |
| 217 | "//frc971/queues:gyro_fbs", |
| 218 | "//frc971/wpilib:ADIS16448", |
| 219 | "//frc971/wpilib:buffered_pcm", |
| 220 | "//frc971/wpilib:drivetrain_writer", |
| 221 | "//frc971/wpilib:encoder_and_potentiometer", |
| 222 | "//frc971/wpilib:interrupt_edge_counting", |
| 223 | "//frc971/wpilib:joystick_sender", |
| 224 | "//frc971/wpilib:logging_fbs", |
| 225 | "//frc971/wpilib:loop_output_handler", |
| 226 | "//frc971/wpilib:pdp_fetcher", |
| 227 | "//frc971/wpilib:sensor_reader", |
| 228 | "//frc971/wpilib:wpilib_interface", |
| 229 | "//frc971/wpilib:wpilib_robot_base", |
| 230 | "//third_party:phoenix", |
| 231 | "//third_party:wpilib", |
| 232 | "//y2023/control_loops/superstructure:superstructure_output_fbs", |
| 233 | "//y2023/control_loops/superstructure:superstructure_position_fbs", |
| 234 | ], |
| 235 | ) |
| 236 | |
| 237 | cc_binary( |
| 238 | name = "joystick_reader", |
| 239 | srcs = [ |
| 240 | ":joystick_reader.cc", |
| 241 | ], |
| 242 | deps = [ |
| 243 | ":constants", |
| 244 | "//aos:init", |
| 245 | "//aos/actions:action_lib", |
| 246 | "//aos/logging", |
| 247 | "//frc971/autonomous:auto_fbs", |
| 248 | "//frc971/autonomous:base_autonomous_actor", |
| 249 | "//frc971/control_loops:profiled_subsystem_fbs", |
| 250 | "//frc971/input:action_joystick_input", |
| 251 | "//frc971/input:drivetrain_input", |
| 252 | "//frc971/input:joystick_input", |
| 253 | "//y2023/control_loops/drivetrain:drivetrain_base", |
| 254 | "//y2023/control_loops/superstructure:superstructure_goal_fbs", |
| 255 | "//y2023/control_loops/superstructure:superstructure_status_fbs", |
| 256 | ], |
| 257 | ) |
| 258 | |
| 259 | py_library( |
| 260 | name = "python_init", |
| 261 | srcs = ["__init__.py"], |
| 262 | target_compatible_with = ["@platforms//os:linux"], |
| 263 | visibility = ["//visibility:public"], |
| 264 | ) |
| 265 | |
| 266 | sh_binary( |
| 267 | name = "log_web_proxy", |
| 268 | srcs = ["log_web_proxy.sh"], |
| 269 | data = [ |
| 270 | ":aos_config", |
| 271 | "//aos/network:log_web_proxy_main", |
| 272 | "//y2023/www:field_main_bundle.min.js", |
| 273 | "//y2023/www:files", |
| 274 | ], |
| 275 | target_compatible_with = ["@platforms//os:linux"], |
| 276 | ) |
Austin Schuh | e6b2b88 | 2023-02-04 11:42:40 -0800 | [diff] [blame] | 277 | |
| 278 | cc_binary( |
| 279 | name = "ssd_profiler", |
| 280 | srcs = [ |
| 281 | "ssd_profiler.cc", |
| 282 | ], |
| 283 | deps = [ |
| 284 | "//aos:init", |
| 285 | "//aos/time", |
| 286 | "@com_github_google_glog//:glog", |
| 287 | ], |
| 288 | ) |