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