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